public Set<ElementType> getAnnotationTargets(JvmAnnotationType annotation) { EList<JvmAnnotationReference> annotations = annotation.getAnnotations(); for (JvmAnnotationReference annoRef : annotations) { if (Target.class.getName().equals(annoRef.getAnnotation().getIdentifier())) { EList<JvmAnnotationValue> values = annoRef.getValues(); JvmAnnotationValue value = values.isEmpty() ? null : values.get(0); if (value instanceof JvmEnumAnnotationValue) { Set<ElementType> result = newHashSet(); for (JvmEnumerationLiteral elementType : ((JvmEnumAnnotationValue) value).getValues()) { final String simpleName = elementType.getSimpleName(); result.add(ElementType.valueOf(simpleName)); } return result; } } } return emptySet(); }
public Iterable<String> getEnumValues(final JvmTypeReference reference) { JvmType _type = reference.getType(); final JvmEnumerationType enumType = ((JvmEnumerationType) _type); final Function1<JvmEnumerationLiteral, String> _function = (JvmEnumerationLiteral it) -> { return it.getSimpleName(); }; return ListExtensions.<JvmEnumerationLiteral, String>map(enumType.getLiterals(), _function); }
expectedEnumerationLiterals.remove(enumerationLiteral.getSimpleName()); } catch (ConstantExpressionEvaluationException e) {
return ((JvmEnumAnnotationValue) value).getValues().get(0).getSimpleName();
public void generateEnumLiteral(final JvmEnumerationLiteral it, final ITreeAppendable appendable, final GeneratorConfig config) { appendable.newLine(); this.generateJavaDoc(it, appendable, config); this.generateAnnotations(it.getAnnotations(), appendable, true, config); appendable.append(this.makeJavaIdentifier(it.getSimpleName())); }
protected void _toJavaLiteral(final JvmEnumAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<JvmEnumerationLiteral> _function = (JvmEnumerationLiteral it_1) -> { appendable.append(it_1.getDeclaringType()); appendable.append("."); appendable.append(this.makeJavaIdentifier(it_1.getSimpleName())); }; this._loopExtensions.<JvmEnumerationLiteral>forEachWithShortcut(appendable, it.getValues(), _function); }
final JvmEnumerationType enumType = ((JvmEnumerationType) _type); final Function1<JvmEnumerationLiteral, Boolean> _function = (JvmEnumerationLiteral it) -> { String _simpleName = it.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, sourceValue)); };
public IScope getLocatorStrategyScope(final EObject eObject) { final Iterable<XImportDeclaration> enumImports = this.getEnumImports(eObject); final Function1<XImportDeclaration, Boolean> _function = (XImportDeclaration it) -> { boolean _isStatic = it.isStatic(); return Boolean.valueOf((!_isStatic)); }; final Iterable<JvmEnumerationLiteral> nonStaticImportedLiterals = this.getEnumLiterals(IterableExtensions.<XImportDeclaration>filter(enumImports, _function)); final Function<JvmEnumerationLiteral, QualifiedName> _function_1 = (JvmEnumerationLiteral it) -> { StringConcatenation _builder = new StringConcatenation(); String _simpleName = it.getDeclaringType().getSimpleName(); _builder.append(_simpleName); _builder.append("."); String _simpleName_1 = it.getSimpleName(); _builder.append(_simpleName_1); return this._iQualifiedNameConverter.toQualifiedName(_builder.toString()); }; final IScope nonStaticScope = Scopes.<JvmEnumerationLiteral>scopeFor(nonStaticImportedLiterals, _function_1, IScope.NULLSCOPE); final Function1<XImportDeclaration, Boolean> _function_2 = (XImportDeclaration it) -> { return Boolean.valueOf(it.isStatic()); }; final Iterable<JvmEnumerationLiteral> staticImportedLiterals = this.getEnumLiterals(IterableExtensions.<XImportDeclaration>filter(enumImports, _function_2)); final Function<JvmEnumerationLiteral, QualifiedName> _function_3 = (JvmEnumerationLiteral it) -> { return this._iQualifiedNameConverter.toQualifiedName(it.getSimpleName()); }; return Scopes.<JvmEnumerationLiteral>scopeFor(staticImportedLiterals, _function_3, nonStaticScope); }
_matched_2=true; final Function1<JvmEnumerationLiteral, Boolean> _function = (JvmEnumerationLiteral it_1) -> { String _simpleName = it_1.getSimpleName(); return Boolean.valueOf(Objects.equal(_simpleName, featureName)); };
final HashMap<String, JvmIdentifiableElement> copy = new HashMap<String, JvmIdentifiableElement>(_visibleFeatures); final Consumer<JvmEnumerationLiteral> _function = (JvmEnumerationLiteral it_2) -> { copy.put(it_2.getSimpleName(), it_2); }; enumType.getLiterals().forEach(_function);
EList<JvmEnumerationLiteral> _literals = ((JvmEnumerationType)type).getLiterals(); for (final JvmEnumerationLiteral feature : _literals) { result.put(feature.getSimpleName(), feature);
XAbstractFeatureCall featureCall = (XAbstractFeatureCall) casePart.getCase(); JvmEnumerationLiteral enumerationLiteral = (JvmEnumerationLiteral) featureCall.getFeature(); conditionAppendable.append(enumerationLiteral.getSimpleName());