Ejemplo n.º 1
0
 public static void batchRelateAll(
     ModelRoot modelRoot, boolean notifyChanges, boolean searchAllRoots, boolean relateProxies) {
   InstanceList instances = modelRoot.getInstanceList(AssignToMember_c.class);
   synchronized (instances) {
     Iterator<NonRootModelElement> cursor = instances.iterator();
     while (cursor.hasNext()) {
       final AssignToMember_c inst = (AssignToMember_c) cursor.next();
       inst.batchRelate(modelRoot, relateProxies, notifyChanges, searchAllRoots);
     }
   }
 }
Ejemplo n.º 2
0
 public static AssignToMember_c createProxy(
     ModelRoot modelRoot,
     java.util.UUID p_m_statement_id,
     java.util.UUID p_m_r_value_id,
     java.util.UUID p_m_l_value_id,
     int p_m_attributelinenumber,
     int p_m_attributecolumn,
     String p_contentPath,
     IPath p_localPath) {
   ModelRoot resolvedModelRoot = ModelRoot.findModelRoot(modelRoot, p_contentPath, p_localPath);
   // if a model root was not resolved it is most likely
   // due to a missing file of the proxy, defualt back to
   // the original model root
   if (resolvedModelRoot != null) modelRoot = resolvedModelRoot;
   InstanceList instances = modelRoot.getInstanceList(AssignToMember_c.class);
   AssignToMember_c new_inst = null;
   synchronized (instances) {
     Object[] key = {p_m_statement_id};
     new_inst = (AssignToMember_c) instances.get(key);
   }
   String contentPath = PersistenceUtil.resolveRelativePath(p_localPath, new Path(p_contentPath));
   if (modelRoot.isNewCompareRoot()) {
     // for comparisons we do not want to change
     // the content path
     contentPath = p_contentPath;
   }
   if (new_inst != null && !modelRoot.isCompareRoot()) {
     PersistableModelComponent pmc = new_inst.getPersistableComponent();
     if (pmc == null) {
       // dangling reference, redo this instance
       new_inst.batchUnrelate();
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_statement_id = IdAssigner.preprocessUUID(p_m_statement_id);
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_r_value_id = IdAssigner.preprocessUUID(p_m_r_value_id);
       new_inst.m_attributelinenumber = p_m_attributelinenumber;
       new_inst.m_attributecolumn = p_m_attributecolumn;
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_l_value_id = IdAssigner.preprocessUUID(p_m_l_value_id);
     }
   }
   if (new_inst == null) {
     // there is no instance matching the id, create a proxy
     // if the resource doesn't exist then this will be a dangling reference
     new_inst =
         new AssignToMember_c(
             modelRoot,
             p_m_statement_id,
             p_m_r_value_id,
             p_m_l_value_id,
             p_m_attributelinenumber,
             p_m_attributecolumn);
     new_inst.m_contentPath = contentPath;
   }
   return new_inst;
 }
Ejemplo n.º 3
0
  // end declare accessors
  public static void checkClassConsistency(ModelRoot modelRoot) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Assign to Member", //$NON-NLS-1$
        " Operation entered: Assign to Member::checkClassConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return;
    }
    AssignToMember_c[] objs = AssignToMember_c.AssignToMemberInstances(modelRoot, null, false);

    for (int i = 0; i < objs.length; i++) {
      objs[i].checkConsistency();
    }
  }
Ejemplo n.º 4
0
  public static AssignToMember_c resolveInstance(
      ModelRoot modelRoot,
      java.util.UUID p_m_statement_id,
      java.util.UUID p_m_r_value_id,
      java.util.UUID p_m_l_value_id,
      int p_m_attributelinenumber,
      int p_m_attributecolumn) {
    InstanceList instances = modelRoot.getInstanceList(AssignToMember_c.class);
    AssignToMember_c source = null;
    synchronized (instances) {
      Object[] key = {p_m_statement_id};
      source = (AssignToMember_c) instances.get(key);
      if (source != null && !modelRoot.isCompareRoot()) {
        source.convertFromProxy();
        source.batchUnrelate();
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_statement_id = IdAssigner.preprocessUUID(p_m_statement_id);
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_r_value_id = IdAssigner.preprocessUUID(p_m_r_value_id);
        source.m_attributelinenumber = p_m_attributelinenumber;
        source.m_attributecolumn = p_m_attributecolumn;
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_l_value_id = IdAssigner.preprocessUUID(p_m_l_value_id);

        return source;
      }
    }
    // there is no instance matching the id
    AssignToMember_c new_inst =
        new AssignToMember_c(
            modelRoot,
            p_m_statement_id,
            p_m_r_value_id,
            p_m_l_value_id,
            p_m_attributelinenumber,
            p_m_attributecolumn);
    return new_inst;
  }
