Package com.ibm.wala.cast.loader
Class AstClass
- java.lang.Object
-
- com.ibm.wala.cast.loader.AstClass
-
- All Implemented Interfaces:
IClass,IClassHierarchyDweller,ClassConstants
- Direct Known Subclasses:
AstDynamicPropertyClass
public abstract class AstClass extends Object implements IClass, ClassConstants
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Atom,IField>declaredFieldsprotected Map<Selector,IMethod>declaredMethods-
Fields inherited from interface com.ibm.wala.shrikeCT.ClassConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_Class, CONSTANT_Double, CONSTANT_FieldRef, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodRef, CONSTANT_InvokeDynamic, CONSTANT_Long, CONSTANT_MethodHandle, CONSTANT_MethodRef, CONSTANT_MethodType, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8, MAGIC, REF_getField, REF_getStatic, REF_invokeInterface, REF_invokeSpecial, REF_invokeStatic, REF_invokeVirtual, REF_newInvokeSpecial, REF_putField, REF_putStatic
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAstClass(CAstSourcePositionMap.Position sourcePosition, TypeName typeName, IClassLoader loader, short modifiers, Map<Atom,IField> declaredFields, Map<Selector,IMethod> declaredMethods)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Collection<IField>getAllFields()Compute the instance and static fields declared by this class or any of its superclasses.Collection<IClass>getAllImplementedInterfaces()Collection<IField>getAllInstanceFields()Compute the instance fields declared by this class or any of its superclasses.Collection<IMethod>getAllMethods()Compute the methods declared by this class or any of its superclasses.Collection<IField>getAllStaticFields()Compute the static fields declared by this class or any of its superclasses.IMethodgetClassInitializer()IClassLoadergetClassLoader()Return the object that represents the defining class loader for this class.Collection<IField>getDeclaredInstanceFields()Compute the instance fields declared by this class.Collection<IMethod>getDeclaredMethods()Collection<IField>getDeclaredStaticFields()abstract Collection<IClass>getDirectInterfaces()IFieldgetField(Atom name)Finds a field.IFieldgetField(Atom name, TypeName type)Finds a field, given a name and a type.IMethodgetMethod(Selector selector)Finds method matching signature.intgetModifiers()Return the integer that encodes the class's modifiers, as defined by the JVM specificationTypeNamegetName()TypeReferencegetReference()ReadergetSource()StringgetSourceFileName()CAstSourcePositionMap.PositiongetSourcePosition()URLgetSourceURL()abstract IClassgetSuperclass()booleanisAbstract()booleanisArrayClass()booleanisInterface()Is this class a Java interface?booleanisPrivate()booleanisPublic()booleanisReferenceType()Does 'this' refer to a reference type? If not, then it refers to a primitive type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.classLoader.IClass
getAnnotations
-
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
-
-
-
-
Constructor Detail
-
AstClass
protected AstClass(CAstSourcePositionMap.Position sourcePosition, TypeName typeName, IClassLoader loader, short modifiers, Map<Atom,IField> declaredFields, Map<Selector,IMethod> declaredMethods)
-
-
Method Detail
-
isInterface
public boolean isInterface()
Description copied from interface:IClassIs this class a Java interface?- Specified by:
isInterfacein interfaceIClass
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceIClass- Returns:
- true iff this class is abstract
-
isPublic
public boolean isPublic()
-
isPrivate
public boolean isPrivate()
-
isReferenceType
public boolean isReferenceType()
Description copied from interface:IClassDoes 'this' refer to a reference type? If not, then it refers to a primitive type.- Specified by:
isReferenceTypein interfaceIClass
-
isArrayClass
public boolean isArrayClass()
- Specified by:
isArrayClassin interfaceIClass- Returns:
- true iff the class is an array class.
-
getModifiers
public int getModifiers()
Description copied from interface:IClassReturn the integer that encodes the class's modifiers, as defined by the JVM specification- Specified by:
getModifiersin interfaceIClass- Returns:
- the integer that encodes the class's modifiers, as defined by the JVM specification
-
getSourcePosition
public CAstSourcePositionMap.Position getSourcePosition()
-
getSourceURL
public URL getSourceURL()
-
getSourceFileName
public String getSourceFileName()
- Specified by:
getSourceFileNamein interfaceIClass- Returns:
- String holding the name of the source file that defined this class, or null if none found
-
getSource
public Reader getSource()
-
getName
public TypeName getName()
-
getReference
public TypeReference getReference()
- Specified by:
getReferencein interfaceIClass- Returns:
- canonical TypeReference corresponding to this class
-
getClassLoader
public IClassLoader getClassLoader()
Description copied from interface:IClassReturn the object that represents the defining class loader for this class.- Specified by:
getClassLoaderin interfaceIClass- Returns:
- the object that represents the defining class loader for this class.
-
getSuperclass
public abstract IClass getSuperclass()
- Specified by:
getSuperclassin interfaceIClass- Returns:
- the superclass, or null if java.lang.Object
-
getDirectInterfaces
public abstract Collection<IClass> getDirectInterfaces()
- Specified by:
getDirectInterfacesin interfaceIClass- Returns:
- Collection of (IClass) interfaces this class directly implements. If this class is an interface, returns the interfaces it immediately extends.
-
getAllImplementedInterfaces
public Collection<IClass> getAllImplementedInterfaces()
- Specified by:
getAllImplementedInterfacesin interfaceIClass- Returns:
- Collection of (IClass) interfaces this class implements, including all ancestors of interfaces immediately implemented. If this class is an interface, it returns all super-interfaces.
-
getClassInitializer
public IMethod getClassInitializer()
- Specified by:
getClassInitializerin interfaceIClass- Returns:
- the method that is this class's initializer, or null if none
-
getMethod
public IMethod getMethod(Selector selector)
Description copied from interface:IClassFinds method matching signature. Delegates to superclass if not found.
-
getField
public IField getField(Atom name)
Description copied from interface:IClassFinds a field.
-
getField
public IField getField(Atom name, TypeName type)
Description copied from interface:IClassFinds a field, given a name and a type. Returnsnullif not found.
-
getDeclaredMethods
public Collection<IMethod> getDeclaredMethods()
- Specified by:
getDeclaredMethodsin interfaceIClass- Returns:
- an Iterator of the IMethods declared by this class.
-
getDeclaredInstanceFields
public Collection<IField> getDeclaredInstanceFields()
Description copied from interface:IClassCompute the instance fields declared by this class.- Specified by:
getDeclaredInstanceFieldsin interfaceIClass- Returns:
- Collection of IFields
-
getDeclaredStaticFields
public Collection<IField> getDeclaredStaticFields()
- Specified by:
getDeclaredStaticFieldsin interfaceIClass- Returns:
- Collection of IField
-
getAllInstanceFields
public Collection<IField> getAllInstanceFields()
Description copied from interface:IClassCompute the instance fields declared by this class or any of its superclasses.- Specified by:
getAllInstanceFieldsin interfaceIClass
-
getAllStaticFields
public Collection<IField> getAllStaticFields()
Description copied from interface:IClassCompute the static fields declared by this class or any of its superclasses.- Specified by:
getAllStaticFieldsin interfaceIClass
-
getAllFields
public Collection<IField> getAllFields()
Description copied from interface:IClassCompute the instance and static fields declared by this class or any of its superclasses.- Specified by:
getAllFieldsin interfaceIClass
-
getAllMethods
public Collection<IMethod> getAllMethods()
Description copied from interface:IClassCompute the methods declared by this class or any of its superclasses.- Specified by:
getAllMethodsin interfaceIClass
-
-