Skip navigation links
oracle.javatools.parser.java.v2.model
Interface SourceMethod
- All Superinterfaces:
- Element, JavaElement, JavaHasAnnotations, JavaHasName, JavaHasType, JavaIsGeneric, JavaMember, JavaMethod, SourceElement, SourceHasBlock, SourceHasModifiers, SourceHasName, SourceMember
-
public interface SourceMethod
- extends SourceMember, SourceHasName, SourceHasBlock, JavaMethod
A SourceMethod is the syntactic (aka symbolic) representation of a java method or constructor declaration.
Methods inherited from interface oracle.javatools.parser.java.v2.model.SourceElement |
addSelf, addSelf, addSelfAfter, addSelfBefore, adjustTextIndentation, clearBinding, cloneSelf, compile, getBinding, getChildren, getChildren, getCompiledObject, getContainedElements, getEndOffset, getOwningFile, getOwningSourceFile, getParent, getSiblingAfter, getSiblingBefore, getSiblings, getSiblings, getStartOffset, getSymbolKind, getText, hasErrors, print, print, reformatSelf, removeSelf, replaceSelf, resolve, setBinding, setContext, visitSelf |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaMethod |
equals, getDefaultValue, getDescriptor, getExceptions, getMethodErasure, getOverriddenMethods, getParameters, getParameterTypes, getReturnType, getSignature, getTypeSignature, hasSubsignatureOf, isNative |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaHasName |
getName |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaElement |
getElementKind, getFile, getModifiers, getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfo |
EMPTY_ARRAY
static final SourceMethod[] EMPTY_ARRAY
PRINT_SIGNATURE
static final int PRINT_SIGNATURE
- "name( type... )"
- See Also:
- Constant Field Values
PRINT_DECLARATION
static final int PRINT_DECLARATION
- "modifiers lt;type_parameters> return_type name( type name... )"
- See Also:
- Constant Field Values
isConstructor
boolean isConstructor()
- True if this is a constructor.
-
- Specified by:
isConstructor
in interface JavaMethod
-
- Returns:
- True if this is a constructor. False otherwise.
isVarargs
boolean isVarargs()
- Tests if this method is modified by ACC_VARARGS.
-
- Specified by:
isVarargs
in interface JavaMethod
-
- Returns:
- True if this is a variable arguments method. False otherwise.
getSourceTypeParameters
java.util.List<SourceTypeParameter> getSourceTypeParameters()
- Gets the declared type parameters on this method. For methods, syntax is "javadoc mods <ty_params> return_ty method...". Constructors may not declare type parameters.
-
- Returns:
- The array of type parameters. May be zero-length. Returns a collection of SourceTypeParameter's.
getSourceReturnType
SourceTypeReference getSourceReturnType()
- Gets the source return type.
-
- Returns:
- The SourceTypeReference for the return type of this method. Null if this is a constructor.
setSourceReturnType
void setSourceReturnType(SourceTypeReference type)
- Attempts to set the return type of this method.
-
- Throws:
java.lang.UnsupportedOperationException
- if this is a constructor.
getSourceParameters
java.util.List<SourceVariable> getSourceParameters()
- Gets the list of source parameters.
-
- Returns:
- The array of SourceVariables for all the parameters in its formal parameter list. May be zero-length. Includes the synthetic "this$0" parameter where applicable. Returns a collection of SourceVariable's.
getSourceExceptions
java.util.List<SourceTypeReference> getSourceExceptions()
- Gets the list of source exception types.
-
- Returns:
- The array of SourceTypeReferences for all the exceptions thrown by this method. May be zero-length. Returns a collection of SourceTypeReference's.
getFormalParameterList
SourceFormalParameterList getFormalParameterList()
- Gets the formal parameter list object.
-
- Returns:
- The SourceFormalParameterList that wraps the formal parameters.
getThrowsClause
SourceThrowsClause getThrowsClause()
- Gets the throws clause object.
-
- Returns:
- The SourceThrowsClause that wraps the thrown exception types.
Skip navigation links
Copyright © 1997, 2012, Oracle. All rights reserved.