|
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.CType
org.multijava.mjc.CClassType
org.multijava.mjc.CClassNameType
This class represents a class type when the class name first appears as a forward reference. The internal structure must be filled in later when enough information is available to find the corresponding class declaration.
CType| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CType |
CType.MethodSignature, CType.MethodSignatureParser, CType.StringBuffers, CType.TupleCollection |
| Field Summary | |
private String |
ident
|
(package private) static boolean |
ignoredJavaAlready
|
private boolean |
isRawType
|
protected String |
maybeQualifiedName
|
private String |
originalQualifiedName
|
| Fields inherited from class org.multijava.mjc.CClassType |
arguments, EMPTY, EMPTY_ARG, index, universe |
| Fields inherited from class org.multijava.mjc.CType |
instance, isMethodTypeVariable, isTypeVariable, type |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
(package private) |
CClassNameType(String maybeQualifiedName)
Construct a class type. |
(package private) |
CClassNameType(String maybeQualifiedName,
CUniverse univ,
CClassType[][] arguments)
Construct a class type. |
| Method Summary | |
void |
appendGenericSignature(FastStringBuffer buff)
|
boolean |
changesByErasure()
Returns whether this type differs from its type erasure (JLS3 4.6). |
protected void |
checkInstantiation(CContextType context)
Checks the instantiation of a generic type by performing the following checks on this type's CClass and all its owners:
Type check the type variables of the class. |
private void |
checkPossibleRawType(CContextType context)
Performs the necessary type checking for a raw type. |
CType |
checkType(CContextType context)
Checks that this type is valid, throwing an exception if it is not. |
private static void |
checkTypeArguments(CTypeVariable[] typeVariables,
CClassType[] typeArguments,
CContextType context)
Performs the type checking on all the typeArguments (the
type checked versions are re-stored into the same array) and checks
whether the typeArguments are valid for the given
typeVariables. |
(package private) void |
forgetChecking()
|
CClassType[][] |
getAllArguments()
return the arguments of this type |
CClassType[] |
getArguments()
|
CType |
getCapture(CContextType context)
Returns the result of applying capture conversion (JLS3 5.1.10) to this type. |
CClass |
getCClass()
Returns the class object associated with this type. |
CType |
getErasure()
|
String |
getIdent()
|
boolean |
isGenericType()
check to see whether this class type is Generic or Not |
boolean |
isMethodTypeVariable()
|
boolean |
isRawType()
Returns whether this is a raw type (JLS3 4.8). |
boolean |
isReifiableType()
Returns whether this is a reifiable type (JLS3 4.7). |
boolean |
isTypeVariable()
Check if a type is a type variable |
String |
originalQualifiedName()
|
String |
printArgs()
Print the type arguments of this class type |
String |
qualifiedName()
|
protected void |
registerAsVisibleIn(CContextType context)
Registers the type represented by this as being visible in the given context. |
void |
setAllArguments(CClassType[][] args)
|
protected void |
setClass(CClass clazz)
Sets the CClass singleton that goes with this class type and registers that this name type has been checked. |
protected void |
setClassFromNameOrDieTrying()
Attempts to associate this type with a CClass
singleton having the name given by maybeQualifiedName. |
void |
setIdent(String id)
|
String |
toString()
Transforms this type to a string |
| 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 |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
static boolean ignoredJavaAlready
private String ident
protected String maybeQualifiedName
private final String originalQualifiedName
private boolean isRawType
| Constructor Detail |
CClassNameType(String maybeQualifiedName)
CClassNameType(String maybeQualifiedName,
CUniverse univ,
CClassType[][] arguments)
maybeQualifiedName - the name of the class, perhaps just
partially qualified or not qualified at all, but with '/' not
'.' separators if any separators are presentCClassType#lookup(String,boolean)| Method Detail |
public String toString()
toString in class CClassTypepublic String printArgs()
printArgs in class CClassTypepublic void appendGenericSignature(FastStringBuffer buff)
appendGenericSignature in interface CTypeSignatureAppenderappendGenericSignature in class CTypepublic String qualifiedName()
qualifiedName in class CClassTypepublic String originalQualifiedName()
originalQualifiedName in class CClassTypepublic CClass getCClass()
getCClass in class CClassType
public CType checkType(CContextType context)
throws UnpositionedError
checkType in class CClassTypecontext - the context in which this type was
declared
UnpositionedError - this unpositioned error
should be positioned
by the calling node of
the AST, typically by
calling the
addPosition method of
UnpositionedError
protected void checkInstantiation(CContextType context)
throws UnpositionedError
CClass and all its owners:
context - The type checking context.
UnpositionedError - if some error occurs during type checking.
private void checkPossibleRawType(CContextType context)
throws UnpositionedError
isRawType() correctly
returns whether this is a raw type or not.
context - The type checking context.
UnpositionedError - if some error occurs during type checking.
private static void checkTypeArguments(CTypeVariable[] typeVariables,
CClassType[] typeArguments,
CContextType context)
throws UnpositionedError
typeArguments (the
type checked versions are re-stored into the same array) and checks
whether the typeArguments are valid for the given
typeVariables.
typeVariables - The formal type variables.typeArguments - The actual type arguments for the type variables.context - The type checking context.
UnpositionedError - if some error occurs during type checking.
protected final void registerAsVisibleIn(CContextType context)
throws UnpositionedError
requires maybeQualifiedName == null;
UnpositionedError
protected void setClassFromNameOrDieTrying()
throws UnpositionedError
CClass
singleton having the name given by maybeQualifiedName.
Called after all other options for finding the class have been
exhausted.
UnpositionedError - if singleton cannot be found maybeQualifiedName,
CTopLevel.loadClass(String)protected void setClass(CClass clazz)
setClass in class CClassTypeclazz - the CClass singleton that goes with this class type void forgetChecking()
public CType getErasure()
getErasure in class CClassType
public CType getCapture(CContextType context)
throws UnpositionedError
CTypeNote that capture conversion only changes a parametrized type with at least one wildcard in its type arguments.
getCapture in class CTypeUnpositionedErrorpublic boolean isGenericType()
isGenericType in class CTypepublic boolean isRawType()
CType
isRawType in class CTypepublic boolean isReifiableType()
CType
isReifiableType in class CTypepublic boolean changesByErasure()
CType
changesByErasure in class CTypepublic CClassType[] getArguments()
getArguments in class CClassTypepublic CClassType[][] getAllArguments()
CClassType
getAllArguments in class CClassTypepublic void setAllArguments(CClassType[][] args)
setAllArguments in class CClassTypepublic boolean isTypeVariable()
CType
isTypeVariable in class CTypepublic boolean isMethodTypeVariable()
isMethodTypeVariable in class CTypepublic String getIdent()
getIdent in class CTypepublic void setIdent(String id)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||