public OclConstraint createAssociationEndInitConstraint(string source, CoreClassifier contextualClassifier, CoreAssociationEnd assocEnd, ExpressionInOcl initialValue) { OclAssocEndInitConstraint constraint = new OclAssocEndInitConstraintImpl(); constraint.setSource(source); constraint.setContextualClassifier(contextualClassifier); constraint.setInitializedAssocEnd(assocEnd); constraint.setExpression(initialValue); contextualClassifier.addInitConstraint(assocEnd.getName(), constraint); // cachedObjects.add(constraint); return(constraint); }
public OclConstraint createAttributeInitConstraint(string source, CoreClassifier contextualClassifier, CoreAttribute attribute, ExpressionInOcl initialValue) { OclAttributeInitConstraint constraint = new OclAttributeInitConstraintImpl(); constraint.setSource(source); constraint.setContextualClassifier(contextualClassifier); constraint.setInitializedAttribute(attribute); constraint.setExpression(initialValue); contextualClassifier.addInitConstraint(attribute.getName(), constraint); attribute.setInitialValueExpression(initialValue); // cachedObjects.add(constraint); return(constraint); }