public interface NodeWithConstructors<N extends Node> extends NodeWithSimpleName<N>, NodeWithMembers<N>
Modifier and Type | Method and Description |
---|---|
default ConstructorDeclaration |
addConstructor(Modifier.Keyword... 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, getNameAsExpression, getNameAsString, setName, setName
addField, addField, addField, addFieldWithInitializer, addFieldWithInitializer, addFieldWithInitializer, addInitializer, addMember, addMethod, addPrivateField, addPrivateField, addPrivateField, addProtectedField, addProtectedField, addProtectedField, addPublicField, addPublicField, addPublicField, addStaticInitializer, getFieldByName, getFields, getMember, getMembers, getMethods, getMethodsByName, getMethodsByParameterTypes, getMethodsByParameterTypes, getMethodsBySignature, isEmpty, setMember, setMembers, tryAddImportToParentCompilationUnit
default Optional<ConstructorDeclaration> getDefaultConstructor()
ConstructorDeclaration
with no parameters by its namedefault ConstructorDeclaration addConstructor(Modifier.Keyword... modifiers)
modifiers
- the modifiers like Modifier.Keyword#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–2019. All rights reserved.