Module org.eclipse.xtend.lib.macro
Interface MutableEnumerationTypeDeclaration
- All Superinterfaces:
AnnotationTarget,Declaration,Element,EnumerationTypeDeclaration,MemberDeclaration,MutableAnnotationTarget,MutableDeclaration,MutableElement,MutableMemberDeclaration,MutableNamedElement,MutableTypeDeclaration,NamedElement,Type,TypeDeclaration
@Beta
public interface MutableEnumerationTypeDeclaration
extends MutableTypeDeclaration, EnumerationTypeDeclaration
- Author:
- Sven Efftinge
-
Method Summary
Modifier and TypeMethodDescriptionaddValue(String name, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<MutableEnumerationValueDeclaration> initializer) Adds a new value with the given name.findDeclaredValue(String name) Iterable<? extends MutableEnumerationValueDeclaration> Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.AnnotationTarget
findAnnotation, getAnnotationsMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MemberDeclaration
getDocComment, getModifiers, getVisibility, isDeprecatedMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTarget
addAnnotation, removeAnnotationMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableDeclaration
markAsReadMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableMemberDeclaration
getDeclaringType, setDeprecated, setDocComment, setVisibilityMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableTypeDeclaration
addConstructor, addField, addMethod, findDeclaredConstructor, findDeclaredField, findDeclaredMethod, findDeclaredType, getDeclaredAnnotationTypes, getDeclaredClasses, getDeclaredConstructors, getDeclaredEnumerationTypes, getDeclaredFields, getDeclaredInterfaces, getDeclaredMembers, getDeclaredMethods, getDeclaredTypes, remove, setSimpleNameMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.NamedElement
getCompilationUnit, getSimpleNameMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.Type
getQualifiedName, isAssignableFrom
-
Method Details
-
getDeclaredValues
Iterable<? extends MutableEnumerationValueDeclaration> getDeclaredValues()- Specified by:
getDeclaredValuesin interfaceEnumerationTypeDeclaration- Returns:
- the values directly declared and contained in the enumeration type declaration
-
findDeclaredValue
- Specified by:
findDeclaredValuein interfaceEnumerationTypeDeclaration- Parameters:
name- of the feature- Returns:
- the declared value with the given name or
nullof no such value exists.
-
addValue
MutableEnumerationValueDeclaration addValue(String name, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<MutableEnumerationValueDeclaration> initializer) Adds a new value with the given name.- Parameters:
name- the name of the field to be added, must be notnullinitializer- a callback for further initialization of the created value, must be notnull- Returns:
- the created value declaration
- Throws:
IllegalArgumentException- if thenameis not a valid java identifier or theinitializerisnull
-