public static class Symbol.MethodSymbol extends Symbol implements ExecutableElement
Symbol.ClassSymbol, Symbol.Completer, Symbol.CompletionFailure, Symbol.DelegatedSymbol<T extends Symbol>, Symbol.DynamicMethodSymbol, Symbol.MethodSymbol, Symbol.OperatorSymbol, Symbol.PackageSymbol, Symbol.TypeSymbol, Symbol.TypeVariableSymbol, Symbol.VarSymbol, Symbol.Visitor<R,P>
Modifier and Type | Field and Description |
---|---|
List<Symbol.VarSymbol> |
capturedLocals
The captured local variables in an anonymous class
|
Code |
code
The code of the method.
|
Attribute |
defaultValue
For an attribute field accessor, its default value if any.
|
List<Symbol.VarSymbol> |
extraParams
The extra (synthetic/mandated) parameters of the method.
|
static Filter<Symbol> |
implementation_filter |
List<Symbol.VarSymbol> |
params
The parameters of the method.
|
List<Name> |
savedParameterNames
The names of the parameters
|
completer, erasure_field, flags_field, kind, metadata, name, owner, type
Constructor and Description |
---|
MethodSymbol(long flags,
Name name,
Type type,
Symbol owner)
Construct a method symbol, given its flags, name, type and owner.
|
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(ElementVisitor<R,P> v,
P p)
Applies a visitor to this element.
|
<R,P> R |
accept(Symbol.Visitor<R,P> v,
P p) |
Symbol |
asMemberOf(Type site,
Types types)
The (variable or method) symbol seen as a member of given
class type`site' (this might change the symbol's type).
|
Symbol.MethodSymbol |
binaryImplementation(Symbol.ClassSymbol origin,
Types types)
The implementation of this (abstract) symbol in class origin,
from the VM's point of view, null if method does not have an
implementation in class.
|
boolean |
binaryOverrides(Symbol _other,
Symbol.TypeSymbol origin,
Types types)
Will the erasure of this method be considered by the VM to
override the erasure of the other when seen from class `origin'?
|
Symbol.MethodSymbol |
clone(Symbol newOwner)
Clone this symbol with new owner.
|
Attribute |
getDefaultValue()
Returns the default value if this executable is an annotation
type element.
|
ElementKind |
getKind()
Returns the
kind of this element. |
Set<Modifier> |
getModifiers()
Returns the modifiers of this element, excluding annotations.
|
List<Symbol.VarSymbol> |
getParameters()
Returns the formal parameters of this executable.
|
Type |
getReceiverType()
|
Type |
getReturnType()
Returns the return type of this executable.
|
List<Type> |
getThrownTypes()
Returns the exceptions and other throwables listed in this
method or constructor's
throws clause in declaration
order. |
Symbol.MethodSymbol |
implementation(Symbol.TypeSymbol origin,
Types types,
boolean checkResult)
The implementation of this (abstract) symbol in class origin;
null if none exists.
|
Symbol.MethodSymbol |
implementation(Symbol.TypeSymbol origin,
Types types,
boolean checkResult,
Filter<Symbol> implFilter) |
Symbol |
implemented(Symbol.TypeSymbol c,
Types types)
find a symbol that this (proxy method) symbol implements.
|
Symbol |
implementedIn(Symbol.TypeSymbol c,
Types types) |
boolean |
isDefault()
Returns
true if this method is a default method and
returns false otherwise. |
boolean |
isDynamic() |
boolean |
isInheritedIn(Symbol clazz,
Types types)
Is this symbol inherited into a given class?
PRE: If symbol's owner is a interface,
it is already assumed that the interface is a superinterface
of given class.
|
boolean |
isStaticOrInstanceInit() |
boolean |
isVarArgs()
Returns
true if this method or constructor accepts a variable
number of arguments and returns false otherwise. |
boolean |
overrides(Symbol _other,
Symbol.TypeSymbol origin,
Types types,
boolean checkResult)
Does this symbol override `other' symbol, when both are seen as
members of class `origin'? It is assumed that _other is a member
of origin.
|
List<Symbol.VarSymbol> |
params() |
String |
toString()
The Java source which this symbol represents.
|
annotationsPendingCompletion, appendAttributes, appendClassInitTypeAttributes, appendInitTypeAttributes, appendTypeAttributesWithCompletion, appendUniqueTypeAttributes, asType, attribute, baseSymbol, complete, enclClass, erasure, exists, externalType, flags, flatName, getAnnotationMirrors, getClassInitTypeAttributes, getDeclarationAttributes, getEnclosedElements, getEnclosingElement, getInitTypeAttributes, getMetadata, getQualifiedName, getRawAttributes, getRawTypeAttributes, getSimpleName, getTypeParameters, hasAnnotations, hasOuterInstance, hasTypeAnnotations, isAnonymous, isConstructor, isDeprecated, isEnclosedBy, isEnum, isInner, isInterface, isLocal, isMemberOf, isPrivate, isStatic, isSubClass, location, location, members, outermostClass, packge, prependAttributes, resetAnnotations, setAttributes, setDeclarationAttributes, setDeclarationAttributesWithCompletion, setTypeAttributes
getAnnotation, getAnnotationsByType, getAttribute, getInheritedAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSimpleName, getTypeParameters
asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, hashCode
getAnnotationsByType
public Code code
public List<Symbol.VarSymbol> extraParams
public List<Symbol.VarSymbol> capturedLocals
public List<Symbol.VarSymbol> params
public Attribute defaultValue
public Symbol.MethodSymbol clone(Symbol newOwner)
public Set<Modifier> getModifiers()
Element
public
and static
modifiers of interface members, are included.getModifiers
in interface Element
getModifiers
in class Symbol
public String toString()
public boolean isDynamic()
public Symbol implemented(Symbol.TypeSymbol c, Types types)
c
- The class whose members are searched for
implementationspublic Symbol implementedIn(Symbol.TypeSymbol c, Types types)
public boolean binaryOverrides(Symbol _other, Symbol.TypeSymbol origin, Types types)
public Symbol.MethodSymbol binaryImplementation(Symbol.ClassSymbol origin, Types types)
origin
- The class of which the implementation is a member.public boolean overrides(Symbol _other, Symbol.TypeSymbol origin, Types types, boolean checkResult)
public boolean isInheritedIn(Symbol clazz, Types types)
Symbol
isInheritedIn
in class Symbol
clazz
- The class for which we want to establish membership.
This must be a subclass of the member's owner.public Symbol.MethodSymbol implementation(Symbol.TypeSymbol origin, Types types, boolean checkResult)
public Symbol.MethodSymbol implementation(Symbol.TypeSymbol origin, Types types, boolean checkResult, Filter<Symbol> implFilter)
public List<Symbol.VarSymbol> params()
public Symbol asMemberOf(Type site, Types types)
Symbol
asMemberOf
in class Symbol
public ElementKind getKind()
Element
kind
of this element.public boolean isStaticOrInstanceInit()
public Attribute getDefaultValue()
ExecutableElement
null
if this method is not an
annotation type element, or if it is an annotation type element
with no default value.getDefaultValue
in interface ExecutableElement
null
if nonepublic List<Symbol.VarSymbol> getParameters()
ExecutableElement
getParameters
in interface ExecutableElement
public boolean isVarArgs()
ExecutableElement
true
if this method or constructor accepts a variable
number of arguments and returns false
otherwise.isVarArgs
in interface ExecutableElement
true
if this method or constructor accepts a variable
number of arguments and false
otherwisepublic boolean isDefault()
ExecutableElement
true
if this method is a default method and
returns false
otherwise.isDefault
in interface ExecutableElement
true
if this method is a default method and
false
otherwisepublic <R,P> R accept(ElementVisitor<R,P> v, P p)
Element
public <R,P> R accept(Symbol.Visitor<R,P> v, P p)
public Type getReceiverType()
ExecutableElement
NoType
with
kind NONE
if the executable has no receiver type.
An executable which is an instance method, or a constructor of an
inner class, has a receiver type derived from the declaring type.
An executable which is a static method, or a constructor of a
non-inner class, or an initializer (static or instance), has no
receiver type.getReceiverType
in interface ExecutableElement
public Type getReturnType()
ExecutableElement
NoType
with kind VOID
if this executable is not a method, or is a method that does not
return a value.getReturnType
in interface ExecutableElement
public List<Type> getThrownTypes()
ExecutableElement
throws
clause in declaration
order.getThrownTypes
in interface ExecutableElement
throws
clause, or an empty list if there are noneCopyright © 2015. All rights reserved.