Ejemplo n.º 5
0
 public boolean evaluate(Object candidate) {
   AssignToMember_c selected = (AssignToMember_c) candidate;
   boolean retval = false;
   retval = (selected.getStatement_id().equals(m_p40733));
   return retval;
 }
Ejemplo n.º 6
0
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Assign to Member", //$NON-NLS-1$
        " Operation entered: Assign to Member::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 AssignToMember_c_test40732_c implements ClassQueryInterface_c {
      AssignToMember_c_test40732_c(java.util.UUID p40733) {
        m_p40733 = p40733;
      }

      private java.util.UUID m_p40733;

      public boolean evaluate(Object candidate) {
        AssignToMember_c selected = (AssignToMember_c) candidate;
        boolean retval = false;
        retval = (selected.getStatement_id().equals(m_p40733));
        return retval;
      }
    }

    AssignToMember_c[] objs40731 =
        AssignToMember_c.AssignToMemberInstances(
            modelRoot, new AssignToMember_c_test40732_c(getStatement_id()));

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

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

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

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Assign to Member", //$NON-NLS-1$
            "Consistency: Object: Assign to Member: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40731.length)
                + " Statement_ID: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Assign to Member: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40731.length)
                + " Statement_ID: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Assign to Member is a subtype in association: rel.Numb = 603
    // The supertype class is: Statement
    class Statement_c_test40737_c implements ClassQueryInterface_c {
      Statement_c_test40737_c(java.util.UUID p40738) {
        m_p40738 = p40738;
      }

      private java.util.UUID m_p40738;

      public boolean evaluate(Object candidate) {
        Statement_c selected = (Statement_c) candidate;
        boolean retval = false;
        retval = (selected.getStatement_id().equals(m_p40738));
        return retval;
      }
    }

    Statement_c[] objs40736 =
        Statement_c.StatementInstances(modelRoot, new Statement_c_test40737_c(getStatement_id()));

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

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

    // Assign to Member is a referring class in association: rel.Numb = 609
    // The participating class is: Value
    class Value_c_test40740_c implements ClassQueryInterface_c {
      Value_c_test40740_c(java.util.UUID p40741) {
        m_p40741 = p40741;
      }

      private java.util.UUID m_p40741;

      public boolean evaluate(Object candidate) {
        Value_c selected = (Value_c) candidate;
        boolean retval = false;
        retval = (selected.getValue_id().equals(m_p40741));
        return retval;
      }
    }

    Value_c[] objs40739 =
        Value_c.ValueInstances(modelRoot, new Value_c_test40740_c(getR_value_id()));

    // The participant is unconditional
    // The multiplicity of the participant is one
    if (((objs40739.length) != 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Assign to Member", //$NON-NLS-1$
            "Consistency: Object: Assign to Member: Association: 609: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40739.length)
                + " r_Value_ID: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Assign to Member: Association: 609: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40739.length)
                + " r_Value_ID: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Assign to Member is a referring class in association: rel.Numb = 689
    // The participating class is: Value
    class Value_c_test40743_c implements ClassQueryInterface_c {
      Value_c_test40743_c(java.util.UUID p40744) {
        m_p40744 = p40744;
      }

      private java.util.UUID m_p40744;

      public boolean evaluate(Object candidate) {
        Value_c selected = (Value_c) candidate;
        boolean retval = false;
        retval = (selected.getValue_id().equals(m_p40744));
        return retval;
      }
    }

    Value_c[] objs40742 =
        Value_c.ValueInstances(modelRoot, new Value_c_test40743_c(getL_value_id()));

    // The participant is unconditional
    // The multiplicity of the participant is one
    if (((objs40742.length) != 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Assign to Member", //$NON-NLS-1$
            "Consistency: Object: Assign to Member: Association: 689: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40742.length)
                + " l_Value_ID: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Assign to Member: Association: 689: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs40742.length)
                + " l_Value_ID: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    return retval;
  }