|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpolyglot.ext.jl.types.TypeSystem_c
TypeSystem_c Overview: A TypeSystem_c is a universe of types, including all Java types.
| Nested Class Summary | |
protected class |
TypeSystem_c.MostSpecificComparator
Class to handle the comparisons; dispatches to moreSpecific method. |
| Field Summary | |
protected Flags |
ACCESS_FLAGS
All possible access flags. |
protected PrimitiveType |
BOOLEAN_
|
protected PrimitiveType |
BYTE_
|
protected PrimitiveType |
CHAR_
|
protected ClassType |
CLASS_
|
protected Flags |
CONSTRUCTOR_FLAGS
All flags allowed for a constructor. |
protected LazyClassInitializer |
defaultClassInit
|
protected PrimitiveType |
DOUBLE_
|
protected Flags |
FIELD_FLAGS
All flags allowed for a field. |
protected java.util.Map |
flagsForName
|
protected PrimitiveType |
FLOAT_
|
protected Flags |
INITIALIZER_FLAGS
All flags allowed for an initializer block. |
protected PrimitiveType |
INT_
|
protected LoadedClassResolver |
loadedResolver
|
protected Flags |
LOCAL_CLASS_FLAGS
All flags allowed for a local class. |
protected Flags |
LOCAL_FLAGS
All flags allowed for a local variable. |
protected PrimitiveType |
LONG_
|
protected Flags |
MEMBER_CLASS_FLAGS
All flags allowed for a member class. |
protected Flags |
METHOD_FLAGS
All flags allowed for a method. |
protected NullType |
NULL_
|
protected ClassType |
OBJECT_
|
protected TableResolver |
parsedResolver
|
protected PrimitiveType |
SHORT_
|
protected ClassType |
STRING_
|
protected Resolver |
systemResolver
|
protected ClassType |
THROWABLE_
|
protected Flags |
TOP_LEVEL_CLASS_FLAGS
All flags allowed for a top-level class. |
protected UnknownQualifier |
unknownQualifier
|
protected UnknownType |
unknownType
|
protected PrimitiveType |
VOID_
|
| Constructor Summary | |
TypeSystem_c()
|
|
| Method Summary | |
Flags |
Abstract()
|
protected java.util.List |
abstractSuperInterfaces(ReferenceType rt)
Utility method to gather all the superclasses and interfaces of ct that may contain abstract methods that must be
implemented by ct. |
protected boolean |
accessibleFromPackage(Flags flags,
Package pkg1,
Package pkg2)
Return true if a member (in an accessible container) or a top-level class with access flags flags
in package pkg1 is accessible from package
pkg2. |
ClassType |
ArithmeticException()
java.lang.ArithmeticException |
ArrayType |
arrayOf(Position pos,
Type type)
Return an array of type |
ArrayType |
arrayOf(Position pos,
Type type,
int dims)
Return a dims-array of type |
ArrayType |
arrayOf(Type type)
Returns a type identical to |
ArrayType |
arrayOf(Type type,
int dims)
Return a dims-array of type |
ClassType |
ArrayStoreException()
java.lang.ArrayStoreException |
protected ArrayType |
arrayType(Position pos,
Type type)
Factory method for ArrayTypes. |
protected void |
assert_(java.util.Collection l)
|
protected void |
assert_(TypeObject o)
|
PrimitiveType |
Boolean()
boolean |
PrimitiveType |
Byte()
byte |
boolean |
callValid(ProcedureInstance prototype,
java.util.List argTypes)
Return true if pi can be called with
actual parameters of types actualTypes. |
boolean |
canCoerceToString(Type t,
Context c)
Returns true iff the type t can be coerced to a String in the given Context. |
boolean |
canOverride(MethodInstance mi,
MethodInstance mj)
Return true if mi can override mj. |
PrimitiveType |
Char()
char |
void |
checkAccessFlags(Flags f)
Assert if the flags f are legal access flags. |
void |
checkClassConformance(ClassType ct)
Assert that ct implements all abstract methods required;
that is, if it is a concrete class, then it must implement all
interfaces and abstract methods that it or it's superclasses declare, and if
it is an abstract class then any methods that it overrides are overridden
correctly. |
void |
checkConstructorFlags(Flags f)
Assert if the flags f are legal constructor flags. |
void |
checkCycles(ReferenceType goal)
Assert that t has no cycles in the super type+nested class
graph starting at t. |
protected void |
checkCycles(ReferenceType curr,
ReferenceType goal)
|
void |
checkFieldFlags(Flags f)
Assert if the flags f are legal field flags. |
void |
checkInitializerFlags(Flags f)
Assert if the flags f are legal initializer flags. |
void |
checkLocalClassFlags(Flags f)
Assert if the flags f are legal local class flags. |
void |
checkLocalFlags(Flags f)
Assert if the flags f are legal local variable flags. |
void |
checkMemberClassFlags(Flags f)
Assert if the flags f are legal member class flags. |
void |
checkMethodFlags(Flags f)
Assert if the flags f are legal method flags. |
void |
checkOverride(MethodInstance mi,
MethodInstance mj)
Throw a SemanticException if mi cannot override
mj. |
void |
checkTopLevelClassFlags(Flags f)
Assert if the flags f are legal top-level class flags. |
ClassType |
Class()
java.lang.Class |
protected boolean |
classAccessible(ClassType targetClass,
ClassType contextClass)
True if the class targetClass accessible from the body of class contextClass. |
boolean |
classAccessible(ClassType targetClass,
Context context)
True if the class targetClass accessible from the context. |
boolean |
classAccessibleFromPackage(ClassType targetClass,
Package pkg)
True if the class targetClass accessible from the package pkg. |
ClassType |
ClassCastException()
java.lang.ClassCastException |
Resolver |
classContextResolver(ClassType type)
Get a resolver for looking up a type in a class context. |
ClassType |
Cloneable()
java.lang.Cloneable |
ConstructorInstance |
constructorInstance(Position pos,
ClassType container,
Flags flags,
java.util.List argTypes,
java.util.List excTypes)
Create a constructor instance. |
ParsedClassType |
createClassType()
Create a new empty class. |
ParsedClassType |
createClassType(LazyClassInitializer init)
Create a new empty class. |
ParsedClassType |
createClassType(LazyClassInitializer init,
Source fromSource)
Create a new empty class. |
ParsedClassType |
createClassType(Source fromSource)
Create a new empty class. |
Context |
createContext()
Create a new context object for looking up variables, types, etc. |
Flags |
createNewFlag(java.lang.String name,
Flags after)
Create a new unique Flags object. |
protected NullType |
createNull()
|
protected PrimitiveType |
createPrimitive(PrimitiveType.Kind kind)
|
LazyClassInitializer |
defaultClassInitializer()
The default lazy class initializer. |
ConstructorInstance |
defaultConstructor(Position pos,
ClassType container)
Create a default constructor instance. |
java.util.List |
defaultPackageImports()
Return a list of the packages names that will be imported by default. |
boolean |
descendsFrom(Type child,
Type ancestor)
Returns true iff child and ancestor are distinct reference types, and child descends from ancestor. |
PrimitiveType |
Double()
double |
boolean |
equals(TypeObject type1,
TypeObject type2)
Returns true iff type1 and type2 represent the same type object. |
ClassType |
Error()
java.lang.Error |
ClassType |
Exception()
java.lang.Exception |
FieldInstance |
fieldInstance(Position pos,
ReferenceType container,
Flags flags,
Type type,
java.lang.String name)
Create a field instance. |
Flags |
Final()
|
protected java.util.List |
findAcceptableConstructors(ClassType container,
java.util.List argTypes,
ClassType currClass)
Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1 |
protected java.util.List |
findAcceptableMethods(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
ClassType currClass)
Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1 |
ConstructorInstance |
findConstructor(ClassType container,
java.util.List argTypes,
ClassType currClass)
Find a constructor. |
ConstructorInstance |
findConstructor(ClassType container,
java.util.List argTypes,
Context c)
Deprecated version of the findConstructor method. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name)
Returns the FieldInstance for the field name defined
in type container or a supertype. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name,
ClassType currClass)
Returns the FieldInstance for the field name defined
in type container or a supertype, and visible from
currClass. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name,
Context c)
Deprecated version of the findField method. |
protected java.util.Set |
findFields(ReferenceType container,
java.lang.String name)
Returns a set of fields named name defined
in type container or a supertype. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name)
Find a member class. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name,
ClassType currClass)
Find a member class. |
ClassType |
findMemberClass(ClassType container,
java.lang.String name,
Context c)
Deprecated version of the findMemberClass method. |
java.util.Set |
findMemberClasses(ClassType container,
java.lang.String name)
|
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
ClassType currClass)
Requires: all type arguments are canonical. |
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
Context c)
Deprecated version of the findMethod method. |
protected ProcedureInstance |
findProcedure(java.util.List acceptable,
ReferenceType container,
java.util.List argTypes,
ClassType currClass)
|
Flags |
flagsForBits(int bits)
Given the JVM encoding of a set of flags, returns the Flags object for that encoding. |
Flags |
flagsForName(java.lang.String name)
|
PrimitiveType |
Float()
float |
java.lang.String |
getTransformedClassName(ClassType ct)
Get the transformed class name of a class. |
java.util.Set |
getTypeEncoderRootSet(Type t)
Return the set of objects that should be serialized into the type information for the given ClassType. |
boolean |
hasEnclosingInstance(ClassType inner,
ClassType encl)
Returns whether an object of the inner class inner has an
enclosing instance of class encl. |
boolean |
hasFormals(ProcedureInstance pi,
java.util.List formalTypes)
Return true if t overrides mi |
boolean |
hasMethod(ReferenceType t,
MethodInstance mi)
Return true if t overrides mi |
java.util.List |
implemented(MethodInstance mi)
Get the list of methods mi implements, in no
specified order. |
ImportTable |
importTable(Package pkg)
Create an import table for the source file. |
ImportTable |
importTable(java.lang.String sourceName,
Package pkg)
Create an import table for the source file. |
protected void |
initFlags()
|
void |
initialize(LoadedClassResolver loadedResolver,
ExtensionInfo extInfo)
Initializes the type system and its internal constants (which depend on the resolver). |
InitializerInstance |
initializerInstance(Position pos,
ClassType container,
Flags flags)
Create an initailizer instance. |
protected void |
initTypes()
|
PrimitiveType |
Int()
int |
Flags |
Interface()
|
java.util.List |
interfaces(ReferenceType type)
Returns an immutable list of all the interface types which type implements. |
protected boolean |
isAccessible(MemberInstance mi,
ClassType contextClass)
Checks whether the member mi can be accessed from code that is declared in the class contextClass. |
boolean |
isAccessible(MemberInstance mi,
Context context)
Checks whether the member mi can be accessed from Context "context". |
boolean |
isCanonical(Type type)
Returns true iff |
boolean |
isCastValid(Type fromType,
Type toType)
Requires: all type arguments are canonical. |
boolean |
isEnclosed(ClassType inner,
ClassType outer)
Returns whether inner is enclosed within outer |
boolean |
isImplicitCastValid(Type fromType,
Type toType)
Requires: all type arguments are canonical. |
boolean |
isSameMethod(MethodInstance m1,
MethodInstance m2)
Returns true iff |
boolean |
isSubtype(Type t1,
Type t2)
Returns true iff child descends from ancestor or child == ancestor. |
boolean |
isThrowable(Type type)
Returns true iff an object of type |
boolean |
isUncheckedException(Type type)
Returns a true iff the type or a supertype is in the list returned by uncheckedExceptions(). |
Type |
leastCommonAncestor(Type type1,
Type type2)
Requires: all type arguments are canonical. |
protected java.lang.String |
listToString(java.util.List l)
|
protected ClassType |
load(java.lang.String name)
|
LoadedClassResolver |
loadedResolver()
Return the type system's loaded resolver. |
LocalInstance |
localInstance(Position pos,
Flags flags,
Type type,
java.lang.String name)
Create a local variable instance. |
PrimitiveType |
Long()
long |
boolean |
methodCallValid(MethodInstance prototype,
java.lang.String name,
java.util.List argTypes)
Return true if mi can be called with name name
and actual parameters of types actualTypes. |
MethodInstance |
methodInstance(Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List argTypes,
java.util.List excTypes)
Create a method instance. |
boolean |
moreSpecific(ProcedureInstance p1,
ProcedureInstance p2)
Returns whether method 1 is more specific than method 2, where more specific is defined as JLS 15.11.2.2 |
Flags |
Native()
|
Flags |
NoFlags()
|
NullType |
Null()
The type of null. |
ClassType |
NullPointerException()
java.lang.NullPointerException |
boolean |
numericConversionValid(Type t,
long value)
Returns true if value can be implicitly cast to Primitive
type t. |
boolean |
numericConversionValid(Type t,
java.lang.Object value)
Returns true if value can be implicitly cast to Primitive
type t. |
ClassType |
Object()
java.lang.Object |
ClassType |
OutOfBoundsException()
java.lang.ArrayIndexOutOfBoundsException |
java.util.List |
overrides(MethodInstance mi)
Get the list of methods mi (potentially) overrides, in
order from this class (that is, including this) to super
classes. |
Resolver |
packageContextResolver(Resolver cr,
Package p)
Get a resolver for looking up a type in a package. |
boolean |
packageExists(java.lang.String name)
Returns true if the package named name exists. |
Package |
packageForName(Package prefix,
java.lang.String name)
Return a package by name with the given outer package. |
Package |
packageForName(java.lang.String name)
Return a package by name. |
TableResolver |
parsedResolver()
Return the type system's table resolver. |
java.lang.Object |
placeHolder(TypeObject o)
Get a place-holder for serializing a type object. |
java.lang.Object |
placeHolder(TypeObject o,
java.util.Set roots)
Get a place-holder for serializing a type object. |
PrimitiveType |
primitiveForName(java.lang.String name)
Return the primitive with the given name. |
Flags |
Private()
|
PrimitiveType |
promote(Type t)
Unary promotion for numeric types. |
PrimitiveType |
promote(Type t1,
Type t2)
Binary promotion for numeric types. |
protected PrimitiveType |
promoteNumeric(PrimitiveType t)
|
protected PrimitiveType |
promoteNumeric(PrimitiveType t1,
PrimitiveType t2)
|
Flags |
Protected()
|
Flags |
Public()
|
ClassType |
RuntimeException()
java.lang.RuntimeException |
ClassType |
Serializable()
java.io.Serializable |
PrimitiveType |
Short()
short |
Flags |
Static()
|
Type |
staticTarget(Type t)
Returns t, modified as necessary to make it a legal static target. |
Flags |
StrictFP()
|
ClassType |
String()
java.lang.String |
Type |
superType(ReferenceType type)
Returns the supertype of type, or null if type has no supertype. |
Flags |
Synchronized()
|
Resolver |
systemResolver()
Returns the system resolver. |
ClassType |
Throwable()
java.lang.Throwable |
boolean |
throwsSubset(ProcedureInstance p1,
ProcedureInstance p2)
Returns true iff |
java.lang.String |
toString()
|
Flags |
Transient()
|
java.lang.String |
translateArray(Resolver c,
ArrayType t)
Translate an array type. |
java.lang.String |
translateClass(Resolver c,
ClassType t)
Translate a top-level class type. |
java.lang.String |
translatePackage(Resolver c,
Package p)
Translate a package. |
java.lang.String |
translatePrimitive(Resolver c,
PrimitiveType t)
Translate a primitive type. |
Type |
typeForClass(java.lang.Class clazz)
Returns a canonical type corresponding to the Java Class object theClass. |
ClassType |
typeForName(java.lang.String name)
Get the class type with the following name. |
java.util.Collection |
uncheckedExceptions()
Returns a list of the Throwable types that need not be declared in method and constructor signatures. |
UnknownQualifier |
unknownQualifier(Position pos)
Get an unknown type qualifier. |
UnknownType |
unknownType(Position pos)
Get an unknown type. |
PrimitiveType |
Void()
void |
Flags |
Volatile()
|
java.lang.String |
wrapperTypeString(PrimitiveType t)
Return the boxed version of t. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Resolver systemResolver
protected TableResolver parsedResolver
protected LoadedClassResolver loadedResolver
protected java.util.Map flagsForName
protected ClassType OBJECT_
protected ClassType CLASS_
protected ClassType STRING_
protected ClassType THROWABLE_
protected final NullType NULL_
protected final PrimitiveType VOID_
protected final PrimitiveType BOOLEAN_
protected final PrimitiveType CHAR_
protected final PrimitiveType BYTE_
protected final PrimitiveType SHORT_
protected final PrimitiveType INT_
protected final PrimitiveType LONG_
protected final PrimitiveType FLOAT_
protected final PrimitiveType DOUBLE_
protected UnknownType unknownType
protected UnknownQualifier unknownQualifier
protected LazyClassInitializer defaultClassInit
protected final Flags ACCESS_FLAGS
protected final Flags LOCAL_FLAGS
protected final Flags FIELD_FLAGS
protected final Flags CONSTRUCTOR_FLAGS
protected final Flags INITIALIZER_FLAGS
protected final Flags METHOD_FLAGS
protected final Flags TOP_LEVEL_CLASS_FLAGS
protected final Flags MEMBER_CLASS_FLAGS
protected final Flags LOCAL_CLASS_FLAGS
| Constructor Detail |
public TypeSystem_c()
| Method Detail |
public void initialize(LoadedClassResolver loadedResolver,
ExtensionInfo extInfo)
throws SemanticException
initialize in interface TypeSystemloadedResolver - The resolver to use for loading types from class files
or other source files.extInfo - The ExtensionInfo the TypeSystem is being created for.
SemanticException
protected void initTypes()
throws SemanticException
SemanticExceptionpublic Resolver systemResolver()
TypeSystem
systemResolver in interface TypeSystempublic TableResolver parsedResolver()
TypeSystem
parsedResolver in interface TypeSystempublic LoadedClassResolver loadedResolver()
TypeSystem
loadedResolver in interface TypeSystem
public ImportTable importTable(java.lang.String sourceName,
Package pkg)
TypeSystem
importTable in interface TypeSystemsourceName - Name of the source file to import into. This is used
mainly for error messages and for debugging.pkg - The package of the source file in which to import.public ImportTable importTable(Package pkg)
TypeSystem
importTable in interface TypeSystempkg - The package of the source file in which to import.public boolean packageExists(java.lang.String name)
name exists.
packageExists in interface TypeSystemprotected void assert_(java.util.Collection l)
protected void assert_(TypeObject o)
public java.lang.String wrapperTypeString(PrimitiveType t)
TypeSystemt.
wrapperTypeString in interface TypeSystempublic Context createContext()
TypeSystem
createContext in interface TypeSystem
public Resolver packageContextResolver(Resolver cr,
Package p)
TypeSystem
packageContextResolver in interface TypeSystempublic Resolver classContextResolver(ClassType type)
TypeSystem
classContextResolver in interface TypeSystem
public FieldInstance fieldInstance(Position pos,
ReferenceType container,
Flags flags,
Type type,
java.lang.String name)
TypeSystem
fieldInstance in interface TypeSystempos - Position of the field.container - Containing type of the field.flags - The field's flags.type - The field's type.name - The field's name.
public LocalInstance localInstance(Position pos,
Flags flags,
Type type,
java.lang.String name)
TypeSystem
localInstance in interface TypeSystempos - Position of the local variable.flags - The local variable's flags.type - The local variable's type.name - The local variable's name.
public ConstructorInstance defaultConstructor(Position pos,
ClassType container)
TypeSystem
defaultConstructor in interface TypeSystempos - Position of the constructor.container - Containing class of the constructor.
public ConstructorInstance constructorInstance(Position pos,
ClassType container,
Flags flags,
java.util.List argTypes,
java.util.List excTypes)
TypeSystem
constructorInstance in interface TypeSystempos - Position of the constructor.container - Containing class of the constructor.flags - The constructor's flags.argTypes - The constructor's formal parameter types.excTypes - The constructor's exception throw types.
public InitializerInstance initializerInstance(Position pos,
ClassType container,
Flags flags)
TypeSystem
initializerInstance in interface TypeSystempos - Position of the initializer.container - Containing class of the initializer.flags - The initializer's flags.
public MethodInstance methodInstance(Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List argTypes,
java.util.List excTypes)
TypeSystem
methodInstance in interface TypeSystempos - Position of the method.container - Containing type of the method.flags - The method's flags.returnType - The method's return type.name - The method's name.argTypes - The method's formal parameter types.excTypes - The method's exception throw types.
public boolean descendsFrom(Type child,
Type ancestor)
descendsFrom in interface TypeSystem
public boolean isCastValid(Type fromType,
Type toType)
isCastValid in interface TypeSystem
public boolean isImplicitCastValid(Type fromType,
Type toType)
isImplicitCastValid in interface TypeSystem
public boolean equals(TypeObject type1,
TypeObject type2)
equals in interface TypeSystem
public boolean numericConversionValid(Type t,
java.lang.Object value)
value can be implicitly cast to Primitive
type t.
numericConversionValid in interface TypeSystem
public boolean numericConversionValid(Type t,
long value)
value can be implicitly cast to Primitive
type t. This method should be removed. It is kept for
backward compatibility.
numericConversionValid in interface TypeSystempublic boolean isCanonical(Type type)
isCanonical in interface TypeSystem
public boolean isAccessible(MemberInstance mi,
Context context)
isAccessible in interface TypeSystem
protected boolean isAccessible(MemberInstance mi,
ClassType contextClass)
public boolean classAccessible(ClassType targetClass,
Context context)
classAccessible in interface TypeSystem
protected boolean classAccessible(ClassType targetClass,
ClassType contextClass)
public boolean classAccessibleFromPackage(ClassType targetClass,
Package pkg)
classAccessibleFromPackage in interface TypeSystem
protected boolean accessibleFromPackage(Flags flags,
Package pkg1,
Package pkg2)
flags
in package pkg1 is accessible from package
pkg2.
public boolean isEnclosed(ClassType inner,
ClassType outer)
TypeSystem
isEnclosed in interface TypeSystem
public boolean hasEnclosingInstance(ClassType inner,
ClassType encl)
TypeSysteminner has an
enclosing instance of class encl.
hasEnclosingInstance in interface TypeSystem
public void checkCycles(ReferenceType goal)
throws SemanticException
TypeSystemt has no cycles in the super type+nested class
graph starting at t.
checkCycles in interface TypeSystemSemanticException
protected void checkCycles(ReferenceType curr,
ReferenceType goal)
throws SemanticException
SemanticException
public boolean canCoerceToString(Type t,
Context c)
canCoerceToString in interface TypeSystempublic boolean isThrowable(Type type)
isThrowable in interface TypeSystempublic boolean isUncheckedException(Type type)
isUncheckedException in interface TypeSystempublic java.util.Collection uncheckedExceptions()
uncheckedExceptions in interface TypeSystem
public boolean isSubtype(Type t1,
Type t2)
TypeSystem
descendsFrom(child, ancestor) || equals(child, ancestor)
isSubtype in interface TypeSystem
public FieldInstance findField(ReferenceType container,
java.lang.String name,
Context c)
throws SemanticException
TypeSystem
findField in interface TypeSystemSemanticException
public FieldInstance findField(ReferenceType container,
java.lang.String name,
ClassType currClass)
throws SemanticException
name defined
in type container or a supertype, and visible from
currClass. If no such field is found, a SemanticException
is thrown. currClass may be null.
findField in interface TypeSystemSemanticException - if the field cannot be found or is
inaccessible.
public FieldInstance findField(ReferenceType container,
java.lang.String name)
throws SemanticException
name defined
in type container or a supertype. If no such field is
found, a SemanticException is thrown.
findField in interface TypeSystemSemanticException - if the field cannot be found or is
inaccessible.
protected java.util.Set findFields(ReferenceType container,
java.lang.String name)
name defined
in type container or a supertype. The list
returned may be empty.
public ClassType findMemberClass(ClassType container,
java.lang.String name,
Context c)
throws SemanticException
TypeSystem
findMemberClass in interface TypeSystemSemanticException
public ClassType findMemberClass(ClassType container,
java.lang.String name,
ClassType currClass)
throws SemanticException
TypeSystem
findMemberClass in interface TypeSystemSemanticException - if the class cannot be found or is
inaccessible.
public java.util.Set findMemberClasses(ClassType container,
java.lang.String name)
throws SemanticException
SemanticException
public ClassType findMemberClass(ClassType container,
java.lang.String name)
throws SemanticException
TypeSystem
findMemberClass in interface TypeSystemSemanticException - if the class cannot be found or is
inaccessible.protected java.lang.String listToString(java.util.List l)
public MethodInstance findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
Context c)
throws SemanticException
TypeSystem
findMethod in interface TypeSystemSemanticException
public MethodInstance findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
ClassType currClass)
throws SemanticException
findMethod in interface TypeSystemSemanticException - if the method cannot be found or is
inaccessible.
public ConstructorInstance findConstructor(ClassType container,
java.util.List argTypes,
Context c)
throws SemanticException
TypeSystem
findConstructor in interface TypeSystemSemanticException
public ConstructorInstance findConstructor(ClassType container,
java.util.List argTypes,
ClassType currClass)
throws SemanticException
TypeSystem
findConstructor in interface TypeSystemSemanticException - if the constructor cannot be found or is
inaccessible.
protected ProcedureInstance findProcedure(java.util.List acceptable,
ReferenceType container,
java.util.List argTypes,
ClassType currClass)
throws SemanticException
SemanticException
protected java.util.List findAcceptableMethods(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
ClassType currClass)
throws SemanticException
SemanticException
protected java.util.List findAcceptableConstructors(ClassType container,
java.util.List argTypes,
ClassType currClass)
public boolean moreSpecific(ProcedureInstance p1,
ProcedureInstance p2)
moreSpecific in interface TypeSystempublic Type superType(ReferenceType type)
superType in interface TypeSystempublic java.util.List interfaces(ReferenceType type)
interfaces in interface TypeSystem
public Type leastCommonAncestor(Type type1,
Type type2)
throws SemanticException
leastCommonAncestor in interface TypeSystemSemanticException - if the LCA does not exist
public boolean throwsSubset(ProcedureInstance p1,
ProcedureInstance p2)
throwsSubset in interface TypeSystem
public boolean hasFormals(ProcedureInstance pi,
java.util.List formalTypes)
hasFormals in interface TypeSystem
public boolean hasMethod(ReferenceType t,
MethodInstance mi)
hasMethod in interface TypeSystempublic java.util.List overrides(MethodInstance mi)
TypeSystemmi (potentially) overrides, in
order from this class (that is, including this) to super
classes.
overrides in interface TypeSystempublic java.util.List implemented(MethodInstance mi)
TypeSystemmi implements, in no
specified order.
implemented in interface TypeSystem
public boolean canOverride(MethodInstance mi,
MethodInstance mj)
TypeSystemmi can override mj.
canOverride in interface TypeSystem
public void checkOverride(MethodInstance mi,
MethodInstance mj)
throws SemanticException
TypeSystemmi cannot override
mj.
checkOverride in interface TypeSystemSemanticException
public boolean isSameMethod(MethodInstance m1,
MethodInstance m2)
isSameMethod in interface TypeSystem
public boolean methodCallValid(MethodInstance prototype,
java.lang.String name,
java.util.List argTypes)
TypeSystemmi can be called with name name
and actual parameters of types actualTypes.
methodCallValid in interface TypeSystem
public boolean callValid(ProcedureInstance prototype,
java.util.List argTypes)
TypeSystempi can be called with
actual parameters of types actualTypes.
callValid in interface TypeSystempublic NullType Null()
TypeSystemnull.
Null in interface TypeSystempublic PrimitiveType Void()
TypeSystemvoid
Void in interface TypeSystempublic PrimitiveType Boolean()
TypeSystemboolean
Boolean in interface TypeSystempublic PrimitiveType Char()
TypeSystemchar
Char in interface TypeSystempublic PrimitiveType Byte()
TypeSystembyte
Byte in interface TypeSystempublic PrimitiveType Short()
TypeSystemshort
Short in interface TypeSystempublic PrimitiveType Int()
TypeSystemint
Int in interface TypeSystempublic PrimitiveType Long()
TypeSystemlong
Long in interface TypeSystempublic PrimitiveType Float()
TypeSystemfloat
Float in interface TypeSystempublic PrimitiveType Double()
TypeSystemdouble
Double in interface TypeSystemprotected ClassType load(java.lang.String name)
public ClassType typeForName(java.lang.String name)
throws SemanticException
TypeSystem
typeForName in interface TypeSystemname - The name to create the type for.
SemanticException - when class is not found.public ClassType Object()
TypeSystemjava.lang.Object
Object in interface TypeSystempublic ClassType Class()
TypeSystemjava.lang.Class
Class in interface TypeSystempublic ClassType String()
TypeSystemjava.lang.String
String in interface TypeSystempublic ClassType Throwable()
TypeSystemjava.lang.Throwable
Throwable in interface TypeSystempublic ClassType Error()
TypeSystemjava.lang.Error
Error in interface TypeSystempublic ClassType Exception()
TypeSystemjava.lang.Exception
Exception in interface TypeSystempublic ClassType RuntimeException()
TypeSystemjava.lang.RuntimeException
RuntimeException in interface TypeSystempublic ClassType Cloneable()
TypeSystemjava.lang.Cloneable
Cloneable in interface TypeSystempublic ClassType Serializable()
TypeSystemjava.io.Serializable
Serializable in interface TypeSystempublic ClassType NullPointerException()
TypeSystemjava.lang.NullPointerException
NullPointerException in interface TypeSystempublic ClassType ClassCastException()
TypeSystemjava.lang.ClassCastException
ClassCastException in interface TypeSystempublic ClassType OutOfBoundsException()
TypeSystemjava.lang.ArrayIndexOutOfBoundsException
OutOfBoundsException in interface TypeSystempublic ClassType ArrayStoreException()
TypeSystemjava.lang.ArrayStoreException
ArrayStoreException in interface TypeSystempublic ClassType ArithmeticException()
TypeSystemjava.lang.ArithmeticException
ArithmeticException in interface TypeSystemprotected NullType createNull()
protected PrimitiveType createPrimitive(PrimitiveType.Kind kind)
public java.lang.Object placeHolder(TypeObject o)
TypeSystem
placeHolder in interface TypeSystemo - The object to get the place-holder for.
public java.lang.Object placeHolder(TypeObject o,
java.util.Set roots)
TypeSystem
placeHolder in interface TypeSystemo - The object to get the place-holder for.roots - The root objects for the serialization. Place holders
are not created for these.public UnknownType unknownType(Position pos)
TypeSystem
unknownType in interface TypeSystempublic UnknownQualifier unknownQualifier(Position pos)
TypeSystem
unknownQualifier in interface TypeSystem
public Package packageForName(Package prefix,
java.lang.String name)
TypeSystem
packageForName in interface TypeSystempublic Package packageForName(java.lang.String name)
TypeSystem
packageForName in interface TypeSystempublic ArrayType arrayOf(Type type)
arrayOf in interface TypeSystem
public ArrayType arrayOf(Position pos,
Type type)
TypeSystemtype
arrayOf in interface TypeSystem
protected ArrayType arrayType(Position pos,
Type type)
public ArrayType arrayOf(Type type,
int dims)
TypeSystemdims-array of type
arrayOf in interface TypeSystem
public ArrayType arrayOf(Position pos,
Type type,
int dims)
TypeSystemdims-array of type
arrayOf in interface TypeSystem
public Type typeForClass(java.lang.Class clazz)
throws SemanticException
SemanticExceptionpublic java.util.Set getTypeEncoderRootSet(Type t)
TypeSystem
getTypeEncoderRootSet in interface TypeSystempublic java.lang.String getTransformedClassName(ClassType ct)
getTransformedClassName in interface TypeSystem
public java.lang.String translatePackage(Resolver c,
Package p)
TypeSystem
translatePackage in interface TypeSystem
public java.lang.String translateArray(Resolver c,
ArrayType t)
TypeSystem
translateArray in interface TypeSystem
public java.lang.String translateClass(Resolver c,
ClassType t)
TypeSystem
translateClass in interface TypeSystem
public java.lang.String translatePrimitive(Resolver c,
PrimitiveType t)
TypeSystem
translatePrimitive in interface TypeSystem
public PrimitiveType primitiveForName(java.lang.String name)
throws SemanticException
TypeSystem
primitiveForName in interface TypeSystemSemanticExceptionpublic LazyClassInitializer defaultClassInitializer()
TypeSystem
defaultClassInitializer in interface TypeSystempublic final ParsedClassType createClassType()
TypeSystem
createClassType in interface TypeSystempublic final ParsedClassType createClassType(Source fromSource)
TypeSystem
createClassType in interface TypeSystempublic final ParsedClassType createClassType(LazyClassInitializer init)
TypeSystem
createClassType in interface TypeSystem
public ParsedClassType createClassType(LazyClassInitializer init,
Source fromSource)
TypeSystem
createClassType in interface TypeSystempublic java.util.List defaultPackageImports()
TypeSystem
defaultPackageImports in interface TypeSystem
public PrimitiveType promote(Type t1,
Type t2)
throws SemanticException
TypeSystem
promote in interface TypeSystemSemanticException - if the types cannot be promoted.
protected PrimitiveType promoteNumeric(PrimitiveType t1,
PrimitiveType t2)
public PrimitiveType promote(Type t)
throws SemanticException
TypeSystem
promote in interface TypeSystemSemanticException - if the type cannot be promoted.protected PrimitiveType promoteNumeric(PrimitiveType t)
public void checkMethodFlags(Flags f)
throws SemanticException
TypeSystemf are legal method flags.
checkMethodFlags in interface TypeSystemSemanticException
public void checkLocalFlags(Flags f)
throws SemanticException
TypeSystemf are legal local variable flags.
checkLocalFlags in interface TypeSystemSemanticException
public void checkFieldFlags(Flags f)
throws SemanticException
TypeSystemf are legal field flags.
checkFieldFlags in interface TypeSystemSemanticException
public void checkConstructorFlags(Flags f)
throws SemanticException
TypeSystemf are legal constructor flags.
checkConstructorFlags in interface TypeSystemSemanticException
public void checkInitializerFlags(Flags f)
throws SemanticException
TypeSystemf are legal initializer flags.
checkInitializerFlags in interface TypeSystemSemanticException
public void checkTopLevelClassFlags(Flags f)
throws SemanticException
TypeSystemf are legal top-level class flags.
checkTopLevelClassFlags in interface TypeSystemSemanticException
public void checkMemberClassFlags(Flags f)
throws SemanticException
TypeSystemf are legal member class flags.
checkMemberClassFlags in interface TypeSystemSemanticException
public void checkLocalClassFlags(Flags f)
throws SemanticException
TypeSystemf are legal local class flags.
checkLocalClassFlags in interface TypeSystemSemanticException
public void checkAccessFlags(Flags f)
throws SemanticException
TypeSystemf are legal access flags.
checkAccessFlags in interface TypeSystemSemanticExceptionprotected java.util.List abstractSuperInterfaces(ReferenceType rt)
ct that may contain abstract methods that must be
implemented by ct. The list returned also contains
ct.
public void checkClassConformance(ClassType ct)
throws SemanticException
ct implements all abstract methods required;
that is, if it is a concrete class, then it must implement all
interfaces and abstract methods that it or it's superclasses declare, and if
it is an abstract class then any methods that it overrides are overridden
correctly.
checkClassConformance in interface TypeSystemSemanticExceptionpublic Type staticTarget(Type t)
staticTarget in interface TypeSystemprotected void initFlags()
public Flags createNewFlag(java.lang.String name,
Flags after)
TypeSystem
createNewFlag in interface TypeSystemname - the name of the flagafter - print the new flag after these flagspublic Flags NoFlags()
NoFlags in interface TypeSystempublic Flags Public()
Public in interface TypeSystempublic Flags Private()
Private in interface TypeSystempublic Flags Protected()
Protected in interface TypeSystempublic Flags Static()
Static in interface TypeSystempublic Flags Final()
Final in interface TypeSystempublic Flags Synchronized()
Synchronized in interface TypeSystempublic Flags Transient()
Transient in interface TypeSystempublic Flags Native()
Native in interface TypeSystempublic Flags Interface()
Interface in interface TypeSystempublic Flags Abstract()
Abstract in interface TypeSystempublic Flags Volatile()
Volatile in interface TypeSystempublic Flags StrictFP()
StrictFP in interface TypeSystempublic Flags flagsForBits(int bits)
TypeSystem
flagsForBits in interface TypeSystempublic Flags flagsForName(java.lang.String name)
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||