Package com.ibm.wala.classLoader
Class ArrayClass
- java.lang.Object
-
- com.ibm.wala.classLoader.ArrayClass
-
-
Field Summary
-
Fields inherited from interface com.ibm.wala.shrikeBT.Constants
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, indexedTypes, indexedTypes_T, MAYBE, NO, OP_aaload, OP_aastore, OP_aconst_null, OP_aload, OP_aload_0, OP_aload_1, OP_aload_2, OP_aload_3, OP_anewarray, OP_areturn, OP_arraylength, OP_astore, OP_astore_0, OP_astore_1, OP_astore_2, OP_astore_3, OP_athrow, OP_baload, OP_bastore, OP_bipush, OP_caload, OP_castore, OP_checkcast, OP_d2f, OP_d2i, OP_d2l, OP_dadd, OP_daload, OP_dastore, OP_dcmpg, OP_dcmpl, OP_dconst_0, OP_dconst_1, OP_ddiv, OP_dload, OP_dload_0, OP_dload_1, OP_dload_2, OP_dload_3, OP_dmul, OP_dneg, OP_drem, OP_dreturn, OP_dstore, OP_dstore_0, OP_dstore_1, OP_dstore_2, OP_dstore_3, OP_dsub, OP_dup, OP_dup_x1, OP_dup_x2, OP_dup2, OP_dup2_x1, OP_dup2_x2, OP_f2d, OP_f2i, OP_f2l, OP_fadd, OP_faload, OP_fastore, OP_fcmpg, OP_fcmpl, OP_fconst_0, OP_fconst_1, OP_fconst_2, OP_fdiv, OP_fload, OP_fload_0, OP_fload_1, OP_fload_2, OP_fload_3, OP_fmul, OP_fneg, OP_frem, OP_freturn, OP_fstore, OP_fstore_0, OP_fstore_1, OP_fstore_2, OP_fstore_3, OP_fsub, OP_getfield, OP_getstatic, OP_goto, OP_goto_w, OP_i2b, OP_i2c, OP_i2d, OP_i2f, OP_i2l, OP_i2s, OP_iadd, OP_iaload, OP_iand, OP_iastore, OP_iconst_0, OP_iconst_1, OP_iconst_2, OP_iconst_3, OP_iconst_4, OP_iconst_5, OP_iconst_m1, OP_idiv, OP_if_acmpeq, OP_if_acmpne, OP_if_icmpeq, OP_if_icmpge, OP_if_icmpgt, OP_if_icmple, OP_if_icmplt, OP_if_icmpne, OP_ifeq, OP_ifge, OP_ifgt, OP_ifle, OP_iflt, OP_ifne, OP_ifnonnull, OP_ifnull, OP_iinc, OP_iload, OP_iload_0, OP_iload_1, OP_iload_2, OP_iload_3, OP_imul, OP_ineg, OP_instanceof, OP_invokedynamic, OP_invokeinterface, OP_invokespecial, OP_invokestatic, OP_invokevirtual, OP_ior, OP_irem, OP_ireturn, OP_ishl, OP_ishr, OP_istore, OP_istore_0, OP_istore_1, OP_istore_2, OP_istore_3, OP_isub, OP_iushr, OP_ixor, OP_jsr, OP_jsr_w, OP_l2d, OP_l2f, OP_l2i, OP_ladd, OP_laload, OP_land, OP_lastore, OP_lcmp, OP_lconst_0, OP_lconst_1, OP_ldc, OP_ldc_w, OP_ldc2_w, OP_ldiv, OP_lload, OP_lload_0, OP_lload_1, OP_lload_2, OP_lload_3, OP_lmul, OP_lneg, OP_lookupswitch, OP_lor, OP_lrem, OP_lreturn, OP_lshl, OP_lshr, OP_lstore, OP_lstore_0, OP_lstore_1, OP_lstore_2, OP_lstore_3, OP_lsub, OP_lushr, OP_lxor, OP_monitorenter, OP_monitorexit, OP_multianewarray, OP_new, OP_newarray, OP_nop, OP_pop, OP_pop2, OP_putfield, OP_putstatic, OP_ret, OP_return, OP_saload, OP_sastore, OP_sipush, OP_swap, OP_tableswitch, OP_wide, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TYPE_boolean, TYPE_boolean_index, TYPE_byte, TYPE_byte_index, TYPE_char, TYPE_char_index, TYPE_Class, TYPE_double, TYPE_double_index, TYPE_Error, TYPE_Exception, TYPE_float, TYPE_float_index, TYPE_int, TYPE_int_index, TYPE_long, TYPE_long_index, TYPE_MethodHandle, TYPE_MethodType, TYPE_null, TYPE_Object, TYPE_Object_index, TYPE_RuntimeException, TYPE_short, TYPE_short_index, TYPE_String, TYPE_Throwable, TYPE_unknown, TYPE_void, YES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Collection<IClass>getAllAncestorInterfaces()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.Collection<Annotation>getAnnotations()get annotations, if anystatic intgetArrayTypeDimensionality(TypeReference reference)IClassHierarchygetClassHierarchy()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()intgetDimensionality()Collection<IClass>getDirectInterfaces()IClassgetElementClass()IFieldgetField(Atom name)Finds a field.IFieldgetField(Atom name, TypeName typeName)Finds a field, given a name and a type.IClassgetInnermostElementClass()IMethodgetMethod(Selector sig)Finds method matching signature.intgetModifiers()Return the integer that encodes the class's modifiers, as defined by the JVM specificationTypeNamegetName()intgetNumberOfDeclaredMethods()StringgetQualifiedNameForReflection()TypeReferencegetReference()ReadergetSource()StringgetSourceFileName()IClassgetSuperclass()inthashCode()booleanisAbstract()booleanisArrayClass()booleanisInterface()Is this class a Java interface?booleanisOfPrimitives()Does this class represent an array of primitives?booleanisPrivate()booleanisPublic()booleanisReferenceType()Does 'this' refer to a reference type? If not, then it refers to a primitive type.StringtoString()
-
-
-
Method Detail
-
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.
-
getName
public TypeName getName()
-
isOfPrimitives
public boolean isOfPrimitives()
Does this class represent an array of primitives?
-
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
-
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
-
getQualifiedNameForReflection
public String getQualifiedNameForReflection()
-
getSuperclass
public IClass getSuperclass()
- Specified by:
getSuperclassin interfaceIClass- Returns:
- the superclass, or null if java.lang.Object
-
getMethod
public IMethod getMethod(Selector sig)
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 typeName)
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.
-
getNumberOfDeclaredMethods
public int getNumberOfDeclaredMethods()
-
getReference
public TypeReference getReference()
- Specified by:
getReferencein interfaceIClass- Returns:
- canonical TypeReference corresponding to this class
-
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
-
getClassInitializer
public IMethod getClassInitializer()
- Specified by:
getClassInitializerin interfaceIClass- Returns:
- the method that is this class's initializer, or null if none
-
isArrayClass
public boolean isArrayClass()
- Specified by:
isArrayClassin interfaceIClass- Returns:
- true iff the class is an array class.
-
getElementClass
public IClass getElementClass()
- Returns:
- the IClass that represents the array element type, or null if the element type is a primitive
-
getDeclaredInstanceFields
public Collection<IField> getDeclaredInstanceFields() throws UnsupportedOperationException
Description copied from interface:IClassCompute the instance fields declared by this class.- Specified by:
getDeclaredInstanceFieldsin interfaceIClass- Returns:
- Collection of IFields
- Throws:
UnsupportedOperationException
-
getDeclaredStaticFields
public Collection<IField> getDeclaredStaticFields() throws UnimplementedError
- Specified by:
getDeclaredStaticFieldsin interfaceIClass- Returns:
- Collection of IField
- Throws:
UnimplementedError
-
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.
-
getAllAncestorInterfaces
public Collection<IClass> getAllAncestorInterfaces() throws UnsupportedOperationException
- Throws:
UnsupportedOperationException
-
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
-
getDimensionality
public int getDimensionality()
-
getArrayTypeDimensionality
public static int getArrayTypeDimensionality(TypeReference reference)
- Parameters:
reference- a type reference for an array type- Returns:
- the dimensionality of the array
-
getInnermostElementClass
public IClass getInnermostElementClass()
- Returns:
- the IClass that represents the innermost array element type, or null if the element type is a primitive
-
getDirectInterfaces
public Collection<IClass> getDirectInterfaces() throws UnimplementedError
- 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.
- Throws:
UnimplementedError
-
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
-
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
-
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
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchyin interfaceIClassHierarchyDweller
-
isPublic
public boolean isPublic()
-
isPrivate
public boolean isPrivate()
-
getSource
public Reader getSource()
-
getAnnotations
public Collection<Annotation> getAnnotations()
Description copied from interface:IClassget annotations, if any- Specified by:
getAnnotationsin interfaceIClass
-
-