Package pascal.taie.language.classes
Class JClass
java.lang.Object
pascal.taie.util.AbstractResultHolder
pascal.taie.language.classes.JClass
- All Implemented Interfaces:
Serializable
,Annotated
,Indexable
,ResultHolder
Represents classes in the program. Each instance contains various
information of a class, including class name, modifiers, declared
methods and fields, etc.
- See Also:
-
Constructor Summary
ConstructorDescriptionJClass
(JClassLoader loader, String name) JClass
(JClassLoader loader, String name, String moduleName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPhantomField
(String fieldName, Type fieldType, JField field) void
build
(JClassBuilder builder) This method should be called after creating this instance.getAnnotation
(String annotationType) getDeclaredField
(String fieldName) Attempts to retrieve the field with the given name.getDeclaredField
(String fieldName, String typeName) Attempts to retrieve the field with given name and type.getDeclaredField
(String fieldName, Type fieldType) Attempts to retrieve the field with given name and type.getDeclaredMethod
(String methodName) Attempts to retrieve the method with the given name.getDeclaredMethod
(Subsignature subsignature) Attempts to retrieve the method with given subsignature.int
getIndex()
getName()
getPhantomField
(String fieldName, Type fieldType) getType()
boolean
hasAnnotation
(String annotationType) boolean
boolean
boolean
boolean
isFinal()
boolean
boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
boolean
boolean
toString()
Methods inherited from class pascal.taie.util.AbstractResultHolder
clearAll, clearResult, getKeys, getResult, getResult, getResult, hasResult, storeResult
-
Constructor Details
-
JClass
-
JClass
-
-
Method Details
-
build
This method should be called after creating this instance. -
getClassLoader
-
getName
-
getModuleName
-
getSimpleName
-
getType
-
getGSignature
-
getModifiers
-
isPublic
public boolean isPublic() -
isProtected
public boolean isProtected() -
isPrivate
public boolean isPrivate() -
isInterface
public boolean isInterface() -
isAbstract
public boolean isAbstract() -
isStatic
public boolean isStatic() -
isFinal
public boolean isFinal() -
isStrictFP
public boolean isStrictFP() -
isSynthetic
public boolean isSynthetic() -
getSuperClass
-
getInterfaces
-
hasOuterClass
public boolean hasOuterClass() -
getOuterClass
-
getDeclaredFields
-
getDeclaredField
Attempts to retrieve the field with the given name.- Throws:
AmbiguousMemberException
- if this class has multiple fields with the given name.
-
getDeclaredField
Attempts to retrieve the field with given name and type.- Returns:
- the target field with given name and type,
or
null
if such field does not exist.
-
getDeclaredField
Attempts to retrieve the field with given name and type.- Parameters:
fieldName
- name of the fieldtypeName
- name of the field type- Returns:
- the target field with given name and type,
or
null
if such field does not exist.
-
getDeclaredMethods
-
getDeclaredMethod
Attempts to retrieve the method with the given name.- Throws:
AmbiguousMemberException
- if this class has multiple methods with the given name.
-
getDeclaredMethod
Attempts to retrieve the method with given subsignature.- Parameters:
subsignature
- subsignature of the method- Returns:
- the target method with given subsignature,
or
null
if such method does not exist.
-
getClinit
-
hasAnnotation
- Specified by:
hasAnnotation
in interfaceAnnotated
- Returns:
true
if this annotated object has an annotation ofannotationType
.
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotated
- Returns:
- the
Annotation
of typeannotationType
if it is present in this annotated; otherwise,null
is returned.
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotated
- Returns:
- all annotations in this annotated object.
-
isApplication
public boolean isApplication() -
isPhantom
public boolean isPhantom() -
getPhantomField
-
addPhantomField
-
getIndex
public int getIndex() -
toString
-