public OCLSyntaxHelper(Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { environment = env; stdlib = env.getOCLStandardLibrary(); uml = env.getUMLReflection(); }
public OCLSyntaxHelper(Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { environment = env; stdlib = env.getOCLStandardLibrary(); uml = env.getUMLReflection(); }
@SuppressWarnings("unchecked") private SetType<C, O> getSet() { if (set == null) { set = (SetType<C, O>) getEnvironment().getOCLStandardLibrary() .getSet(); } return set; }
@SuppressWarnings("unchecked") private MessageType<C, O, P> getOclMessage() { if (oclMessage == null) { oclMessage = (MessageType<C, O, P>) getEnvironment().getOCLStandardLibrary() .getOclMessage(); } return oclMessage; }
/** * Convenience method to determine whether the specified value is the null * or <tt>OclInvalid</tt>. * * @param value a value * * @return whether it is undefined */ protected boolean isUndefined(Object value) { return (value == null) || (value == getEnvironment().getOCLStandardLibrary().getInvalid()); }
@SuppressWarnings("unchecked") private SetType<C, O> getSet() { if (set == null) { set = (SetType<C, O>) getEnvironment().getOCLStandardLibrary() .getSet(); } return set; }
@SuppressWarnings("unchecked") private OrderedSetType<C, O> getOrderedSet() { if (orderedSet == null) { orderedSet = (OrderedSetType<C, O>) getEnvironment().getOCLStandardLibrary() .getOrderedSet(); } return orderedSet; }
@SuppressWarnings("unchecked") private BagType<C, O> getBag() { if (bag == null) { bag = (BagType<C, O>) getEnvironment().getOCLStandardLibrary() .getBag(); } return bag; }
protected C getCommonSuperType(CSTNode cstNode, String rule, Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, C type1, C type2) { C commonType = TypeUtil.commonSuperType(cstNode, env, type1, type2); if (commonType == null) { commonType = env.getOCLStandardLibrary().getOclVoid(); } return commonType; }
protected C getCommonSuperType(CSTNode cstNode, String rule, Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, C type1, C type2) { C commonType = TypeUtil.commonSuperType(cstNode, env, type1, type2); if (commonType == null) { commonType = env.getOCLStandardLibrary().getOclVoid(); } return commonType; }
/** * Convenience method to determine whether the specified value is the null * or <tt>OclInvalid</tt>. * * @param value a value * * @return whether it is undefined */ protected boolean isUndefined(Object value) { return (value == null) || (value == getEnvironment().getOCLStandardLibrary().getInvalid()); }
@SuppressWarnings("unchecked") private OrderedSetType<C, O> getOrderedSet() { if (orderedSet == null) { orderedSet = (OrderedSetType<C, O>) getEnvironment().getOCLStandardLibrary() .getOrderedSet(); } return orderedSet; }
@SuppressWarnings("unchecked") private BagType<C, O> getBag() { if (bag == null) { bag = (BagType<C, O>) getEnvironment().getOCLStandardLibrary() .getBag(); } return bag; }
@SuppressWarnings("unchecked") private SequenceType<C, O> getSequence() { if (sequence == null) { sequence = (SequenceType<C, O>) getEnvironment().getOCLStandardLibrary() .getSequence(); } return sequence; }
@SuppressWarnings("unchecked") private TypeType<C, O> getOclType() { if (oclType == null) { oclType = (TypeType<C, O>) getEnvironment().getOCLStandardLibrary() .getOclType(); } return oclType; }
@SuppressWarnings("unchecked") private CollectionType<C, O> getCollection() { if (collection == null) { collection = (CollectionType<C, O>) getEnvironment().getOCLStandardLibrary() .getCollection(); } return collection; }
@SuppressWarnings("unchecked") private TypeType<C, O> getOclType() { if (oclType == null) { oclType = (TypeType<C, O>) getEnvironment().getOCLStandardLibrary() .getOclType(); } return oclType; }
public CT createInvariant(String expression) throws ParserException { if (removeOCLComments(expression).length() > 0) { // be sure to pass the original expression along to get the right // position information when parse fails try { return HelperUtil.parseInvariant( this, expression, validating, ocl.isParseTracingEnabled()); } catch (RuntimeException e) { propagate(e, "createInvariant"); //$NON-NLS-1$ } } return createNullCondition(env.getOCLStandardLibrary().getBoolean()); }
public CT createBodyCondition(String expression) throws ParserException { if (removeOCLComments(expression).length() > 0) { // be sure to pass the original expression along to get the right // position information when parse fails try { return HelperUtil.parseBodyCondition( this, expression, validating, ocl.isParseTracingEnabled()); } catch (RuntimeException e) { propagate(e, "createBodyCondition"); //$NON-NLS-1$ } } return createNullCondition(env.getOCLStandardLibrary().getOclVoid()); }
public CT createDerivedValueExpression(String expression) throws ParserException { if (removeOCLComments(expression).length() > 0) { // be sure to pass the original expression along to get the right // position information when parse fails try { return HelperUtil.parseDerivedValueExpression( this, expression, validating, ocl.isParseTracingEnabled()); } catch (RuntimeException e) { propagate(e, "createDerivedValueExpression"); //$NON-NLS-1$ } } return createNullCondition(env.getOCLStandardLibrary().getOclVoid()); }