示例#1
0
        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);
        }
示例#2
0
        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);
        }