Package org.jboss.jdeparser
Class EnumJClassDef
- java.lang.Object
-
- All Implemented Interfaces:
ClassContent,ClassFileContent,JAnnotatable,JClassDef,JClassDefSection,JClassItem,JCommentable,JDocCommentable,JGenericDef,Sectionable,Writable
class EnumJClassDef extends AbstractJClassDef implements JClassItem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JClassItem
JClassItem.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,ImplJEnumConstant>constants-
Fields inherited from interface org.jboss.jdeparser.JClassItem
SMART_NAME_SORT
-
-
Constructor Summary
Constructors Constructor Description EnumJClassDef(int mods, AbstractJClassDef enclosingClass, java.lang.String name)EnumJClassDef(int mods, ImplJSourceFile classFile, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JEnumConstant_enum(java.lang.String name)Add an enum constant.JClassDef_extends(java.lang.Class<?> clazz)Add anextendstype to this type.JClassDef_extends(java.lang.String name)Add anextendstype to this type.JClassDef_extends(JType type)Add anextendstype to this type.(package private) Tokens.$KWdesignation()JClassItem.KindgetItemKind()Get the kind of item.java.lang.StringgetName()Get the name of this element, if there is one.(package private) voidwriteContent(SourceFileWriter sourceFileWriter)-
Methods inherited from class org.jboss.jdeparser.AbstractJClassDef
_class, _class, _enum, _enum, _implements, _implements, _implements, _interface, _interface, add, add, annotationInterface, annotationInterface, blankLine, blockComment, constructor, constructor, erasedType, field, field, field, field, field, field, field, genericType, getClassFile, getContent, getEnclosingClass, getExtends, getImplements, getMemberIndentation, getModifiers, getMods, hasAllModifiers, hasAnyModifier, hasInterfaceStyleExtends, init, init, lineComment, method, method, method, method, methodCanHaveBody, section, staticInit, staticInit, supportsCompactInitOnly, typeParam, write, writeClassHeader, writeContentBlock
-
Methods inherited from class org.jboss.jdeparser.AbstractJGeneric
typeParams, typeParamsToArgs, writeTypeParams
-
Methods inherited from class org.jboss.jdeparser.BasicJAnnotatable
annotate, annotate, annotate, writeAnnotations
-
Methods inherited from class org.jboss.jdeparser.AbstractJDocCommentable
deprecated, docComment, writeDocComments
-
Methods inherited from class org.jboss.jdeparser.BasicJCommentable
writeComments
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.jdeparser.JAnnotatable
annotate, annotate, annotate
-
Methods inherited from interface org.jboss.jdeparser.JClassItem
getModifiers, hasAllModifiers, hasAnyModifier
-
Methods inherited from interface org.jboss.jdeparser.JDocCommentable
deprecated, docComment
-
Methods inherited from interface org.jboss.jdeparser.JGenericDef
typeParams
-
-
-
-
Field Detail
-
constants
private final java.util.Map<java.lang.String,ImplJEnumConstant> constants
-
-
Constructor Detail
-
EnumJClassDef
EnumJClassDef(int mods, ImplJSourceFile classFile, java.lang.String name)
-
EnumJClassDef
EnumJClassDef(int mods, AbstractJClassDef enclosingClass, java.lang.String name)
-
-
Method Detail
-
designation
Tokens.$KW designation()
- Specified by:
designationin classAbstractJClassDef
-
_enum
public JEnumConstant _enum(java.lang.String name)
Description copied from interface:JClassDefAdd an enum constant. If the class being defined is not an enum, an exception is thrown.- Specified by:
_enumin interfaceJClassDef- Overrides:
_enumin classAbstractJClassDef- Parameters:
name- the constant name- Returns:
- the call for enum construction
-
_extends
public JClassDef _extends(java.lang.String name)
Description copied from interface:JClassDefAdd anextendstype to this type.- Specified by:
_extendsin interfaceJClassDef- Overrides:
_extendsin classAbstractJClassDef- Parameters:
name- the type name- Returns:
- this type definition
-
_extends
public JClassDef _extends(JType type)
Description copied from interface:JClassDefAdd anextendstype to this type.- Specified by:
_extendsin interfaceJClassDef- Overrides:
_extendsin classAbstractJClassDef- Parameters:
type- the type- Returns:
- this type definition
-
_extends
public JClassDef _extends(java.lang.Class<?> clazz)
Description copied from interface:JClassDefAdd anextendstype to this type.- Specified by:
_extendsin interfaceJClassDef- Overrides:
_extendsin classAbstractJClassDef- Parameters:
clazz- the type- Returns:
- this type definition
-
writeContent
void writeContent(SourceFileWriter sourceFileWriter) throws java.io.IOException
- Overrides:
writeContentin classAbstractJClassDef- Throws:
java.io.IOException
-
getItemKind
public JClassItem.Kind getItemKind()
Description copied from interface:JClassItemGet the kind of item.- Specified by:
getItemKindin interfaceJClassItem- Returns:
- the item kind
-
getName
public java.lang.String getName()
Description copied from interface:JClassItemGet the name of this element, if there is one.- Specified by:
getNamein interfaceJClassItem- Overrides:
getNamein classAbstractJClassDef- Returns:
- the name, or
nullif there is none
-
-