|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CMember
org.multijava.mjc.CClass
This class represents a class declaration in the signature hierarchy.
CMember| Nested Class Summary | |
protected class |
CClass.NoDupStrategy
This class is a specialization of CMethodSet.Strategy that keeps track of which CClass instances have already been searched for appropriate methods. |
static interface |
CClass.Observer
|
| Field Summary | |
private static int |
accessID
|
private CMethod |
assertHelperMethod
The synthetic methods used to implement assertions |
private CAssertStaticInitMethod |
assertStaticInitMethod
|
private CAugmentationMap |
augMap
Contains a mapping from contexts to the the set of augmenting methods for this class in each context. |
static CClass |
CLS_UNDEFINED
|
private Main |
compiler
|
protected CClassType[] |
dispClassTypes
Stores the dispatcher classes contained within the class or generic function anchor represented by this. |
private CMethodSet |
fieldGetterMethods
The field getter methods of this class |
private CFieldTable |
fields
Maps names to field signature for all the fields of this class. |
private CMethodSet |
fieldSetterMethods
The field setter methods of this class |
private CClassType[] |
innerClasses
|
private CClassType[] |
interfaces
|
protected CMethodSet |
methods
The methods of this class after dispatcher wrapping. |
private static TokenReference |
NO_TOKEN
Used for error reporting. |
private HashSet |
observerSet
Stores the observers that are to be notified when #setCheckedMembers() is called. |
private CMethodSet |
protoMethods
The methods of this class as generated from the declarations after the checkInterface pass but before dispatcher wrapping. |
private String |
qualifiedName
|
private CMethodSet |
redirectorMethods
Redirectors for inherited external methods that implement a regular Java interface. |
private File |
sourceFile
|
private CClassType |
superClass
|
private int |
syntheticIndex
|
private boolean |
syntheticOuterThisInaccessible
Flag is true if we are not generating a synthetic outer 'this' field for this inner class, because the outer this is not accessible. |
private CClassType |
type
|
private CTypeVariable[] |
typevariables
|
private HashSet |
visibleNestedTypes
Tracks the nested and inner classes referred to within this class (whether or not their declarations are lexically enclosed in this class). |
private CMethodSet |
wrapperMethods
The wrapper methods of this class |
| Fields inherited from class org.multijava.mjc.CMember |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CClass(Main compiler,
MemberAccess access,
File sourceFile,
String ident,
String qualifiedName,
CClassType superClass,
boolean deprecated)
Constructs a class signature. |
|
| Method Summary | |
protected void |
accumLocalExtAndInheritedMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args,
CContextType context)
Accumulates the set of methods with identifier name declared in the type represented by this,
or added to the type by external methods, using the
strategy actor. |
protected void |
accumLocalInternalMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args)
Accumulates the set of methods with identifier name declared in the type represented by this,
using the strategy actor. |
protected void |
accumMostSpecificMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args,
CContextType context)
Accumulates the set of methods with identifier name declared in the type represented by this,
or added to the type by external methods, using the
strategy actor. |
void |
addBridgeMethod(CMethod me,
CContextType context)
|
void |
addField(CSourceField field)
Add inner fields |
void |
addRedirector(CSourceRedirectorMethod redir)
Adds a synthetic redirector method to this. |
protected void |
appendCustomAttributes(AttributeList accum)
Appends any custom attributes for this class to the attribute list represented by accum. |
void |
augmentWithMethod(CMethod m,
CCompilationUnitContextType c)
|
void |
checkBridgeMethod(CMethod me,
CClassType[] args,
CContextType context)
|
void |
checkInstantiation(CContextType context,
CClassType[] typeArguments)
|
void |
close(CMethod[] methods_A,
CClassType[] dispClassTypes)
Ends the definition of this class by adding the dispatcher-wrapped methods and inner-dispatcher classes. |
void |
collectAbstractMethods(ArrayList v,
CClassType[] args)
Walks up the extends hierarchy and adds all abstract methods to the given list. |
void |
collectInterfaceMethods(ArrayList v,
CClassType[] args)
Walks up the implements and extends hierarchies and adds all methods of interfaces to the given list. |
int |
compareTo(Object o)
Compares this to a given object. |
protected ClassInfo |
createClassInfo(long modifiers,
String superClass,
File sourceFile)
Creates an instance of ClassInfo. |
boolean |
descendsFrom(CClass maybeSuper)
Indicates whether this host is a subclass of the given class, where "subclass" is the reflexive, transitive closure of the extends relation. |
boolean |
descendsFrom(CClassType from,
CClassType[] actuals)
Indicate whether the host class is a subclass of the "dest" class |
Collection |
directlyVisibleTypes()
Returns the set of types (excluding non-reference types) that are directly visible from this class. |
boolean |
equals(Object o)
Compares the fully qualified name of this with the
fully qualified name of o. |
Collection |
fields()
Returns a Collection of CField values, one for each field in this class. |
protected CFieldTable |
fieldsForCodeGen()
Returns the data structure representing the fields that will be used for generating bytecode. |
private CFieldAccessorMethod |
findAccessorMethod(CField f,
CMethodSet ms)
|
CFieldAccessorMethod |
findGetterMethod(CField f)
|
CFieldAccessorMethod |
findOrCreateGetterMethod(CField f)
|
CFieldAccessorMethod |
findOrCreateSetterMethod(CField f)
|
void |
genClassFile(Destination dest)
Generate the code in a class file. |
CType[] |
genConstructorArray(CType[] params)
Mutates the given array to add any synthetic parameters for outer local variables referenced within the class represented by this. |
protected AttributeList |
genCustomAttributes()
Returns an attribute list containing all the custom attributes to be added to the top-level classinfo generated for this. |
protected FieldInfo[] |
genFields()
Returns an array representing all the fields for bytecode. |
protected void |
genGenericFunctions(ArrayList accum)
Accumulates an array of all the required gf_info data structures for this. |
InnerClassInfo |
genInnerInfo()
Generates the inner class info record for this. |
protected InnerClassInfo[] |
genInners()
Returns an array representing (for bytecode) the type signatures of the inner and nested classes. |
protected ClassConstant[] |
genInterfaces()
Returns an array representing (for bytecode) the qualified names of the implemented interfaces. |
protected MethodInfo[] |
genMethods()
Returns an array representing all the methods for bytecode. |
void |
genSyntheticParams(CodeSequence code)
Adds synthetic parameters to the code sequence for a call to this class's constructor. |
void |
genSyntheticParamsForExplicitThis(CodeSequence code,
CMethod constructor)
Adds synthetic parameters to the code sequence for an explicit constructor invocation to this class's constructor. |
CMethodSet.MethodArgsPair[] |
getAbstractMethods()
Returns a list of abstract methods |
void |
getAllInheritableMethods(ArrayList v)
Walks up the extends and implements hierarchies and adds all inheritable methods to the given list, v, if
methods of the same signature are not already contained in
v. |
ArrayList |
getAllInheritedMethods()
Return all methods that are inherited from supertypes, except for those overridden in this class. |
void |
getAllMethods(ArrayList v)
Walks up the extends hierarchy and adds all methods to the given list. |
CClass |
getCClass()
|
Main |
getCompiler()
Returns the compiler |
protected CField |
getDeclaredField(String ident)
Returns the signature of the field with the given name declared in this class, or null if this class does not declare a field with the given name. |
int |
getFieldCount()
Returns the number of fields in this class. |
String |
getGenericSignature()
|
protected static String |
getIdentFrom(String qualifiedName)
|
CClassType[] |
getInnerClasses()
Returns an array of the types of the inner classes of the class represented by this. |
CMethodSet.MethodArgsPair[] |
getInterfaceMethods()
Returns a list of interface methods |
CClassType[] |
getInterfaces()
|
static String |
getNextAccessName()
|
int |
getNextSyntheticIndex()
Returns a unique int for use in naming synthetic classes (e.g. anonymous classes). |
CClassType |
getSubstitution(CTypeVariable typevariable,
CClassType[] sub)
|
CClassType |
getSubstitution(CTypeVariable typevariable,
CClassType[][] sub)
When a generic type is instantiated, the type variables should be substituted with the type arguments, This method returns the corresponding type arguments for the type variable |
CClass |
getSuperClass()
Returns the super class of this class |
CClassType |
getSuperSubstitution(CClassType supertype,
CTypeVariable typeVar)
|
JExpression[] |
getSyntheticParamsForExplicitSuper(CSourceClass callerClass,
CMethod caller)
For an explicit super class constructor invocation, returns the expressions that must be evaluated in the body of the constructor caller of the class
callerClass to add the outer local variable values
required by this to the stack. |
CFieldAccessorMethod |
getterOrSetterMethodFor(CField field,
CExpressionContextType context)
Returns a method that allows getting or setting the value of field from context context. |
CClassType |
getType()
Returns the type of this class. |
CTypeVariable[] |
getTypeVariables()
return the type variables of the class |
String |
getUniverseVersion()
Get the version of the encoding used to encode the universe type modifiers. |
int |
hashCode()
|
boolean |
hasProtectedVisibilityIn(CMemberHost from)
Indicates whether this member is accessible from the given host when this member has protected visibility. |
boolean |
hasSyntheticOuterThis()
Indicates whether the class represented by this should have a synthetic outer this field. |
static void |
initSession()
Initializes any non-final static items. |
protected CClassType[] |
innerClassesForAttribute()
Collects all the inner classes that must be added to the InnerClasses attribute. |
boolean |
isAbstract()
|
abstract boolean |
isAnonymous()
|
boolean |
isClass()
Indicates whether this host is a class. |
boolean |
isCompilationUnit()
Indicates whether this host is a compilation unit |
boolean |
isDefinedInside(CMemberHost maybeOuter)
Indicates whether this is defined inside the given host. |
protected boolean |
isFieldRedefined(String ident,
CExpressionContextType dummyContext)
Returns true iff a field with same name is already defined in a superclass or an implemented interface. |
boolean |
isGenericClass()
Indicates whether this class is Generic Class |
boolean |
isInnerClass()
Indicates whether this host is an inner class, i.e., a non-static member class. |
boolean |
isInterface()
|
abstract boolean |
isMember()
Indicates whether the class represented by this is a member type. |
boolean |
isNestedType()
Indicates whether this host is a nested type, i.e., a member type. |
CMethodSet |
lookupAllMethods(CMethod m,
CClassType[] args,
CContextType context)
Collects all the methods in the same GF as the argument method, visible in the given context, looking in parent hierarchy and augmentation map as needed. |
CClass |
lookupClass(String name,
CContextType context)
Searches for a class with the given simple name according the procedure in JLS2 6.5.5. |
CFieldAccessor |
lookupField(String name,
CExpressionContextType context)
Searches a field in current class and parent hierarchy as needed Creates an appropriate getter or setter method (or both) if necessary for privileged access to the field. |
protected CField |
lookupFieldHelper(String name,
CExpressionContextType context)
Searches a field in current class and parent hierarchy as needed |
CMethod |
lookupMethod(String name,
CType[] params,
CClassType[] args,
CContextType context)
Searches for the generic function applicable to the given identifier and argument type tuple, in the given context, looking in parent hierarchy and augmentation map as needed. |
CMethodSet |
lookupMethodOrSet(String name,
CType[] params,
CClassType[] argss,
CContextType context)
Searches for the generic function applicable to the given identifier and argument type tuple, in the given context, looking in parent hierarchy and augmentation map as needed. |
CMethodSet |
lookupMethodsSpecializedByMethod(CMethod specMethod,
CClassType[] args,
ArrayList needbridge,
CContextType context)
Searches for the methods specialized by a given method, in the given context, looking in parent hierarchy and augmentation map as needed. |
CMethodSet |
lookupMSAMethod(CMethod top,
CType[] argTuple,
CClassType[] argss,
CContextType context)
Searches for the most specific applicable method for the given argument tuple in the generic function to which the given method belongs in the given context, looking in parent hierarchy and augmentation map as needed. |
CMethod |
lookupOverloadedMethod(CMethod overloader,
CClassType[] args,
CContextType context)
If overloader could be rewritten to dynamically specialize a method instead of statically overloading it, then this return said method. |
CField |
lookupSuperField(String name,
CExpressionContextType context)
Searches a field in current class and parent hierarchy as needed |
CMethod |
lookupTopConcreteMethod(CMethod method,
CClassType[] args,
CContextType context)
Searches for the top concrete method of the generic function to which the given method belongs, in the given context, looking in the parent hierarchy and augmentation map as needed. |
CTypeVariable |
lookupTypeVariable(String ident)
|
protected boolean |
memberNeedsPrivilegedAccess(CMember m,
CContextType context)
Indicates whether the given member needs a wrapper method |
CMethodSet |
methods()
Returns the data structure representing the methods that will be used for generating bytecode. |
protected CMethodSet |
methodsForCodeGen()
Returns the data structure representing the methods that will be used for generating bytecode. |
boolean |
nestedDescendsFrom(CClass maybeOuterSuper)
Returns true if this host is a subclass of the given class or if some host of this host is a subclass of the given class. |
boolean |
noAssertionsYet()
Returns a boolean indicating whether or not assertions have been found in this class as of yet. |
boolean |
noPossiblyInnerAssertionsYet()
Returns a boolean indicating whether or not assertions have been found in this class or any inner classes as of yet. |
private boolean |
ownerOf(CTypeVariable typevariable)
check whether this class si the owner of the given type variable |
String |
packageName()
Gives the package name for this host. |
CMethodSet |
protoMethods()
Returns the data structure representing the methods of this class as generated from the declarations after the checkInterface pass but before dispatcher wrapping. |
String |
qualifiedName()
|
void |
register(CClass.Observer o)
Registers the given observer to be notified when #setCheckedMembers() is called. |
void |
registerNestedType(CType type)
Register a nested type visible inside this class. |
void |
rmjAnnotate(RMJAnnotation rmjInfo)
Generate any RMJ annotations |
void |
setAssertHelperMethod(CMethod m)
Set the synthetic helper method used to implement asserts. |
void |
setAssertStaticInitMethod(CAssertStaticInitMethod m)
Set the static initializer for handling asserts. |
void |
setCheckedInterfaces(CClassType[] interfaces)
Sets the interfaces extended or implemented by this type. |
void |
setCheckedMembers(CField[] fields_A,
Hashtable fields_H,
CMethod[] protoMethods_A)
Stores information on member signatures gathered during checkInterface pass prior to closing in the translateMJ pass. |
void |
setInnerClasses(CClassType[] inners)
End of first pass, we need the inner classes's signatures |
void |
setSuperClass(CClassType superClass)
Sets the super class of this class |
void |
setTypeVariables(CTypeVariable[] typevariables)
set the type variables of the class |
File |
sourceFile()
|
void |
syntheticOuterThisInaccessible()
Records the fact that even though the class is an inner class, we should not generate an outer this for it, because the outer this is not accessible. |
String |
toString()
|
private CMethod |
wrapCallTo(CMethod method,
boolean isSuper)
Returns a package-protected wrapper method for forwarding calls to the given method. |
CMethod |
wrapSuperCallTo(CMethod method)
Returns a wrapper method for forwarding qualified super method invocations from an inner class to the super class of this. |
| Methods inherited from class org.multijava.mjc.CMember |
access, deprecated, getCCompilationUnit, getField, getIdent, getJavaName, getMethod, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, host, ident, isAccessibleFrom, isDeprecated, isFinal, isLocalTo, isPrivate, isProtected, isPublic, isStatic, modifiers, owner, setModifiers |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.CMemberHost |
host, ident, isAccessibleFrom |
| Field Detail |
public static final CClass CLS_UNDEFINED
private final Main compiler
private final File sourceFile
private final String qualifiedName
private CClassType[] interfaces
private CClassType type
private CClassType[] innerClasses
private CClassType superClass
private HashSet visibleNestedTypes
private invariant (\forall Object o; visibleNestedTypes.contains(o); o instanceof CClassType && ((CClassType)o).isNestedType() );
private CFieldTable fields
protected CMethodSet methods
private CMethodSet protoMethods
private CMethodSet wrapperMethods
private CMethodSet fieldGetterMethods
private CMethodSet fieldSetterMethods
private CMethodSet redirectorMethods
private CMethod assertHelperMethod
private CAssertStaticInitMethod assertStaticInitMethod
private CAugmentationMap augMap
private static final TokenReference NO_TOKEN
private static int accessID
private int syntheticIndex
protected CClassType[] dispClassTypes
innerClasses, but is stored
separately here for use in generating MultiJava-specific
bytecode attributes.
private HashSet observerSet
#setCheckedMembers() is called. Lazily initialized.
private CTypeVariable[] typevariables
private boolean syntheticOuterThisInaccessible
| Constructor Detail |
public CClass(Main compiler,
MemberAccess access,
File sourceFile,
String ident,
String qualifiedName,
CClassType superClass,
boolean deprecated)
ensures owner != null ==> owner == host(); ensures owner == null ==> host().isCompilationUnit();
| Method Detail |
public void setCheckedInterfaces(CClassType[] interfaces)
requires interfaces != null && (\forall int i; 0 <= i && i < interfaces.length; interfaces[i].isChecked());
public final void setCheckedMembers(CField[] fields_A,
Hashtable fields_H,
CMethod[] protoMethods_A)
close method has been called.
requires (fields_A != null || fields_H != null); requires protoMethods_A != null; ensures observerSet != null ==> (\forall Observer o; observerSet.contains(o); (* calls o.signatureCompleted(this) *) );
public void close(CMethod[] methods_A,
CClassType[] dispClassTypes)
requires methods_A != null && dispClassTypes != null; assignable methods, innerClasses, this.dispClassTypes; ensures (* getInnerClasses() will return the union of \old(getInnerClasses()) and dispClassTypes *); // !FIXME! Why does JML checker require the signature // for setInnerClasses here even though there is no // overloading? callable getInnerClasses, setInnerClasses(CClassType[]);
public Main getCompiler()
public CClass getCClass()
getCClass in class CMemberpublic void setTypeVariables(CTypeVariable[] typevariables)
public CTypeVariable[] getTypeVariables()
public boolean isClass()
isClass in interface CMemberHostpublic boolean isNestedType()
isNestedType in interface CMemberHostpublic boolean isInnerClass()
isInnerClass in interface CMemberHostpublic boolean isCompilationUnit()
isCompilationUnit in interface CMemberHostpublic boolean isAbstract()
public abstract boolean isAnonymous()
public abstract boolean isMember()
public boolean isInterface()
public void syntheticOuterThisInaccessible()
public boolean hasSyntheticOuterThis()
public CClassType[] getInterfaces()
public String qualifiedName()
qualifiedName in class CMemberpublic String packageName()
CMemberHost
packageName in interface CMemberHostpublic CClass getSuperClass()
public String getGenericSignature()
public void setSuperClass(CClassType superClass)
public CClassType getType()
public File sourceFile()
protected CField getDeclaredField(String ident)
public Collection fields()
public int getFieldCount()
public CClassType[] getInnerClasses()
ensures \result != null;
public void setInnerClasses(CClassType[] inners)
public String toString()
toString in class Object
public int compareTo(Object o)
throws ClassCastException
also requires this.equals(o); ensures \result == 0; also requires !(o instanceof CClass); signals_only ClassCastException;
compareTo in interface Comparableo - an Object value to compare to this
ClassCastException - if o is incomparable to this
public boolean equals(Object o)
throws ClassCastException
this with the
fully qualified name of o.
equals in class ObjectClassCastException - if o is not an instance of CClass
also requires (o instanceof CClass); ensures this.qualifiedName().equals(((CClass)o).qualifiedName()); also requires !(o instanceof CClass); signals_only ClassCastException;
public int hashCode()
hashCode in class Objectpublic boolean descendsFrom(CClass maybeSuper)
descendsFrom in interface CMemberHostmaybeSuper - the potential superclass
public boolean descendsFrom(CClassType from,
CClassType[] actuals)
from - actuals - the actual type arguments of the type to be assignedpublic boolean nestedDescendsFrom(CClass maybeOuterSuper)
nestedDescendsFrom in interface CMemberHostmaybeOuterSuper - the potential superclass public boolean isDefinedInside(CMemberHost maybeOuter)
isDefinedInside in interface CMemberHostmaybeOuter - the host that this may be inside
public Collection directlyVisibleTypes()
protected CMethodSet methodsForCodeGen()
methodspublic CMethodSet methods()
methodspublic CMethodSet protoMethods()
protoMethodsprotected CFieldTable fieldsForCodeGen()
fieldspublic static String getNextAccessName()
public static void initSession()
public int getNextSyntheticIndex()
public void setAssertHelperMethod(CMethod m)
public void setAssertStaticInitMethod(CAssertStaticInitMethod m)
public boolean noAssertionsYet()
public boolean noPossiblyInnerAssertionsYet()
public CClass lookupClass(String name,
CContextType context)
throws UnpositionedError
name - the class name, without qualifierscontext - the referencing context, used for accessibility
checks
UnpositionedError - if search fails public CTypeVariable lookupTypeVariable(String ident)
public void checkInstantiation(CContextType context,
CClassType[] typeArguments)
throws UnpositionedError
UnpositionedError
public CClassType getSubstitution(CTypeVariable typevariable,
CClassType[][] sub)
public CClassType getSubstitution(CTypeVariable typevariable,
CClassType[] sub)
public CClassType getSuperSubstitution(CClassType supertype,
CTypeVariable typeVar)
private boolean ownerOf(CTypeVariable typevariable)
public CFieldAccessor lookupField(String name,
CExpressionContextType context)
throws UnpositionedError
name - the simple name of the fieldcontext - the context in which the reference appears, used
for accessibility checks
UnpositionedError - this error will be positioned soon
protected CField lookupFieldHelper(String name,
CExpressionContextType context)
throws UnpositionedError
name - the simple name of the fieldcontext - the context in which the reference appears, used
for accessibility checks
UnpositionedError - this error will be positioned soon
public CField lookupSuperField(String name,
CExpressionContextType context)
throws UnpositionedError
name - the simple name of the fieldcontext - the context in which the reference appears, used
for accessibility checks
UnpositionedError - this error will be positioned soon
protected boolean isFieldRedefined(String ident,
CExpressionContextType dummyContext)
throws UnpositionedError
ident - the name of the field
UnpositionedError
public void augmentWithMethod(CMethod m,
CCompilationUnitContextType c)
public CMethod lookupMethod(String name,
CType[] params,
CClassType[] args,
CContextType context)
throws UnpositionedError
name - method nameparams - method parameter typescontext - the context in which the method reference
should be resolved, used to identify the
external methods augmenting this class
UnpositionedError - if the result is ambiguous
public CMethodSet lookupMethodOrSet(String name,
CType[] params,
CClassType[] argss,
CContextType context)
throws UnpositionedError
name - method nameparams - method parameter typescontext - the context in which the method reference
should be resolved, used to identify the
external methods augmenting this class
UnpositionedError - if the result is ambiguous
public CMethodSet lookupMethodsSpecializedByMethod(CMethod specMethod,
CClassType[] args,
ArrayList needbridge,
CContextType context)
throws UnpositionedError
specMethod - the method that is doing the specializingcontext - the context in which the method reference
should be resolved, used to identify the
external methods augmenting this class
specMethod, such that
specMethod immediately specializes
each method in the set in the given context.
UnpositionedError - if the result is ambiguous
public CMethod lookupTopConcreteMethod(CMethod method,
CClassType[] args,
CContextType context)
throws UnpositionedError
method - the method from which to begin the searchcontext - the context in which the method reference
should be resolved. Used to identify the
external methods augmenting this class and
to determine the accessibility of the
methods found.
UnpositionedError - if the result is ambiguous
public CMethodSet lookupMSAMethod(CMethod top,
CType[] argTuple,
CClassType[] argss,
CContextType context)
throws UnpositionedError
top - the method that denotes the generic functionargTuple - the tuple of argument typescontext - the context in which the method reference
should be resolved, used to identify the
external methods augmenting this class
UnpositionedError - if the result is ambiguous and it
can't be resolved through external means (e.g. via glue
methods)
public CMethodSet lookupAllMethods(CMethod m,
CClassType[] args,
CContextType context)
throws UnpositionedError
m - a method in the generic function being gatheredcontext - the context in which the method reference
should be resolved, used to identify the
external methods augmenting this class
UnpositionedError - if there was an error
public CMethod lookupOverloadedMethod(CMethod overloader,
CClassType[] args,
CContextType context)
throws UnpositionedError
overloader - the method to be checkedcontext - the context in which the method is declared
UnpositionedError
protected void accumMostSpecificMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args,
CContextType context)
throws UnpositionedError
name declared in the type represented by this,
or added to the type by external methods, using the
strategy actor. Only searches supertypes if no
matches have been accumulated while searching the type
represented by this.
name - method nameactor - the strategy for selecting methodsaccum - a method set in which to accumulate the
resultscontext - the context in which the method reference
appears, used for resolving augmenting
UnpositionedError - at the discretion of the strategy
actor
protected void accumLocalInternalMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args)
throws UnpositionedError
name declared in the type represented by this,
using the strategy actor. Searches neither
external methods nor supertypes.
name - method nameactor - the strategy for selecting methodsaccum - a method set in which to accumulate the
results
UnpositionedError - at the discretion of the strategy
actor
protected final void accumLocalExtAndInheritedMethods(String name,
CClass.NoDupStrategy actor,
CMethodSet accum,
CClassType[] args,
CContextType context)
throws UnpositionedError
name declared in the type represented by this,
or added to the type by external methods, using the
strategy actor. Always searches supertypes.
name - method nameactor - the strategy for selecting methodsaccum - a method set in which to accumulate the
resultscontext - the context in which the method reference
appears, used for resolving augmenting
UnpositionedError - at the discretion of the strategy
actor public CMethodSet.MethodArgsPair[] getAbstractMethods()
public CMethodSet.MethodArgsPair[] getInterfaceMethods()
public void addBridgeMethod(CMethod me,
CContextType context)
throws UnpositionedError
UnpositionedError
public void checkBridgeMethod(CMethod me,
CClassType[] args,
CContextType context)
throws UnpositionedError
UnpositionedErrorpublic void getAllMethods(ArrayList v)
v - mutated to include the CMethods for all
methods in this class and all direct ancestorspublic ArrayList getAllInheritedMethods()
public void getAllInheritableMethods(ArrayList v)
v, if
methods of the same signature are not already contained in
v.
public String getUniverseVersion()
public void collectAbstractMethods(ArrayList v,
CClassType[] args)
v - mutated to include the CMethods for all abstract
methods in this class and all direct ancestors
public void collectInterfaceMethods(ArrayList v,
CClassType[] args)
v - mutated to include the CMethods for all interface
methods in this class and all its ancestorsprotected static String getIdentFrom(String qualifiedName)
public boolean hasProtectedVisibilityIn(CMemberHost from)
hasProtectedVisibilityIn in class CMemberfrom - the host that wants access
public void addField(CSourceField field)
public void registerNestedType(CType type)
requires type instanceof CClassType && type.isNestedType();
protected boolean memberNeedsPrivilegedAccess(CMember m,
CContextType context)
m - the member to checkcontext - the context of the method access
public CFieldAccessorMethod getterOrSetterMethodFor(CField field,
CExpressionContextType context)
field from context context. Called
when a legal access to the field is made from a context that
does not have access to the field in the JVM, i.e., an inner or
outer class accessing a private field or a superclass field.
private CFieldAccessorMethod findAccessorMethod(CField f,
CMethodSet ms)
public CFieldAccessorMethod findGetterMethod(CField f)
public CFieldAccessorMethod findOrCreateGetterMethod(CField f)
public CFieldAccessorMethod findOrCreateSetterMethod(CField f)
public CMethod wrapSuperCallTo(CMethod method)
throws UnpositionedError
requires this.getSuperClass() == method.owner();
UnpositionedError
private CMethod wrapCallTo(CMethod method,
boolean isSuper)
throws UnpositionedError
method. These denials stem from the virtual
machine not understanding inner classes. For example, private
methods of an outer class do not appear to be accessible from
an inner class in the JVM.
UnpositionedErrorpublic void addRedirector(CSourceRedirectorMethod redir)
public void genClassFile(Destination dest)
throws IOException,
ClassFileFormatException
dest - the destination directory of the class file
IOException
ClassFileFormatExceptiongenInterfaces(),
genMethods(),
genFields(),
genInners()
protected ClassInfo createClassInfo(long modifiers,
String superClass,
File sourceFile)
ClassInfo. This is a
factory method for subclasses to generate a refined ClassInfo
object.
protected ClassConstant[] genInterfaces()
protected MethodInfo[] genMethods()
protected FieldInfo[] genFields()
protected final AttributeList genCustomAttributes()
protected void appendCustomAttributes(AttributeList accum)
accum.
protected void genGenericFunctions(ArrayList accum)
protected InnerClassInfo[] genInners()
protected CClassType[] innerClassesForAttribute()
public InnerClassInfo genInnerInfo()
requires isNestedType();
public CType[] genConstructorArray(CType[] params)
requires (* this represents an anonymous class or a local class declaration *); requires (* params is the parameter array for a constructor of this *); ensures (* params includes the types of any outer local variables required to instantiate this *);
public void genSyntheticParams(CodeSequence code)
code - the code sequence being generated
public void genSyntheticParamsForExplicitThis(CodeSequence code,
CMethod constructor)
code - the code sequence being generated constructor - the signature of the calling constructor
public JExpression[] getSyntheticParamsForExplicitSuper(CSourceClass callerClass,
CMethod caller)
caller of the class
callerClass to add the outer local variable values
required by this to the stack.
requires callerClass.descendsFrom(this); requires caller.isConstructor(); ensures \result != null;
public void rmjAnnotate(RMJAnnotation rmjInfo)
public void register(CClass.Observer o)
#setCheckedMembers() is called.
public boolean isGenericClass()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||