/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. In addition, for ValueSpecification, the type must be conformant with the type of the specified parameterable element. * * result = p->oclIsKindOf(self.oclType) and self.type.conformsTo(p.oclAsType(TypedElement).type) * @param valueSpecification The receiving '<em><b>Value Specification</b></em>' model object. * <!-- end-model-doc --> * @generated NOT */ public static boolean isCompatibleWith( ValueSpecification valueSpecification, ParameterableElement p) { if (valueSpecification.eClass().isInstance(p)) { Type type = valueSpecification.getType(); return type == null ? ((ValueSpecification) p).eGet( UMLPackage.Literals.TYPED_ELEMENT__TYPE, false) == null : type.conformsTo(((ValueSpecification) p).getType()); } return false; }
public String getDefaultValue(Property property) { ValueSpecification vs = property.getDefaultValue(); if (vs == null) { if (property.getType() instanceof PrimitiveType) { PrimitiveType pt = (PrimitiveType) property.getType(); if (pt.getName().equals("int")) { return "0"; } } return "null"; } else { if (vs.getType() == null) { return vs.stringValue(); } else if (vs.getType().getName().equals("String")) { return vs.stringValue(); } else if (vs.getType().getName().equals("Integer")) { return vs.integerValue() + ""; } else if (vs.getType().getName().equals("Boolean")) { return vs.booleanValue() + ""; } return vs.stringValue(); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ValueSpecification getArgument(String name, Type type, boolean ignoreCase, EClass eClass, boolean createOnDemand) { argumentLoop : for (ValueSpecification argument : getArguments()) { if (eClass != null && !eClass.isInstance(argument)) continue argumentLoop; if (name != null && !(ignoreCase ? name.equalsIgnoreCase(argument.getName()) : name.equals(argument.getName()))) continue argumentLoop; if (type != null && !type.equals(argument.getType())) continue argumentLoop; return argument; } return createOnDemand && eClass != null ? createArgument(name, type, eClass) : null; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ValueSpecification getValue(String name, Type type, boolean ignoreCase, EClass eClass, boolean createOnDemand) { valueLoop : for (ValueSpecification value : getValues()) { if (eClass != null && !eClass.isInstance(value)) continue valueLoop; if (name != null && !(ignoreCase ? name.equalsIgnoreCase(value.getName()) : name.equals(value.getName()))) continue valueLoop; if (type != null && !type.equals(value.getType())) continue valueLoop; return value; } return createOnDemand && eClass != null ? createValue(name, type, eClass) : null; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ValueSpecification getOperand(String name, Type type, boolean ignoreCase, EClass eClass, boolean createOnDemand) { operandLoop : for (ValueSpecification operand : getOperands()) { if (eClass != null && !eClass.isInstance(operand)) continue operandLoop; if (name != null && !(ignoreCase ? name.equalsIgnoreCase(operand.getName()) : name.equals(operand.getName()))) continue operandLoop; if (type != null && !type.equals(operand.getType())) continue operandLoop; return operand; } return createOnDemand && eClass != null ? createOperand(name, type, eClass) : null; }
ValueSpecification value = (ValueSpecification) object; return value.getType() == classifier; } else if (object instanceof InstanceSpecification) { return ((InstanceSpecification) object).getClassifiers().contains(
Type argumentType = ma.next().getType(); Type attributeType = sa.next().getType();
Type argumentType = a.next().getType(); Type parameterType = p.next().getType();