public final class MethodDeclaration extends BodyDeclaration<MethodDeclaration> implements NodeWithJavaDoc<MethodDeclaration>, NodeWithDeclaration, NodeWithSimpleName<MethodDeclaration>, NodeWithType<MethodDeclaration,Type<?>>, NodeWithElementType<MethodDeclaration>, NodeWithModifiers<MethodDeclaration>, NodeWithParameters<MethodDeclaration>, NodeWithThrownExceptions<MethodDeclaration>, NodeWithOptionalBlockStmt<MethodDeclaration>, NodeWithTypeParameters<MethodDeclaration>
Node.ObserverRegistrationModeABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration| Constructor and Description |
|---|
MethodDeclaration() |
MethodDeclaration(EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<TypeParameter> typeParameters,
Type<?> elementType,
NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType,
SimpleName name,
boolean isDefault,
NodeList<Parameter> parameters,
NodeList<ArrayBracketPair> arrayBracketPairsAfterParameterList,
NodeList<ReferenceType<?>> thrownExceptions,
BlockStmt body) |
MethodDeclaration(EnumSet<Modifier> modifiers,
Type<?> elementType,
String name) |
MethodDeclaration(EnumSet<Modifier> modifiers,
Type<?> elementType,
String name,
NodeList<Parameter> parameters) |
MethodDeclaration(Range range,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<TypeParameter> typeParameters,
Type<?> elementType,
NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType,
SimpleName name,
boolean isDefault,
NodeList<Parameter> parameters,
NodeList<ArrayBracketPair> arrayBracketPairsAfterParameterList,
NodeList<ReferenceType<?>> thrownExceptions,
BlockStmt body) |
getAnnotations, setAnnotationsaddOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregisterfinalize, getClass, notify, notifyAll, wait, wait, waitsetJavaDocCommentgetNameAsString, setNamesetType, setTypesetElementType, setElementTypeaddModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatileaddAndGetParameter, addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, addParameter, getParamByName, getParamByType, getParamByType, getParameteraddThrownException, addThrownException, getThrownException, isThrown, isThrowncreateBodygetTypeParameter, isGenericaddAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresentgetAncestorOfType, setAsParentNodeOf, setAsParentNodeOfpublic MethodDeclaration()
public MethodDeclaration(EnumSet<Modifier> modifiers, Type<?> elementType, String name)
public MethodDeclaration(EnumSet<Modifier> modifiers, Type<?> elementType, String name, NodeList<Parameter> parameters)
public MethodDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type<?> elementType, NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType, SimpleName name, boolean isDefault, NodeList<Parameter> parameters, NodeList<ArrayBracketPair> arrayBracketPairsAfterParameterList, NodeList<ReferenceType<?>> thrownExceptions, BlockStmt body)
public MethodDeclaration(Range range, EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type<?> elementType, NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType, SimpleName name, boolean isDefault, NodeList<Parameter> parameters, NodeList<ArrayBracketPair> arrayBracketPairsAfterParameterList, NodeList<ReferenceType<?>> thrownExceptions, BlockStmt body)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitableaccept in interface VisitableR - the type of the return value of the visitorA - the type the user argument passed to the visitorv - the visitor implementationarg - the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitablepublic Optional<BlockStmt> getBody()
getBody in interface NodeWithOptionalBlockStmt<MethodDeclaration>public EnumSet<Modifier> getModifiers()
getModifiers in interface NodeWithModifiers<MethodDeclaration>Modifierpublic SimpleName getName()
getName in interface NodeWithSimpleName<MethodDeclaration>public NodeList<Parameter> getParameters()
getParameters in interface NodeWithParameters<MethodDeclaration>public NodeList<ReferenceType<?>> getThrownExceptions()
getThrownExceptions in interface NodeWithThrownExceptions<MethodDeclaration>public Type<?> getType()
NodeWithTypegetType in interface NodeWithType<MethodDeclaration,Type<?>>@Deprecated public Type<?> getElementType()
getElementType in interface NodeWithElementType<MethodDeclaration>public NodeList<TypeParameter> getTypeParameters()
getTypeParameters in interface NodeWithTypeParameters<MethodDeclaration>public MethodDeclaration setBody(BlockStmt body)
setBody in interface NodeWithOptionalBlockStmt<MethodDeclaration>body - the body, can be nullpublic MethodDeclaration setModifiers(EnumSet<Modifier> modifiers)
setModifiers in interface NodeWithModifiers<MethodDeclaration>public MethodDeclaration setName(SimpleName name)
setName in interface NodeWithSimpleName<MethodDeclaration>public MethodDeclaration setParameters(NodeList<Parameter> parameters)
setParameters in interface NodeWithParameters<MethodDeclaration>public MethodDeclaration setThrownExceptions(NodeList<ReferenceType<?>> thrownExceptions)
setThrownExceptions in interface NodeWithThrownExceptions<MethodDeclaration>public MethodDeclaration setType(Type<?> type)
NodeWithTypesetType in interface NodeWithType<MethodDeclaration,Type<?>>type - the type@Deprecated public MethodDeclaration setElementType(Type<?> elementType)
setElementType in interface NodeWithElementType<MethodDeclaration>elementType - the element elementTypepublic MethodDeclaration setTypeParameters(NodeList<TypeParameter> typeParameters)
setTypeParameters in interface NodeWithTypeParameters<MethodDeclaration>public boolean isDefault()
public MethodDeclaration setDefault(boolean isDefault)
public String getDeclarationAsString()
NodeWithDeclarationNodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the modifiers, the throws clause and the parameters with both type and name.getDeclarationAsString in interface NodeWithDeclarationpublic String getDeclarationAsString(boolean includingModifiers, boolean includingThrows)
NodeWithDeclarationNodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the parameters with both type and name.getDeclarationAsString in interface NodeWithDeclarationincludingModifiers - flag to include the modifiers (if present) in the string producedincludingThrows - flag to include the throws clause (if present) in the string producedpublic String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName)
[accessSpecifier] [static] [abstract] [final] [native] [synchronized] returnType methodName ([paramType [paramName]]) [throws exceptionsList]
getDeclarationAsString in interface NodeWithDeclarationincludingModifiers - flag to include the modifiers (if present) in the string producedincludingThrows - flag to include the throws clause (if present) in the string producedincludingParameterName - flag to include the parameter name (while the parameter type is always included) in the string producedpublic JavadocComment getJavaDoc()
NodeWithJavaDocgetJavaDoc in interface NodeWithJavaDoc<MethodDeclaration>@Deprecated public NodeList<ArrayBracketPair> getArrayBracketPairsAfterElementType()
getArrayBracketPairsAfterElementType in interface NodeWithElementType<MethodDeclaration>class C { int[] abc; }@Deprecated public MethodDeclaration setArrayBracketPairsAfterElementType(NodeList<ArrayBracketPair> arrayBracketPairsAfterType)
setArrayBracketPairsAfterElementType in interface NodeWithElementType<MethodDeclaration>@Deprecated public NodeList<ArrayBracketPair> getArrayBracketPairsAfterParameterList()
int abc()[] {...}@Deprecated public MethodDeclaration setArrayBracketPairsAfterParameterList(NodeList<ArrayBracketPair> arrayBracketPairsAfterParameterList)
public List<NodeList<?>> getNodeLists()
NodegetNodeLists in class BodyDeclaration<MethodDeclaration>Copyright © 2007–2016. All rights reserved.