polyglot.ext.jl.types
Class ParsedClassType_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeObject_c
      extended by polyglot.ext.jl.types.Type_c
          extended by polyglot.ext.jl.types.ReferenceType_c
              extended by polyglot.ext.jl.types.ClassType_c
                  extended by polyglot.ext.jl.types.ParsedClassType_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ClassType, Importable, MemberInstance, Named, ParsedClassType, Qualifier, ReferenceType, Type, TypeObject, Copy
Direct Known Subclasses:
CofferParsedClassType_c, PaoParsedClassType_c

public class ParsedClassType_c
extends ClassType_c
implements ParsedClassType

ParsedClassType Overview: A ParsedClassType represents a information that has been parsed (but not necessarily type checked) from a .java file.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface polyglot.types.ClassType
ClassType.Kind
 
Field Summary
protected  java.util.List constructors
           
protected  java.util.List fields
           
protected  Flags flags
           
protected  Source fromSource
           
protected  LazyClassInitializer init
           
protected  boolean inStaticContext
          Was the class declared in a static context?
protected  java.util.List interfaces
           
protected  ClassType.Kind kind
           
protected  java.util.List memberClasses
           
protected  java.util.List methods
           
protected  java.lang.String name
           
protected  ClassType outer
           
protected  Package package_
           
protected  Type superType
           
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Fields inherited from interface polyglot.types.ClassType
ANONYMOUS, LOCAL, MEMBER, TOP_LEVEL
 
Constructor Summary
protected ParsedClassType_c()
           
  ParsedClassType_c(TypeSystem ts, LazyClassInitializer init, Source fromSource)
           
 
Method Summary
 void addConstructor(ConstructorInstance ci)
          Add a constructor to the class.
 void addField(FieldInstance fi)
          Add a field to the class.
 void addInterface(Type t)
          Add an interface to the class.
 void addMemberClass(ClassType t)
          Add a member class to the class.
 void addMethod(MethodInstance mi)
          Add a method to the class.
 java.util.List constructors()
          Return a mutable list of constructors
 java.util.List fields()
          Return a mutable list of fields
 Flags flags()
          Get the class's flags.
 void flags(Flags flags)
          Set the flags of the class.
protected  void freeInit()
          Free the initializer object if we no longer need it.
 Source fromSource()
          The Source that this class type was loaded from.
protected  boolean initialized()
          Return true if we no longer need the initializer object.
 boolean inStaticContext()
          Return true if the class declaration occurs in a static context.
 void inStaticContext(boolean inStaticContext)
          Set whether the class was declared in a static context.
 java.util.List interfaces()
          Return a mutable list of interfaces
 ClassType.Kind kind()
          Get the class's kind.
 void kind(ClassType.Kind kind)
          Set the class's kind.
 java.util.List memberClasses()
          Return a mutable list of member classes
 java.util.List methods()
          Return a mutable list of methods
 java.lang.String name()
          Get the short name of the class, if possible.
 void name(java.lang.String name)
          Set the name of the class.
 ClassType outer()
          Get the class's outer class, or null if a top-level class.
 void outer(ClassType outer)
          Set the class's outer class.
 Package package_()
          Get the class's package.
 void package_(Package p)
          Set the class's package.
 void position(Position pos)
          Position of the type's declaration.
 Type superType()
          Get the class's super type.
 void superType(Type t)
          Set the class's super type.
 
Methods inherited from class polyglot.ext.jl.types.ClassType_c
container, descendsFromImpl, fieldNamed, fullName, hasEnclosingInstance, hasEnclosingInstanceImpl, isAnonymous, isCanonical, isCastValidImpl, isClass, isEnclosed, isEnclosedImpl, isImplicitCastValidImpl, isInner, isInnerClass, isLocal, isMember, isNested, isThrowable, isTopLevel, isUncheckedException, memberClassNamed, toClass, toString, translate
 
Methods inherited from class polyglot.ext.jl.types.ReferenceType_c
hasMethod, hasMethodImpl, isReference, methods, methodsNamed, toReference
 
Methods inherited from class polyglot.ext.jl.types.Type_c
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPackage, isPrimitive, isShort, isSubtype, isSubtypeImpl, isType, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toNull, toPackage, toPrimitive, toType
 
Methods inherited from class polyglot.ext.jl.types.TypeObject_c
copy, equals, equalsImpl, hashCode, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface polyglot.types.ClassType
fieldNamed, hasEnclosingInstance, hasEnclosingInstanceImpl, isAnonymous, isEnclosed, isEnclosedImpl, isInner, isInnerClass, isLocal, isMember, isNested, isTopLevel, memberClassNamed
 
Methods inherited from interface polyglot.types.Named
fullName
 
Methods inherited from interface polyglot.types.ReferenceType
hasMethod, hasMethodImpl, methods, methodsNamed
 
Methods inherited from interface polyglot.types.Type
arrayOf, arrayOf, descendsFrom, descendsFromImpl, isArray, isBoolean, isByte, isCastValid, isCastValidImpl, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isImplicitCastValidImpl, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toClass, toNull, toPrimitive, toReference, toString, translate
 
Methods inherited from interface polyglot.types.Qualifier
isPackage, isType, toPackage, toType
 
Methods inherited from interface polyglot.types.MemberInstance
container
 

Field Detail

init

protected transient LazyClassInitializer init

fromSource

protected transient Source fromSource

superType

protected Type superType

