com.sun.tools.javac.code
Class Symbol.MethodSymbol

java.lang.Object
  extended by com.sun.tools.javac.code.Symbol
      extended by com.sun.tools.javac.code.Symbol.MethodSymbol
All Implemented Interfaces:
Element, ExecutableElement
Direct Known Subclasses:
Symbol.OperatorSymbol
Enclosing class:
Symbol

public static class Symbol.MethodSymbol
extends Symbol
implements ExecutableElement

A class for method symbols.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.code.Symbol
Symbol.ClassSymbol, Symbol.Completer, Symbol.CompletionFailure, Symbol.DelegatedSymbol, Symbol.Level, Symbol.MethodSymbol, Symbol.OperatorSymbol, Symbol.PackageSymbol, Symbol.TypeSymbol, Symbol.VarSymbol, Symbol.Visitor<R,P>
 
Field Summary
 Code code
          The code of the method.
 Attribute defaultValue
          For an attribute field accessor, its default value if any.
 List<Symbol.VarSymbol> params
          The parameters of the method.
 List<Name> savedParameterNames
          The names of the parameters
 
Fields inherited from class com.sun.tools.javac.code.Symbol
attributes_field, completer, erasure_field, flags_field, kind, level, name, owner, type
 
Constructor Summary
Symbol.MethodSymbol(long flags, Name name, Type type, Symbol owner)
          Construct a method symbol, given its flags, name, type and owner.
 
Method Summary
<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.
 List<Symbol.VarSymbol> getParameters()
          Returns the formal parameters of this executable.
 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 implemented(Symbol.TypeSymbol c, Types types)
          find a symbol that this (proxy method) symbol implements.
private  boolean isOverridableIn(Symbol.TypeSymbol origin)
           
 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()
           
 java.lang.String toString()
          The Java source which this symbol represents.
 
Methods inherited from class com.sun.tools.javac.code.Symbol
addParentLevel, asType, attribute, complete, enclClass, erasure, exists, externalType, flags, flatName, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, getLevel, getModifiers, getQualifiedName, getSimpleName, getTypeParameters, hasOuterInstance, isConstructor, isEnclosedBy, isInheritedIn, isInner, isInterface, isLocal, isMemberOf, isStatic, isSubClass, location, location, members, outermostClass, packge, removeParentLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.lang.model.element.ExecutableElement
getTypeParameters
 
Methods inherited from interface javax.lang.model.element.Element
asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, getModifiers, getSimpleName, hashCode
 

Field Detail

code

public Code code
The code of the method.


params

public List<Symbol.VarSymbol> params
The parameters of the method.


savedParameterNames

public List<Name> savedParameterNames
The names of the parameters


defaultValue

public Attribute defaultValue
For an attribute field accessor, its default value if any. The value is null if none appeared in the method declaration.

Constructor Detail

Symbol.MethodSymbol

public Symbol.MethodSymbol(long flags,
                           Name name,
                           Type type,
                           Symbol owner)
Construct a method symbol, given its flags, name, type and owner.

Method Detail

clone

public Symbol.MethodSymbol clone(Symbol newOwner)
Clone this symbol with new owner.

Overrides:
clone in class Symbol

toString

public java.lang.String toString()
The Java source which this symbol represents.

Overrides:
toString in class Symbol

implemented

public Symbol implemented(Symbol.TypeSymbol c,
                          Types types)
find a symbol that this (proxy method) symbol implements.

Parameters:
c - The class whose members are searched for implementations

binaryOverrides

public 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'?


binaryImplementation

public 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.

Parameters:
origin - The class of which the implementation is a member.

overrides

public 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. It is assumed that both symbols have the same name. The static modifier is ignored for this test. See JLS 8.4.6.1 (without transitivity) and 8.4.6.4

Overrides:
overrides in class Symbol

isOverridableIn

private boolean isOverridableIn(Symbol.TypeSymbol origin)

implementation

public Symbol.MethodSymbol implementation(Symbol.TypeSymbol origin,
                                          Types types,
                                          boolean checkResult)
The implementation of this (abstract) symbol in class origin; null if none exists. Synthetic methods are not considered as possible implementations.


params

public List<Symbol.VarSymbol> params()

asMemberOf

public Symbol asMemberOf(Type site,
                         Types types)
Description copied from class: Symbol
The (variable or method) symbol seen as a member of given class type`site' (this might change the symbol's type). This is used exclusively for producing diagnostics.

Overrides:
asMemberOf in class Symbol

getKind

public ElementKind getKind()
Description copied from interface: Element
Returns the kind of this element.

Specified by:
getKind in interface Element
Overrides:
getKind in class Symbol
Returns:
the kind of this element

getDefaultValue

public Attribute getDefaultValue()
Description copied from interface: ExecutableElement
Returns the default value if this executable is an annotation type element. Returns null if this method is not an annotation type element, or if it is an annotation type element with no default value.

Specified by:
getDefaultValue in interface ExecutableElement
Returns:
the default value, or null if none

getParameters

public List<Symbol.VarSymbol> getParameters()
Description copied from interface: ExecutableElement
Returns the formal parameters of this executable. They are returned in declaration order.

Specified by:
getParameters in interface ExecutableElement
Returns:
the formal parameters, or an empty list if there are none

isVarArgs

public boolean isVarArgs()
Description copied from interface: ExecutableElement
Returns true if this method or constructor accepts a variable number of arguments and returns false otherwise.

Specified by:
isVarArgs in interface ExecutableElement
Returns:
true if this method or constructor accepts a variable number of arguments and false otherwise

accept

public <R,P> R accept(ElementVisitor<R,P> v,
                      P p)
Description copied from interface: Element
Applies a visitor to this element.

Specified by:
accept in interface Element
Type Parameters:
R - the return type of the visitor's methods
P - the type of the additional parameter to the visitor's methods
Parameters:
v - the visitor operating on this element
p - additional parameter to the visitor
Returns:
a visitor-specified result

accept

public <R,P> R accept(Symbol.Visitor<R,P> v,
                      P p)
Overrides:
accept in class Symbol

getReturnType

public Type getReturnType()
Description copied from interface: ExecutableElement
Returns the return type of this executable. Returns a NoType with kind VOID if this executable is not a method, or is a method that does not return a value.

Specified by:
getReturnType in interface ExecutableElement
Returns:
the return type of this executable

getThrownTypes

public List<Type> getThrownTypes()
Description copied from interface: ExecutableElement
Returns the exceptions and other throwables listed in this method or constructor's throws clause in declaration order.

Specified by:
getThrownTypes in interface ExecutableElement
Returns:
the exceptions and other throwables listed in the throws clause, or an empty list if there are none