public static EnumLiteral getEnumLiteralPropertyAttribute(final Property property, final EnumLiteralPropertyAttributeType type) { boolean _and = false; EList<PropertyAttribute> _propertyAttributes = property.getPropertyAttributes(); boolean _notEquals = (!Objects.equal(_propertyAttributes, null)); if (!_notEquals) { _and = false; } else { EList<PropertyAttribute> _propertyAttributes_1 = property.getPropertyAttributes(); int _size = _propertyAttributes_1.size(); boolean _greaterThan = (_size > 0); _and = _greaterThan; } if (_and) { EList<PropertyAttribute> _propertyAttributes_2 = property.getPropertyAttributes(); for (final PropertyAttribute pA : _propertyAttributes_2) { if ((pA instanceof EnumLiteralPropertyAttribute)) { EnumLiteralPropertyAttribute bPA = ((EnumLiteralPropertyAttribute) pA); EnumLiteralPropertyAttributeType _type = bPA.getType(); boolean _equals = Objects.equal(_type, type); if (_equals) { return bPA.getValue(); } } } } return null; }
/** * Contexts: * PropertyAttribute returns EnumLiteralPropertyAttribute * EnumLiteralPropertyAttribute returns EnumLiteralPropertyAttribute * * Constraint: * (type=EnumLiteralPropertyAttributeType value=[EnumLiteral|EnumLiteralName]) */ protected void sequence_EnumLiteralPropertyAttribute(ISerializationContext context, EnumLiteralPropertyAttribute semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, DatatypePackage.Literals.ENUM_LITERAL_PROPERTY_ATTRIBUTE__TYPE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DatatypePackage.Literals.ENUM_LITERAL_PROPERTY_ATTRIBUTE__TYPE)); if (transientValues.isValueTransient(semanticObject, DatatypePackage.Literals.ENUM_LITERAL_PROPERTY_ATTRIBUTE__VALUE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DatatypePackage.Literals.ENUM_LITERAL_PROPERTY_ATTRIBUTE__VALUE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getEnumLiteralPropertyAttributeAccess().getTypeEnumLiteralPropertyAttributeTypeEnumRuleCall_0_0(), semanticObject.getType()); feeder.accept(grammarAccess.getEnumLiteralPropertyAttributeAccess().getValueEnumLiteralEnumLiteralNameParserRuleCall_2_0_1(), semanticObject.getValue()); feeder.finish(); }