interfaces

protected java.util.List interfaces

methods

protected java.util.List methods

fields

protected java.util.List fields

constructors

protected java.util.List constructors

memberClasses

protected java.util.List memberClasses

package_

protected Package package_

flags

protected Flags flags

kind

protected ClassType.Kind kind

name

protected java.lang.String name

outer

protected ClassType outer

inStaticContext

protected boolean inStaticContext
Was the class declared in a static context?

Constructor Detail

ParsedClassType_c

protected ParsedClassType_c()

ParsedClassType_c

public ParsedClassType_c(TypeSystem ts,
                         LazyClassInitializer init,
                         Source fromSource)
Method Detail

fromSource

public Source fromSource()
Description copied from interface: ParsedClassType
The Source that this class type was loaded from. Should be null if it was not loaded from a Source during this compilation.

Specified by:
fromSource in interface ParsedClassType

kind

public ClassType.Kind kind()
Description copied from class: ClassType_c
Get the class's kind.

Specified by:
kind in interface ClassType
Specified by:
kind in class ClassType_c

inStaticContext

public void inStaticContext(boolean inStaticContext)
Description copied from interface: ParsedClassType
Set whether the class was declared in a static context.

Specified by:
inStaticContext in interface ParsedClassType

inStaticContext

public boolean inStaticContext()
Description copied from interface: ClassType
Return true if the class declaration occurs in a static context. Is used to determine if a nested class is implicitly static.

Specified by:
inStaticContext in interface ClassType

outer

public ClassType outer()
Description copied from class: ClassType_c
Get the class's outer class, or null if a top-level class.

Specified by:
outer in interface ClassType
Specified by:
outer in class ClassType_c

name

public java.lang.String name()
Description copied from class: ClassType_c
Get the short name of the class, if possible.

Specified by:
name in interface Named
Specified by:
name in class ClassType_c

superType

public Type superType()
Get the class's super type.

Specified by:
superType in interface ReferenceType
Specified by:
superType in class ClassType_c

package_

public Package package_()
Get the class's package.

Specified by:
package_ in interface Importable
Specified by:
package_ in class ClassType_c

flags

public Flags flags()
Get the class's flags.

Specified by:
flags in interface MemberInstance
Specified by:
flags in class ClassType_c

initialized

protected boolean initialized()
Return true if we no longer need the initializer object.


freeInit

protected void freeInit()
Free the initializer object if we no longer need it.


flags

public void flags(Flags flags)
Description copied from interface: ParsedClassType
Set the flags of the class.

Specified by:
flags in interface ParsedClassType

kind

public void kind(ClassType.Kind kind)
Description copied from interface: ParsedClassType
Set the class's kind.

Specified by:
kind in interface ParsedClassType

outer

public void outer(ClassType outer)
Description copied from interface: ParsedClassType
Set the class's outer class.

Specified by:
outer in interface ParsedClassType

name

public void name(java.lang.String name)
Description copied from interface: ParsedClassType
Set the name of the class. Throws InternalCompilerError if called on an anonymous class.

Specified by:
name in interface ParsedClassType

position

public void position(Position pos)
Description copied from interface: ParsedClassType
Position of the type's declaration.

Specified by:
position in interface ParsedClassType

package_

public void package_(Package p)
Description copied from interface: ParsedClassType
Set the class's package.

Specified by:
package_ in interface ParsedClassType

superType

public void superType(Type t)
Description copied from interface: ParsedClassType
Set the class's super type.

Specified by:
superType in interface ParsedClassType

addInterface

public void addInterface(Type t)
Description copied from interface: ParsedClassType
Add an interface to the class.

Specified by:
addInterface in interface ParsedClassType

addMethod

public void addMethod(MethodInstance mi)
Description copied from interface: ParsedClassType
Add a method to the class.

Specified by:
addMethod in interface ParsedClassType

addConstructor

public void addConstructor(ConstructorInstance ci)
Description copied from interface: ParsedClassType
Add a constructor to the class.

Specified by:
addConstructor in interface ParsedClassType

addField

public void addField(FieldInstance fi)
Description copied from interface: ParsedClassType
Add a field to the class.

Specified by:
addField in interface ParsedClassType

addMemberClass

public void addMemberClass(ClassType t)
Description copied from interface: ParsedClassType
Add a member class to the class.

Specified by:
addMemberClass in interface ParsedClassType

constructors

public java.util.List constructors()
Return a mutable list of constructors

Specified by:
constructors in interface ClassType
Specified by:
constructors in class ClassType_c
See Also:
ConstructorInstance

memberClasses

public java.util.List memberClasses()
Return a mutable list of member classes

Specified by:
memberClasses in interface ClassType
Specified by:
memberClasses in class ClassType_c
See Also:
ClassType

methods

public java.util.List methods()
Return a mutable list of methods

Specified by:
methods in interface ReferenceType
Specified by:
methods in class ClassType_c
Returns:
A list of MethodInstance.
See Also:
MethodInstance

fields

public java.util.List fields()
Return a mutable list of fields

Specified by:
fields in interface ReferenceType
Specified by:
fields in class ClassType_c
Returns:
A list of FieldInstance.
See Also:
FieldInstance

interfaces

public java.util.List interfaces()
Return a mutable list of interfaces

Specified by:
interfaces in interface ReferenceType
Specified by:
interfaces in class ClassType_c
Returns:
A list of Type.
See Also:
Type