Package javassist.bytecode.stackmap
Class TypeData
- java.lang.Object
-
- javassist.bytecode.stackmap.TypeData
-
- Direct Known Subclasses:
TypeData.AbsTypeVar
,TypeData.BasicType
,TypeData.ClassName
public abstract class TypeData extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeData.AbsTypeVar
static class
TypeData.ArrayElement
static class
TypeData.ArrayType
protected static class
TypeData.BasicType
Primitive types.static class
TypeData.ClassName
Type data for OBJECT.static class
TypeData.NullType
Type data for NULL or OBJECT.static class
TypeData.TypeVar
static class
TypeData.UninitData
Type data for UNINIT.static class
TypeData.UninitThis
static class
TypeData.UninitTypeVar
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeData()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
aastore(TypeData array, TypeData value, ClassPool cp)
static CtClass
commonSuperClass(CtClass one, CtClass two)
Finds the most specific common super class of the given classes.static CtClass
commonSuperClassEx(CtClass one, CtClass two)
Finds the most specific common super class of the given classes by considering array types.void
constructorCalled(int offset)
int
dfs(java.util.ArrayList order, int index, ClassPool cp)
Depth-first search by Tarjan's algorithmabstract boolean
eq(TypeData d)
(package private) static boolean
eq(CtClass one, CtClass two)
abstract TypeData
getArrayType(int dim)
abstract java.lang.String
getName()
abstract int
getTypeData(ConstPool cp)
abstract int
getTypeTag()
abstract boolean
is2WordType()
abstract TypeData.BasicType
isBasicType()
If the type is a basic type, this method normalizes the type and returns a BasicType object.boolean
isNullType()
Returns false if getName() returns a valid type name.boolean
isUninit()
TypeData
join()
static TypeData[]
make(int size)
abstract void
setType(java.lang.String s, ClassPool cp)
private static void
setType(TypeData td, java.lang.String className, ClassPool cp)
Sets the type name of this object type.java.lang.String
toString()
(package private) abstract java.lang.String
toString2(java.util.HashSet set)
protected TypeData.TypeVar
toTypeVar(int dim)
Returns this if it is a TypeVar or a TypeVar that this type depends on.
-
-
-
Method Detail
-
make
public static TypeData[] make(int size)
-
setType
private static void setType(TypeData td, java.lang.String className, ClassPool cp) throws BadBytecode
Sets the type name of this object type. If the given type name is a subclass of the current type name, then the given name becomes the name of this object type.- Parameters:
className
- dot-separated name unless the type is an array type.- Throws:
BadBytecode
-
getTypeTag
public abstract int getTypeTag()
-
getTypeData
public abstract int getTypeData(ConstPool cp)
-
join
public TypeData join()
-
isBasicType
public abstract TypeData.BasicType isBasicType()
If the type is a basic type, this method normalizes the type and returns a BasicType object. Otherwise, it returns null.
-
is2WordType
public abstract boolean is2WordType()
-
isNullType
public boolean isNullType()
Returns false if getName() returns a valid type name.
-
isUninit
public boolean isUninit()
-
eq
public abstract boolean eq(TypeData d)
-
getName
public abstract java.lang.String getName()
-
setType
public abstract void setType(java.lang.String s, ClassPool cp) throws BadBytecode
- Throws:
BadBytecode
-
getArrayType
public abstract TypeData getArrayType(int dim) throws NotFoundException
- Parameters:
dim
- array dimension. It may be negative.- Throws:
NotFoundException
-
dfs
public int dfs(java.util.ArrayList order, int index, ClassPool cp) throws NotFoundException
Depth-first search by Tarjan's algorithm- Parameters:
order
- a node stack in the order in which nodes are visited.index
- the index used by the algorithm.- Throws:
NotFoundException
-
toTypeVar
protected TypeData.TypeVar toTypeVar(int dim)
Returns this if it is a TypeVar or a TypeVar that this type depends on. Otherwise, this method returns null. It is used by dfs().- Parameters:
dim
- dimension
-
constructorCalled
public void constructorCalled(int offset)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString2
abstract java.lang.String toString2(java.util.HashSet set)
-
commonSuperClassEx
public static CtClass commonSuperClassEx(CtClass one, CtClass two) throws NotFoundException
Finds the most specific common super class of the given classes by considering array types.- Throws:
NotFoundException
-
commonSuperClass
public static CtClass commonSuperClass(CtClass one, CtClass two) throws NotFoundException
Finds the most specific common super class of the given classes. This method is a copy from javassist.bytecode.analysis.Type.- Throws:
NotFoundException
-
aastore
public static void aastore(TypeData array, TypeData value, ClassPool cp) throws BadBytecode
- Throws:
BadBytecode
-
-