public class EnumClassDeclaration extends ClassDeclaration
EnumClassBuilder
transform an
EnumDeclaration
to an EnumClassDeclaration by
Currently anonymous implementations for constants are not supported as they are anonymous inner classes which are not supported by KeY.
The additional methods are constructed as follows (E is the name of the enum, (e1, ..., en) its constants):
public static E[] values() { return new E[] { e1,..., en } }; public static E valueOf(java.lang.String string) { for(E e : values()) { if(e.name().equals(string)) return e; } throw new IllegalArgumentException(); } public java.lang.String name() { return ENUM_NAMES[ordinal()]; }
Additionally the fields that are enum constants are remembered.
ProgramElement.TreeStructure
SourceElement.Position
ProgramModelElement.LexicalOrder
extending, implementing, typeParameters
members, name, name2field, name2type, parent, service, UNDEFINED_SCOPE
declarationSpecifiers
comments
factory
STRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE
LEXICAL_ORDER
Constructor and Description |
---|
EnumClassDeclaration() |
EnumClassDeclaration(EnumDeclaration ed)
make a new wrapping class declaration upon a given enum declaration.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<EnumConstantDeclaration> |
getEnumConstantDeclarations()
get all declared enum constants for this enum.
|
accept, deepClone, getChildAt, getChildCount, getChildPositionCode, getExtendedTypes, getImplementedTypes, getStatementContainer, getTypeParameters, isAnnotationType, isEnumType, isInterface, isOrdinaryClass, isOrdinaryInterface, isStrictFp, isTransient, isVolatile, makeParentRoleValid, replaceChild, setExtendedTypes, setImplementedTypes, setStatementContainer, setTypeParameters
addTypeToScope, addVariableToScope, getAllFields, getAllMethods, getAllSupertypes, getAllTypes, getASTParent, getConstructors, getContainer, getContainingClassType, getFields, getFieldsInScope, getFirstElement, getFullName, getIdentifier, getLastElement, getMemberParent, getMembers, getMethods, getName, getPackage, getParent, getProgramModelInfo, getSupertypes, getTypeDeclarationAt, getTypeDeclarationCount, getTypeInScope, getTypes, getTypesInScope, getVariableInScope, getVariablesInScope, isAbstract, isDefinedScope, isFinal, isPrivate, isProtected, isPublic, isStatic, removeTypeFromScope, removeVariableFromScope, setDefinedScope, setIdentifier, setMemberParent, setMembers, setParent, setProgramModelInfo, toString
getAnnotations, getDeclarationSpecifiers, getModifiers, getVisibilityModifier, isNative, isSynchronized, setDeclarationSpecifiers
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
getComments, setComments, validate
getEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getASTParent, getComments, setComments
getEndPosition, getFactory, getFirstElement, getLastElement, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSource
validate
getDeclarationSpecifiers, setDeclarationSpecifiers
getAnnotations
getIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAll
public EnumClassDeclaration()
public EnumClassDeclaration(EnumDeclaration ed)
public java.util.List<EnumConstantDeclaration> getEnumConstantDeclarations()
Copyright © 2003-2019 The KeY-Project.