org.codehaus.aspectwerkz.reflect.impl.java
Class JavaClassInfo

java.lang.Object
  extended by org.codehaus.aspectwerkz.reflect.impl.java.JavaClassInfo
All Implemented Interfaces:
ClassInfo, ReflectionInfo

public class JavaClassInfo
extends Object
implements ClassInfo

Implementation of the ClassInfo interface for java.lang.reflect.*.

Author:
Jonas BonŽr

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codehaus.aspectwerkz.reflect.ClassInfo
ClassInfo.NullClassInfo
 
Method Summary
static String convertJavaArrayTypeNameToHumanTypeName(String typeName)
          Converts an internal Java array type name ([Lblabla) to the a the format used by the expression matcher (blabla[])
 boolean equals(Object o)
           
 List getAnnotations()
          Returns the annotations infos.
static ClassInfo getClassInfo(Class clazz)
          Returns the class info for a specific class.
 ClassLoader getClassLoader()
          Returns the class loader that loaded this class.
 ClassInfo getComponentType()
          Returns the component type if array type else null.
 ConstructorInfo getConstructor(int hash)
          Returns a constructor info by its hash.
 ConstructorInfo[] getConstructors()
          Returns a list with all the constructors info.
 FieldInfo getField(int hash)
          Returns a field info by its hash.
 FieldInfo[] getFields()
          Returns a list with all the field info.
 ClassInfo[] getInterfaces()
          Returns the interfaces.
 MethodInfo getMethod(int hash)
          Returns a method info by its hash.
 MethodInfo[] getMethods()
          Returns a list with all the methods info.
 int getModifiers()
          Returns the class modifiers.
 String getName()
          Returns the name of the class.
 String getSignature()
          Returns the signature for the element.
 ClassInfo getSuperclass()
          Returns the super class.
 int hashCode()
           
 boolean hasStaticInitializer()
          Checks if the class has a static initalizer.
 boolean isArray()
          Is the class an array type.
 boolean isInterface()
          Is the class an interface.
 boolean isPrimitive()
          Is the class a primitive type.
 StaticInitializationInfo staticInitializer()
          Returns the static initializer info of the current underlying class if any.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getClassInfo

public static ClassInfo getClassInfo(Class clazz)
Returns the class info for a specific class.

Returns:
the class info

getAnnotations

public List getAnnotations()
Returns the annotations infos.

Specified by:
getAnnotations in interface ReflectionInfo
Returns:
the annotations infos

getName

public String getName()
Returns the name of the class.

Specified by:
getName in interface ReflectionInfo
Returns:
the name of the class

hasStaticInitializer

public boolean hasStaticInitializer()
Checks if the class has a static initalizer.

Specified by:
hasStaticInitializer in interface ClassInfo
Returns:

staticInitializer

public StaticInitializationInfo staticInitializer()
Returns the static initializer info of the current underlying class if any.

Specified by:
staticInitializer in interface ClassInfo
Returns:
See Also:
ClassInfo.staticInitializer()

getSignature

public String getSignature()
Returns the signature for the element.

Specified by:
getSignature in interface ReflectionInfo
Returns:
the signature for the element

getModifiers

public int getModifiers()
Returns the class modifiers.

Specified by:
getModifiers in interface ReflectionInfo
Returns:
the class modifiers

getClassLoader

public ClassLoader getClassLoader()
Returns the class loader that loaded this class.

Specified by:
getClassLoader in interface ClassInfo
Returns:
the class loader

getConstructor

public ConstructorInfo getConstructor(int hash)
Returns a constructor info by its hash.

Specified by:
getConstructor in interface ClassInfo
Parameters:
hash -
Returns:

getConstructors

public ConstructorInfo[] getConstructors()
Returns a list with all the constructors info.

Specified by:
getConstructors in interface ClassInfo
Returns:
the constructors info

getMethod

public MethodInfo getMethod(int hash)
Returns a method info by its hash.

Specified by:
getMethod in interface ClassInfo
Parameters:
hash -
Returns:

getMethods

public MethodInfo[] getMethods()
Returns a list with all the methods info.

Specified by:
getMethods in interface ClassInfo
Returns:
the methods info

getField

public FieldInfo getField(int hash)
Returns a field info by its hash.

Specified by:
getField in interface ClassInfo
Parameters:
hash -
Returns:

getFields

public FieldInfo[] getFields()
Returns a list with all the field info.

Specified by:
getFields in interface ClassInfo
Returns:
the field info

getInterfaces

public ClassInfo[] getInterfaces()
Returns the interfaces.

Specified by:
getInterfaces in interface ClassInfo
Returns:
the interfaces

getSuperclass

public ClassInfo getSuperclass()
Returns the super class.

Specified by:
getSuperclass in interface ClassInfo
Returns:
the super class

getComponentType

public ClassInfo getComponentType()
Returns the component type if array type else null.

Specified by:
getComponentType in interface ClassInfo
Returns:
the component type

isInterface

public boolean isInterface()
Is the class an interface.

Specified by:
isInterface in interface ClassInfo
Returns:

isPrimitive

public boolean isPrimitive()
Is the class a primitive type.

Specified by:
isPrimitive in interface ClassInfo
Returns:

isArray

public boolean isArray()
Is the class an array type.

Specified by:
isArray in interface ClassInfo
Returns:

convertJavaArrayTypeNameToHumanTypeName

public static String convertJavaArrayTypeNameToHumanTypeName(String typeName)
Converts an internal Java array type name ([Lblabla) to the a the format used by the expression matcher (blabla[])

Parameters:
typeName - is type name
Returns:

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.