public interface ClassDeclaration extends TypeDeclaration
Declaration
subinterface for the class declaration heirarchy.Access.AccessType
Modifier and Type | Method and Description |
---|---|
ClassDeclaration |
addImplements(String type)
Adds the given string to the list of implements clauses.
|
Import |
addImport(Class<?> clazz)
Adds the given import declaration to the compilation unit.
|
Import |
addImport(String name)
Adds the given import declaration to the compilation unit.
|
List<Constructor> |
getConstructors()
Gets the list of constructors as an list of
Constructor . |
String |
getExtends()
Gets the extends clause.
|
List<ClassField> |
getFields()
Gets the list of fields as an list of
ClassField . |
List<String> |
getImplements()
Gets the list of implementation clauses as an list of
String . |
List<InnerClass> |
getInnerClasses()
Gets the list of inner classes as an list of
InnerClass . |
List<ClassMethod> |
getMethods()
Gets the list of method as an list of
ClassMethod . |
List<ClassMethod> |
getMethods(String methodName)
Returns a list containing all
ClassMethod s of the underlying
ClassDeclaration with the specified name. |
List<StaticInitializer> |
getStaticInitializers()
Gets the list of static initializers as an list of
StaticInitializer . |
boolean |
isAbstract()
Getter method for the isAbstract flag.
|
ClassDeclaration |
isAbstract(boolean value)
Setter method for the isAbstract flag.
|
boolean |
isMethodAlreadyDefined(Type type,
String name)
Creates a new static initialization block in this class
|
Constructor |
newConstructor()
Creates a new constructor in this class
|
ClassField |
newField(Class<?> type,
String name)
Creates a new field in this class with the given type and name.
|
ClassField |
newField(Type type,
String name)
Creates a new field in this class with the given type and name.
|
InnerClass |
newInnerClass(String name)
Creates a new inner class in this class.
|
InnerInterface |
newInnerInterface(String name)
Creates a new inner class in this class.
|
ClassMethod |
newMethod(String name)
Creates a new void method in this class with the given type and name.
|
ClassMethod |
newMethod(Type type,
String name)
Creates a new method in this class with the given type and name.
|
StaticInitializer |
newStaticInitializer() |
boolean |
removeImplements(String interfaceName)
removes the interface of the list of implementation clauses and returns
if the interface was present. .
|
ClassDeclaration |
setExtends(String type)
Sets the extends clause to the given string.
|
asClassType, getMembers, getUnit, removeMember, setComparator
addAnnotation, addAnnotation, getAnnotations, getName, isFinal, isFinal, isStatic, isStatic, setName
javadoc
applyStyle, cast, getComment, isActive, isBlockWithAbruptCompletion, setComment, toCode, visit, vm
ClassDeclaration addImplements(String type)
Import addImport(Class<?> clazz)
List<Constructor> getConstructors()
Constructor
.String getExtends()
List<ClassField> getFields()
ClassField
.List<String> getImplements()
String
.boolean removeImplements(String interfaceName)
List<InnerClass> getInnerClasses()
InnerClass
.List<ClassMethod> getMethods()
ClassMethod
.List<ClassMethod> getMethods(String methodName)
ClassMethod
s of the underlying
ClassDeclaration
with the specified name.methodName
- ClassMethod
s with the specified name.List<StaticInitializer> getStaticInitializers()
StaticInitializer
.boolean isAbstract()
ClassDeclaration isAbstract(boolean value)
boolean isMethodAlreadyDefined(Type type, String name)
Constructor newConstructor()
ClassField newField(Class<?> type, String name)
ClassField newField(Type type, String name)
InnerClass newInnerClass(String name)
InnerInterface newInnerInterface(String name)
ClassMethod newMethod(String name)
newMethod
in interface TypeDeclaration
ClassMethod newMethod(Type type, String name)
newMethod
in interface TypeDeclaration
StaticInitializer newStaticInitializer()
ClassDeclaration setExtends(String type)
Copyright © 2000–2018 jenesis4java. All rights reserved.