public interface NodeWithConstructors<N extends Node> extends NodeWithSimpleName<N>, NodeWithMembers<N>
Modifier and Type | Method and Description |
---|---|
default ConstructorDeclaration |
addConstructor(Modifier... modifiers)
Adds a constructor to this
|
default Optional<ConstructorDeclaration> |
getConstructorByParameterTypes(Class<?>... paramTypes)
Try to find a
ConstructorDeclaration by its parameters types |
default Optional<ConstructorDeclaration> |
getConstructorByParameterTypes(String... paramTypes)
Try to find a
ConstructorDeclaration by its parameters types |
default List<ConstructorDeclaration> |
getConstructors()
Find all constructors for this class.
|
default Optional<ConstructorDeclaration> |
getDefaultConstructor()
Try to find a
ConstructorDeclaration with no parameters by its name |
getName, getNameAsString, setName, setName
addField, addField, addField, addFieldWithInitializer, addInitializer, addMember, addMethod, addPrivateField, addPrivateField, addProtectedField, addProtectedField, addPublicField, addPublicField, addStaticInitializer, getFieldByName, getFields, getMember, getMembers, getMethods, getMethodsByName, getMethodsByParameterTypes, getMethodsByParameterTypes, getMethodsBySignature, setMember, setMembers, tryAddImportToParentCompilationUnit
default Optional<ConstructorDeclaration> getDefaultConstructor()
ConstructorDeclaration
with no parameters by its namedefault ConstructorDeclaration addConstructor(Modifier... modifiers)
modifiers
- the modifiers like Modifier.PUBLIC
default List<ConstructorDeclaration> getConstructors()
default Optional<ConstructorDeclaration> getConstructorByParameterTypes(String... paramTypes)
ConstructorDeclaration
by its parameters typesparamTypes
- the types of parameters like "Map<Integer,String>","int" to matchdefault Optional<ConstructorDeclaration> getConstructorByParameterTypes(Class<?>... paramTypes)
ConstructorDeclaration
by its parameters typesparamTypes
- the types of parameters like "Map<Integer,String>","int" to matchCopyright © 2007–2017. All rights reserved.