|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.util.Utils | +--at.dms.kjc.CMember | +--at.dms.kjc.CClass
This class represents the exported members of a class. (inner classes, methods and fields)
Field Summary | |
protected static CClass |
CLS_UNDEFINED
Special constant that represents an "undefined" class that is used when some class object is needed as a placeholder to generate better error messages. |
Fields inherited from class at.dms.kjc.CMember |
ACCESSOR_PREFIX |
Fields inherited from class at.dms.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
Fields inherited from interface at.dms.kjc.Constants |
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VOID |
Constructor Summary | |
CClass(Compiler compiler,
CClass owner,
java.lang.String sourceFile,
int modifiers,
java.lang.String ident,
java.lang.String qualifiedName,
CClassType superClass,
boolean deprecated)
Constructs a class export from file. |
Method Summary | |
void |
addField(CSourceField field)
Add a field. |
void |
addInnerClass(CClassType newInner)
Add synthetic inner class. |
void |
addMethod(CSourceMethod newMethod)
Add synthetic method class. |
void |
close(CClassType[] interfaces,
CField[] fields,
CMethod[] methods)
Ends the definition of this class. |
java.util.List |
collectAbstractMethods()
collectAbstractMethods |
void |
collectInterfaceMethods(java.util.List list)
Collects all methods in this type that are declared in an interface. |
boolean |
descendsFrom(CClass from)
descendsFrom. |
void |
genClassFile(java.lang.String destination)
Generate the code in a class file. |
CType[] |
genConstructorArray(CType[] params)
Add synthetic parameters to method def. |
void |
genSyntheticParams(CodeSequence code,
JExpression explicitThis)
Add synthetic parameters to method call. |
void |
genSyntheticParamsFromExplicitSuper(JExpression[] params,
CodeSequence code)
Add synthetic parameters to method call. |
CMethod[] |
getAbstractMethods()
Returns a list of abstract methods |
CClass |
getCClass()
Returns this . |
Compiler |
getCompiler()
Returns the compiler. |
CField |
getField(java.lang.String ident)
Returns the named field. |
int |
getFieldCount()
Returns the number of fields in this class. |
protected static java.lang.String |
getIdent(java.lang.String qualifiedName)
Returns the unqualified, package less and outerclass-name-less name of this class. |
CClassType[] |
getInnerClasses()
Returns the InnerClasses of this clas. |
CMethod[] |
getInterfaceMethods()
Returns a list of interface methods |
int |
getOuterLocalsSize()
Returns the size of the outer-local variables in the variable table. |
java.lang.String |
getPackage()
Returns the name of the package of the package this class belongs to. |
java.lang.String |
getQualifiedName()
Returns the full name of this class. |
java.lang.String |
getSourceFile()
Returns the source file of this class. |
CClass |
getSuperClass()
Returns the super class of this class. |
CClassType |
getType()
Returns the type of this class. |
boolean |
hasOuterThis()
|
boolean |
isAbstract()
|
boolean |
isAccessible(CClass from)
Checks if this class is accessible from another class. |
boolean |
isAnonymous()
|
boolean |
isDefinedInside(CClass outer)
Returns true iff this class is defined inside the specified class |
boolean |
isInnerClass()
|
boolean |
isInterface()
Returns true if this class is an interface. |
CField |
lookupField(java.lang.String name)
Searches a field in current class and parent hierarchy as needed. |
CClass |
lookupMemberClass(java.lang.String name)
Look up member classes of this class, or of superclasses or interfaces. |
CMethod |
lookupMethod(CClass caller,
java.lang.String name,
CType[] params)
Searches for an accessible, matching method with the provided type parameters. |
CField |
lookupSuperField(java.lang.String name)
Searches a field in current class and parent hierarchy as needed. |
CMethod |
lookupSuperMethod(CClass caller,
java.lang.String name,
CType[] params)
Searches for a matching method with the provided type parameters in the superclass and/or interfaces of this type. |
void |
setHasOuterThis(boolean hasOuterThis)
Sets hasOuterThis. |
void |
setInnerClasses(CClassType[] inners)
End of first pass, we need inner classes/interfaces. |
void |
setSuperClass(CClassType superClass)
Sets the super class of this class. |
Methods inherited from class at.dms.kjc.CMember |
getField, getIdent, getJavaName, getMethod, getModifiers, getOwner, getPrefixName, isDeprecated, isFinal, isPrivate, isProtected, isPublic, isStatic, isSynthetic, mustUseAccessorMethod, setModifiers, setSynthetic |
Methods inherited from class at.dms.util.Utils |
assert, assert, fail, fail, hasFlag, hasMoreThanOneFlag, hasOtherFlags, splitQualifiedName, splitQualifiedName, vectorToArray, vectorToIntArray |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static CClass CLS_UNDEFINED
Constructor Detail |
public CClass(Compiler compiler, CClass owner, java.lang.String sourceFile, int modifiers, java.lang.String ident, java.lang.String qualifiedName, CClassType superClass, boolean deprecated)
Method Detail |
public void close(CClassType[] interfaces, CField[] fields, CMethod[] methods)
public Compiler getCompiler()
public CClass getCClass()
this
.getCClass
in class CMember
this
.public int getOuterLocalsSize()
public boolean isInnerClass()
public boolean isAbstract()
public boolean isAnonymous()
public boolean hasOuterThis()
public void setHasOuterThis(boolean hasOuterThis)
public boolean isInterface()
public java.lang.String getQualifiedName()
getQualifiedName
in class CMember
public java.lang.String getPackage()
public CClass getSuperClass()
public void setSuperClass(CClassType superClass)
public CClassType getType()
public java.lang.String getSourceFile()
public CField getField(java.lang.String ident)
ident
- The name of the field to get.ident
.public int getFieldCount()
public CClassType[] getInnerClasses()
public void setInnerClasses(CClassType[] inners)
public void addMethod(CSourceMethod newMethod)
public void addInnerClass(CClassType newInner)
public boolean descendsFrom(CClass from)
from
- an other CClasspublic boolean isDefinedInside(CClass outer)
outer
- another classpublic CClass lookupMemberClass(java.lang.String name) throws UnpositionedError
name
- A TypeName (6.5.2)public CField lookupField(java.lang.String name) throws UnpositionedError
name
- The simple name of the field.UnpositionedError
- This error will be positioned soon.public CField lookupSuperField(java.lang.String name) throws UnpositionedError
name
- the simple name of the fieldUnpositionedError
- this error will be positioned soonpublic CMethod lookupMethod(CClass caller, java.lang.String name, CType[] params) throws UnpositionedError
caller
- The class of the method call expression, which is used to determine
whether a matching method is accessible. If it is not accessible,
the search goes on for another matching method. This parameter may
be null
to look up any matching method, regardless of
accessibility.name
- Method name.params
- Method parameters.UnpositionedError
- This error will be positioned soon.public CMethod lookupSuperMethod(CClass caller, java.lang.String name, CType[] params) throws UnpositionedError
caller
- The class of the method call expression, which is used to determine
whether a matching method is accessible. If it is not accessible,
the search goes on for another matching method. This parameter may
be null
to look up any matching method, regardless of
accessibility.name
- Method name.params
- Method parameters.UnpositionedError
- This error will be positioned soon.public CMethod[] getAbstractMethods()
public CMethod[] getInterfaceMethods()
public java.util.List collectAbstractMethods()
public void collectInterfaceMethods(java.util.List list)
list
- Where the collected methods are placed.protected static java.lang.String getIdent(java.lang.String qualifiedName)
public boolean isAccessible(CClass from)
isAccessible
in class CMember
from
.public void addField(CSourceField field)
public void genClassFile(java.lang.String destination) throws java.io.IOException, ClassFileFormatException
destination
- the root directory of the class hierarchy.public CType[] genConstructorArray(CType[] params)
public void genSyntheticParams(CodeSequence code, JExpression explicitThis)
public void genSyntheticParamsFromExplicitSuper(JExpression[] params, CodeSequence code)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |