aicas logoJamaica 3.2 release 62

sun.reflect.generics.scope
Class AbstractScope<D extends GenericDeclaration>

java.lang.Object
  extended by sun.reflect.generics.scope.AbstractScope<D>
All Implemented Interfaces:
Scope
Direct Known Subclasses:
ClassScope, ConstructorScope, MethodScope

public abstract class AbstractScope<D extends GenericDeclaration>
extends Object
implements Scope

Abstract superclass for lazy scope objects, used when building factories for generic information repositories. The type parameter D represents the type of reflective object whose scope this class is representing.

To subclass this, all one needs to do is implement computeEnclosingScope and the subclass' constructor.


Constructor Summary
protected AbstractScope(D decl)
          Constructor.
 
Method Summary
protected abstract  Scope computeEnclosingScope()
          This method must be implemented by any concrete subclass.
protected  Scope getEnclosingScope()
          Accessor for the enclosing scope, which is computed lazily and cached.
protected  D getRecvr()
          Accessor for the receiver - the object whose scope this Scope object represents.
 TypeVariable<?> lookup(String name)
          Lookup a type variable in the scope, using its name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScope

protected AbstractScope(D decl)
Constructor. Takes a reflective object whose scope the newly constructed instance will represent.

Parameters:
D - - A generic declaration whose scope the newly constructed instance will represent
Method Detail

getRecvr

protected D getRecvr()
Accessor for the receiver - the object whose scope this Scope object represents.

Returns:
The object whose scope this Scope object represents

computeEnclosingScope

protected abstract Scope computeEnclosingScope()
This method must be implemented by any concrete subclass. It must return the enclosing scope of this scope. If this scope is a top-level scope, an instance of DummyScope must be returned.

Returns:
The enclosing scope of this scope

getEnclosingScope

protected Scope getEnclosingScope()
Accessor for the enclosing scope, which is computed lazily and cached.

Returns:
the enclosing scope

lookup

public TypeVariable<?> lookup(String name)
Lookup a type variable in the scope, using its name. Returns null if no type variable with this name is declared in this scope or any of its surrounding scopes.

Specified by:
lookup in interface Scope
Parameters:
name - - the name of the type variable being looked up
Returns:
the requested type variable, if found

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.