polyglot.types
Class ClassContextResolver

java.lang.Object
  extended by polyglot.types.AbstractAccessControlResolver
      extended by polyglot.types.ClassContextResolver
All Implemented Interfaces:
AccessControlResolver, Resolver

public class ClassContextResolver
extends AbstractAccessControlResolver

A ClassContextResolver looks up type names qualified with a class name. For example, if the class is "A.B", the class context will return the class for member class "A.B.C" (if it exists) when asked for "C".


Field Summary
protected  ClassType type
           
 
Fields inherited from class polyglot.types.AbstractAccessControlResolver
ts
 
Constructor Summary
ClassContextResolver(TypeSystem ts, ClassType type)
          Construct a resolver.
 
Method Summary
protected  boolean canAccess(Named n, ClassType accessor)
           
 ClassType classType()
          The class in whose context we look.
 Named find(java.lang.String name, ClassType accessor)
          Find a type object in the context of the class.
 java.lang.String toString()
           
 
Methods inherited from class polyglot.types.AbstractAccessControlResolver
find
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected ClassType type
Constructor Detail

ClassContextResolver

public ClassContextResolver(TypeSystem ts,
                            ClassType type)
Construct a resolver.

Parameters:
ts - The type system.
type - The type in whose context we search for member types.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

find

public Named find(java.lang.String name,
                  ClassType accessor)
           throws SemanticException
Find a type object in the context of the class.

Parameters:
name - The name to search for.
Throws:
SemanticException

canAccess

protected boolean canAccess(Named n,
                            ClassType accessor)

classType

public ClassType classType()
The class in whose context we look.