/** * @see org.eclipse.uml2.uml.Element#isStereotypeApplied(org.eclipse.uml2.uml.Stereotype) */ public boolean isStereotypeApplied(final Stereotype stereotype) { return this.property.isStereotypeApplied(stereotype); }
/** * @see org.eclipse.uml2.uml.Element#isStereotypeApplied(org.eclipse.uml2.uml.Stereotype) */ public boolean isStereotypeApplied(final Stereotype stereotype) { return this.property.isStereotypeApplied(stereotype); }
/** * @see org.eclipse.uml2.uml.Element#isStereotypeApplied(org.eclipse.uml2.uml.Stereotype) */ public boolean isStereotypeApplied(final Stereotype stereotype) { return this.property.isStereotypeApplied(stereotype); }
public boolean hasRangeLength() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeLength.name()); if (property.isStereotypeApplied(stereotype)) { if (!isString()) { throw new IllegalStateException("The RangeLength stereotype may only be applied to properties of type String! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMinInteger() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MinInteger.name()); if (property.isStereotypeApplied(stereotype)) { if (!isInteger()) { throw new IllegalStateException("The MinInteger stereotype may only be applied to properties of type Integer! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMinLong() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MinLong.name()); if (property.isStereotypeApplied(stereotype)) { if (!isLong()) { throw new IllegalStateException("The MinLong stereotype may only be applied to properties of type JavaPrimitiveType::long! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeFloat() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeFloat.name()); if (property.isStereotypeApplied(stereotype)) { if (!isFloat()) { throw new IllegalStateException("The RangeFloat stereotype may only be applied to properties of type JavaPrimitiveType::float! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMaxDouble() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MaxDouble.name()); if (property.isStereotypeApplied(stereotype)) { if (!isDouble()) { throw new IllegalStateException("The MaxFloat stereotype may only be applied to properties of type JavaPrimitiveType::double! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeUnlimitedNatural() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeUnlimitedNatural.name()); if (property.isStereotypeApplied(stereotype)) { if (!isInteger()) { throw new IllegalStateException("The RangeUnlimitedNatural stereotype may only be applied to properties of type UnlimitedNatural! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMinDouble() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MinDouble.name()); if (property.isStereotypeApplied(stereotype)) { if (!isDouble()) { throw new IllegalStateException("The MinDouble stereotype may only be applied to properties of type JavaPrimitiveType::double! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMaxReal() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MaxReal.name()); if (property.isStereotypeApplied(stereotype)) { if (!isDouble()) { throw new IllegalStateException("The MaxInteger stereotype may only be applied to properties of type Real! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeReal() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeReal.name()); if (property.isStereotypeApplied(stereotype)) { if (!isDouble()) { throw new IllegalStateException("The RangeInteger stereotype may only be applied to properties of type Real! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMinLength() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MinLength.name()); if (property.isStereotypeApplied(stereotype)) { if (!isString()) { throw new IllegalStateException("The MinLength stereotype may only be applied to properties of type String! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeInteger() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeInteger.name()); if (property.isStereotypeApplied(stereotype)) { if (!isInteger()) { throw new IllegalStateException("The RangeInteger stereotype may only be applied to properties of type Integer! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMaxUnlimitedNatural() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MaxUnlimitedNatural.name()); if (property.isStereotypeApplied(stereotype)) { if (!isInteger()) { throw new IllegalStateException("The MaxUnlimitedNatural stereotype may only be applied to properties of type UnlimitedNatural! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeLong() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeLong.name()); if (property.isStereotypeApplied(stereotype)) { if (!isLong()) { throw new IllegalStateException("The RangeLong stereotype may only be applied to properties of type JavaPrimitiveType::long! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMinFloat() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MinFloat.name()); if (property.isStereotypeApplied(stereotype)) { if (!isFloat()) { throw new IllegalStateException("The MinFloat stereotype may only be applied to properties of type JavaPrimitiveType::float! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasMaxFloat() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.MaxFloat.name()); if (property.isStereotypeApplied(stereotype)) { if (!isFloat()) { throw new IllegalStateException("The MaxFloat stereotype may only be applied to properties of type JavaPrimitiveType::float! property = " + getQualifiedName()); } return true; } else { return false; } }
public boolean hasRangeDouble() { Stereotype stereotype = ModelLoader.INSTANCE.findStereotype(UmlgValidationEnum.RangeDouble.name()); if (property.isStereotypeApplied(stereotype)) { if (!isDouble()) { throw new IllegalStateException("The RangeFloat stereotype may only be applied to properties of type JavaPrimitiveType::double! property = " + getQualifiedName()); } return true; } else { return false; } }
@Override public void visitBefore(Property element) { //Can not get find the stereotype in the constructor as the model is not loaded yet. if (this.stereotype == null) { this.stereotype = ModelLoader.INSTANCE.findStereotype("Index"); } PropertyWrapper pWrap = new PropertyWrapper(element); if (element.isStereotypeApplied(this.stereotype) && (pWrap.isMany() || !(element.getType() instanceof DataType))) { throw new IllegalStateException(String.format("Only PrimitiveType may be indexed currently! Current element %s is a %s", new String[]{element.getQualifiedName(), element.getType().getQualifiedName()})); } }