|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.api.java.source.GeneratorUtilities
public final class GeneratorUtilities
| Method Summary | ||
|---|---|---|
void |
copyComments(Tree source,
Tree target,
boolean preceding)
Copy comments from source tree to target tree. |
|
MethodTree |
createAbstractMethodImplementation(TypeElement clazz,
ExecutableElement method)
Creates an implementation of an abstract method within a class. |
|
List<? extends MethodTree> |
createAbstractMethodImplementations(TypeElement clazz,
Iterable<? extends ExecutableElement> methods)
Creates implementations of abstract methods within a class. |
|
List<? extends MethodTree> |
createAllAbstractMethodImplementations(TypeElement clazz)
Creates implementations of the all abstract methods within a class. |
|
MethodTree |
createConstructor(ClassTree clazz,
Iterable<? extends VariableTree> fields)
Creates a class constructor. |
|
MethodTree |
createConstructor(TypeElement clazz,
Iterable<? extends VariableElement> fields,
ExecutableElement constructor)
Creates a class constructor. |
|
MethodTree |
createGetter(TypeElement clazz,
VariableElement field)
Creates a getter method for a field. |
|
MethodTree |
createGetter(VariableTree field)
Creates a getter method for a field. |
|
MethodTree |
createMethod(DeclaredType asMemberOf,
ExecutableElement method)
Create a new method tree for the given method element. |
|
MethodTree |
createOverridingMethod(TypeElement clazz,
ExecutableElement method)
Creates an overriding method within a class. |
|
List<? extends MethodTree> |
createOverridingMethods(TypeElement clazz,
Iterable<? extends ExecutableElement> methods)
Creates overriding methods within a class. |
|
MethodTree |
createSetter(ClassTree clazz,
VariableTree field)
Creates a setter method for a field. |
|
MethodTree |
createSetter(TypeElement clazz,
VariableElement field)
Creates a setter method for a field. |
|
static GeneratorUtilities |
get(WorkingCopy copy)
Returns the instance of this class |
|
|
importComments(T original,
CompilationUnitTree cut)
|
|
|
importFQNs(T original)
Take a tree as a parameter, replace resolved fully qualified names with simple names and add imports to compilation unit during task commit. |
|
ClassTree |
insertClassMember(ClassTree clazz,
Tree member)
Inserts a member to a class. |
|
ClassTree |
insertClassMembers(ClassTree clazz,
Iterable<? extends Tree> members)
Inserts members to a class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static GeneratorUtilities get(WorkingCopy copy)
copy -
GeneratorUtilities instance
public ClassTree insertClassMember(ClassTree clazz,
Tree member)
CodeStyle
it finds the proper place for the member and calls TreeMaker.insertClassMember
clazz - the class to insert the member tomember - the member to add
public ClassTree insertClassMembers(ClassTree clazz,
Iterable<? extends Tree> members)
CodeStyle
it finds the proper place for each of the members and calls TreeMaker.insertClassMember
clazz - the class to insert the members tomembers - the members to insert
public List<? extends MethodTree> createAllAbstractMethodImplementations(TypeElement clazz)
clazz - the class to create the implementations within
public List<? extends MethodTree> createAbstractMethodImplementations(TypeElement clazz,
Iterable<? extends ExecutableElement> methods)
clazz - the class to create the implementations withinmethods - the abstract methods to implement
public MethodTree createAbstractMethodImplementation(TypeElement clazz,
ExecutableElement method)
clazz - the class to create the implementation withinmethod - the abstract method to implement
public List<? extends MethodTree> createOverridingMethods(TypeElement clazz,
Iterable<? extends ExecutableElement> methods)
clazz - the class to create the methods withinmethods - the methods to override
public MethodTree createOverridingMethod(TypeElement clazz,
ExecutableElement method)
clazz - the class to create the method withinmethod - the method to override
public MethodTree createMethod(DeclaredType asMemberOf,
ExecutableElement method)
asMemberOf type
(see also Types.asMemberOf(javax.lang.model.type.DeclaredType,javax.lang.model.element.Element)).
The new method will have an empty body.
asMemberOf - create the method as if it were member of this typemethod - method to create
Types.asMemberOf(javax.lang.model.type.DeclaredType,javax.lang.model.element.Element)
public MethodTree createConstructor(TypeElement clazz,
Iterable<? extends VariableElement> fields,
ExecutableElement constructor)
clazz - the class to create the constructor forfields - fields to be initialized by the constructorconstructor - inherited constructor to be called
public MethodTree createConstructor(ClassTree clazz,
Iterable<? extends VariableTree> fields)
clazz - the class to create the constructor forfields - fields to be initialized by the constructor
public MethodTree createGetter(TypeElement clazz,
VariableElement field)
clazz - the class to create the getter withinfield - field to create getter for
public MethodTree createGetter(VariableTree field)
field - field to create getter for
public MethodTree createSetter(TypeElement clazz,
VariableElement field)
clazz - the class to create the setter withinfield - field to create setter for
public MethodTree createSetter(ClassTree clazz,
VariableTree field)
clazz - the class to create the setter withinfield - field to create setter for
public <T extends Tree> T importFQNs(T original)
original - resolved FQNs in the tree will be imported
public <T extends Tree> T importComments(T original,
CompilationUnitTree cut)
public void copyComments(Tree source,
Tree target,
boolean preceding)
source - tree to copy comments fromtarget - tree to copy comments topreceding - true iff preceding comments should be copied
|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||