示例#1
0
  // end declare accessors
  public static void checkClassConsistency(ModelRoot modelRoot) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "GraphNode", //$NON-NLS-1$
        " Operation entered: GraphNode::checkClassConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return;
    }
    Graphnode_c[] objs = Graphnode_c.GraphnodeInstances(modelRoot, null, false);

    for (int i = 0; i < objs.length; i++) {
      objs[i].checkConsistency();
    }
  }
示例#2
0
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "GraphNode", //$NON-NLS-1$
        " Operation entered: GraphNode::checkConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return true;
    }
    ModelRoot modelRoot = getModelRoot();
    boolean retval = true;
    class Graphnode_c_test21773_c implements ClassQueryInterface_c {
      Graphnode_c_test21773_c(java.util.UUID p21774) {
        m_p21774 = p21774;
      }

      private java.util.UUID m_p21774;

      public boolean evaluate(Object candidate) {
        Graphnode_c selected = (Graphnode_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21774));
        return retval;
      }
    }

    Graphnode_c[] objs21772 =
        Graphnode_c.GraphnodeInstances(modelRoot, new Graphnode_c_test21773_c(getElementid()));

    if (((objs21772.length) == 0)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21772.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length),
            e);
      }
      retval = false;
    }

    if (((objs21772.length) > 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length)
                + " elementId: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length)
                + " elementId: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // GraphNode is a subtype in association: rel.Numb = 301
    // The supertype class is: GraphElement
    class Graphelement_c_test21778_c implements ClassQueryInterface_c {
      Graphelement_c_test21778_c(java.util.UUID p21779) {
        m_p21779 = p21779;
      }

      private java.util.UUID m_p21779;

      public boolean evaluate(Object candidate) {
        Graphelement_c selected = (Graphelement_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21779));
        return retval;
      }
    }

    Graphelement_c[] objs21777 =
        Graphelement_c.GraphelementInstances(
            modelRoot, new Graphelement_c_test21778_c(getElementid()));

    if (((objs21777.length) != 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Association: 301: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21777.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Association: 301: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21777.length),
            e);
      }
      retval = false;
    }

    // Supertype: rel.Numb = 19
    int objs21780 = 0;
    // Subtype Object: Shape
    class Shape_c_test21781_c implements ClassQueryInterface_c {
      Shape_c_test21781_c(java.util.UUID p21782) {
        m_p21782 = p21782;
      }

      private java.util.UUID m_p21782;

      public boolean evaluate(Object candidate) {
        Shape_c selected = (Shape_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21782));
        return retval;
      }
    }

    Shape_c[] objs21783 =
        Shape_c.ShapeInstances(modelRoot, new Shape_c_test21781_c(getElementid()));

    objs21780 = objs21780 + objs21783.length;
    // Subtype Object: Floating Text
    class FloatingText_c_test21784_c implements ClassQueryInterface_c {
      FloatingText_c_test21784_c(java.util.UUID p21785) {
        m_p21785 = p21785;
      }

      private java.util.UUID m_p21785;

      public boolean evaluate(Object candidate) {
        FloatingText_c selected = (FloatingText_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21785));
        return retval;
      }
    }

    FloatingText_c[] objs21786 =
        FloatingText_c.FloatingTextInstances(
            modelRoot, new FloatingText_c_test21784_c(getElementid()));

    objs21780 = objs21780 + objs21786.length;
    if (objs21780 != 1) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Association: 19: Cardinality of subtype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21780)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Association: 19: Cardinality of subtype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21780),
            e);
      }
      retval = false;
    }

    return retval;
  }