Class ArrayClass

java.lang.Object
com.ibm.wala.classLoader.ArrayClass
All Implemented Interfaces:
IClass, IClassHierarchyDweller, Constants

public class ArrayClass extends Object implements IClass, Constants
Implementation of IClass for array classes. Such classes would be best called 'broken covariant array types', since that is the semantics that they implement.
  • Method Details Link icon

    • getClassLoader Link icon

      public IClassLoader getClassLoader()
      Description copied from interface: IClass
      Return the object that represents the defining class loader for this class.
      Specified by:
      getClassLoader in interface IClass
      Returns:
      the object that represents the defining class loader for this class.
    • getName Link icon

      public TypeName getName()
      Specified by:
      getName in interface IClass
      Returns:
      the TypeName for this class
    • isOfPrimitives Link icon

      public boolean isOfPrimitives()
      Does this class represent an array of primitives?
    • isInterface Link icon

      public boolean isInterface()
      Description copied from interface: IClass
      Is this class a Java interface?
      Specified by:
      isInterface in interface IClass
    • isAbstract Link icon

      public boolean isAbstract()
      Specified by:
      isAbstract in interface IClass
      Returns:
      true iff this class is abstract
    • getModifiers Link icon

      public int getModifiers()
      Description copied from interface: IClass
      Return the integer that encodes the class's modifiers, as defined by the JVM specification
      Specified by:
      getModifiers in interface IClass
      Returns:
      the integer that encodes the class's modifiers, as defined by the JVM specification
    • getQualifiedNameForReflection Link icon

      public String getQualifiedNameForReflection()
    • getSuperclass Link icon

      public IClass getSuperclass()
      Specified by:
      getSuperclass in interface IClass
      Returns:
      the superclass, or null if java.lang.Object
    • getMethod Link icon

      public IMethod getMethod(Selector sig)
      Description copied from interface: IClass
      Finds method matching signature. Delegates to superclass if not found.
      Specified by:
      getMethod in interface IClass
      Parameters:
      sig - a method signature
      Returns:
      IMethod from this class matching the signature; null if not found in this class or any superclass.
    • getField Link icon

      public IField getField(Atom name)
      Description copied from interface: IClass
      Finds a field.
      Specified by:
      getField in interface IClass
    • getField Link icon

      public IField getField(Atom name, TypeName typeName)
      Description copied from interface: IClass
      Finds a field, given a name and a type. Returns null if not found.
      Specified by:
      getField in interface IClass
    • getDeclaredMethods Link icon

      public Collection<IMethod> getDeclaredMethods()
      Specified by:
      getDeclaredMethods in interface IClass
      Returns:
      an Iterator of the IMethods declared by this class.
    • getNumberOfDeclaredMethods Link icon

      public int getNumberOfDeclaredMethods()
    • getReference Link icon

      public TypeReference getReference()
      Specified by:
      getReference in interface IClass
      Returns:
      canonical TypeReference corresponding to this class
    • getSourceFileName Link icon

      public String getSourceFileName()
      Specified by:
      getSourceFileName in interface IClass
      Returns:
      String holding the name of the source file that defined this class, or null if none found
    • getClassInitializer Link icon

      public IMethod getClassInitializer()
      Specified by:
      getClassInitializer in interface IClass
      Returns:
      the method that is this class's initializer, or null if none
    • isArrayClass Link icon

      public boolean isArrayClass()
      Specified by:
      isArrayClass in interface IClass
      Returns:
      true iff the class is an array class.
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • getElementClass Link icon

      public IClass getElementClass()
      Returns:
      the IClass that represents the array element type, or null if the element type is a primitive
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDeclaredInstanceFields Link icon

      public Collection<IField> getDeclaredInstanceFields() throws UnsupportedOperationException
      Description copied from interface: IClass
      Compute the instance fields declared by this class.
      Specified by:
      getDeclaredInstanceFields in interface IClass
      Returns:
      Collection of IFields
      Throws:
      UnsupportedOperationException
    • getDeclaredStaticFields Link icon

      public Collection<IField> getDeclaredStaticFields() throws UnimplementedError
      Specified by:
      getDeclaredStaticFields in interface IClass
      Returns:
      Collection of IField
      Throws:
      UnimplementedError
    • getAllImplementedInterfaces Link icon

      public Collection<IClass> getAllImplementedInterfaces()
      Specified by:
      getAllImplementedInterfaces in interface IClass
      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 Link icon

    • isReferenceType Link icon

      public boolean isReferenceType()
      Description copied from interface: IClass
      Does 'this' refer to a reference type? If not, then it refers to a primitive type.
      Specified by:
      isReferenceType in interface IClass
    • getDimensionality Link icon

      public int getDimensionality()
    • getArrayTypeDimensionality Link icon

      public static int getArrayTypeDimensionality(TypeReference reference)
      Parameters:
      reference - a type reference for an array type
      Returns:
      the dimensionality of the array
    • getInnermostElementClass Link icon

      public IClass getInnermostElementClass()
      Returns:
      the IClass that represents the innermost array element type, or null if the element type is a primitive
    • getDirectInterfaces Link icon

      public Collection<IClass> getDirectInterfaces() throws UnimplementedError
      Specified by:
      getDirectInterfaces in interface IClass
      Returns:
      Collection of (IClass) interfaces this class directly implements. If this class is an interface, returns the interfaces it immediately extends.
      Throws:
      UnimplementedError
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getAllInstanceFields Link icon

      public Collection<IField> getAllInstanceFields()
      Description copied from interface: IClass
      Compute the instance fields declared by this class or any of its superclasses.
      Specified by:
      getAllInstanceFields in interface IClass
    • getAllStaticFields Link icon

      public Collection<IField> getAllStaticFields()
      Description copied from interface: IClass
      Compute the static fields declared by this class or any of its superclasses.
      Specified by:
      getAllStaticFields in interface IClass
    • getAllMethods Link icon

      public Collection<? extends IMethod> getAllMethods()
      Description copied from interface: IClass
      Compute the methods declared by this class or any of its superclasses.
      Specified by:
      getAllMethods in interface IClass
    • getAllFields Link icon

      public Collection<IField> getAllFields()
      Description copied from interface: IClass
      Compute the instance and static fields declared by this class or any of its superclasses.
      Specified by:
      getAllFields in interface IClass
    • getClassHierarchy Link icon

      public IClassHierarchy getClassHierarchy()
      Specified by:
      getClassHierarchy in interface IClassHierarchyDweller
    • isPublic Link icon

      public boolean isPublic()
      Specified by:
      isPublic in interface IClass
      Returns:
      true iff this class is public
    • isPrivate Link icon

      public boolean isPrivate()
      Specified by:
      isPrivate in interface IClass
      Returns:
      true iff this class is private
    • isSynthetic Link icon

      public boolean isSynthetic()
      Specified by:
      isSynthetic in interface IClass
      Returns:
      true iff this class is synthetic, i.e., compiler-generated
    • getSource Link icon

      public Reader getSource()
      Specified by:
      getSource in interface IClass
      Returns:
      String representing the source file holding this class, or null if not found
    • getAnnotations Link icon

      public Collection<Annotation> getAnnotations()
      Description copied from interface: IClass
      get annotations, if any
      Specified by:
      getAnnotations in interface IClass