com.sun.tools.apt.mirror.declaration
Class MemberDeclarationImpl

java.lang.Object
  extended by com.sun.tools.apt.mirror.declaration.DeclarationImpl
      extended by com.sun.tools.apt.mirror.declaration.MemberDeclarationImpl
All Implemented Interfaces:
Declaration, MemberDeclaration
Direct Known Subclasses:
ExecutableDeclarationImpl, FieldDeclarationImpl, TypeDeclarationImpl

public abstract class MemberDeclarationImpl
extends DeclarationImpl
implements MemberDeclaration

Implementation of MemberDeclaration


Field Summary
 
Fields inherited from class com.sun.tools.apt.mirror.declaration.DeclarationImpl
env, identityFilter, sym
 
Constructor Summary
protected MemberDeclarationImpl(AptEnv env, Symbol sym)
           
 
Method Summary
 void accept(DeclarationVisitor v)
          Applies a visitor to this declaration.
private  Symbol.ClassSymbol getDeclaringClassSymbol()
          Returns the ClassSymbol of the declaring type, or null if this is a top-level type.
 TypeDeclaration getDeclaringType()
          Returns the type declaration within which this member or constructor is declared.
 java.util.Collection<TypeParameterDeclaration> getFormalTypeParameters()
           For methods, constructors, and types.
protected static java.lang.String typeParamsToString(AptEnv env, Symbol sym)
          Returns the formal type parameters of a type, member or constructor as an angle-bracketed string.
 
Methods inherited from class com.sun.tools.apt.mirror.declaration.DeclarationImpl
equals, getAnnotation, getAnnotation, getAnnotationMirrors, getDocComment, getMembers, getModifiers, getPosition, getSimpleName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.mirror.declaration.Declaration
equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName
 

Constructor Detail

MemberDeclarationImpl

protected MemberDeclarationImpl(AptEnv env,
                                Symbol sym)
Method Detail

getDeclaringType

public TypeDeclaration getDeclaringType()
Returns the type declaration within which this member or constructor is declared. If this is the declaration of a top-level type (a non-nested class or interface), returns null.

Specified by:
getDeclaringType in interface MemberDeclaration
Returns:
the type declaration within which this member or constructor is declared, or null if there is none

getFormalTypeParameters

public java.util.Collection<TypeParameterDeclaration> getFormalTypeParameters()
For methods, constructors, and types.


accept

public void accept(DeclarationVisitor v)
Applies a visitor to this declaration.

Specified by:
accept in interface Declaration
Overrides:
accept in class DeclarationImpl
Parameters:
v - the visitor operating on this declaration

getDeclaringClassSymbol

private Symbol.ClassSymbol getDeclaringClassSymbol()
Returns the ClassSymbol of the declaring type, or null if this is a top-level type.


typeParamsToString

protected static java.lang.String typeParamsToString(AptEnv env,
                                                     Symbol sym)
Returns the formal type parameters of a type, member or constructor as an angle-bracketed string. Each parameter consists of the simple type variable name and any bounds (with no implicit "extends Object" clause added). Type names are qualified. Returns "" if there are no type parameters.