org.jboss.reflect.plugins
Class MethodInfoImpl

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.plugins.AbstractAnnotatedInfo
          extended by org.jboss.reflect.plugins.AnnotationHolder
              extended by org.jboss.reflect.plugins.MethodInfoImpl
All Implemented Interfaces:
Serializable, Cloneable, AnnotatedInfo, MemberInfo, MethodInfo, ModifierInfo, org.jboss.util.JBossInterface
Direct Known Subclasses:
ReflectMethodInfoImpl

public class MethodInfoImpl
extends AnnotationHolder
implements MethodInfo

Method info

Author:
Bill Burke, Adrian Brock
See Also:
Serialized Form

Field Summary
protected  ClassInfo declaringClass
          The declaring class
protected  ClassInfo[] exceptionTypes
          The exception types
protected  int hash
          The hash code
protected  int modifiers
          The modifiers
protected  String name
          The method name
protected  ParameterInfo[] parameters
          The parameters
protected  TypeInfo[] parameterTypes
          The parameter types
protected  TypeInfo returnType
          The return type
 
Fields inherited from class org.jboss.reflect.plugins.AnnotationHolder
annotationMap, annotationsArray
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.reflect.spi.MethodInfo
NO_EXCEPTIONS, NO_PARAMS, NO_PARAMS_TYPES
 
Fields inherited from interface org.jboss.reflect.spi.ModifierInfo
ABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC
 
Constructor Summary
MethodInfoImpl()
          Create a new method info
MethodInfoImpl(AnnotationValue[] annotations, String name, TypeInfo returnType, ParameterInfo[] parameters, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
          Create a new MethodInfo.
MethodInfoImpl(AnnotationValue[] annotations, String name, TypeInfo returnType, TypeInfo[] parameterTypes, AnnotationValue[][] parameterAnnotations, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
          Create a new MethodInfo.
 
Method Summary
protected  void calculateHash()
          Calculate the hash code
 boolean equals(Object obj)
           
 ClassInfo getDeclaringClass()
          Get the declaring class
 ClassInfo[] getExceptionTypes()
          Get the exception types
 int getModifiers()
          Get the modifiers
 String getName()
          Get the method name
 ParameterInfo[] getParameters()
          Get the parameters
 TypeInfo[] getParameterTypes()
          Get the parameter types
 TypeInfo getReturnType()
          Get the return type
 int hashCode()
           
 Object invoke(Object target, Object[] args)
          Invoke the method
 boolean isPublic()
          Whether it is public
 boolean isStatic()
          Whether it is static
 boolean isVolatile()
          Whether it is volatile
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.reflect.plugins.AnnotationHolder
getAnnotation, getAnnotations, isAnnotationPresent, setupAnnotations
 
Methods inherited from class org.jboss.reflect.plugins.AbstractAnnotatedInfo
getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.reflect.spi.AnnotatedInfo
getAnnotation, getAnnotations, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresent
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString
 

Field Detail

name

protected String name
The method name


declaringClass

protected ClassInfo declaringClass
The declaring class


parameterTypes

protected TypeInfo[] parameterTypes
The parameter types


parameters

protected ParameterInfo[] parameters
The parameters


exceptionTypes

protected ClassInfo[] exceptionTypes
The exception types


modifiers

protected int modifiers
The modifiers


returnType

protected TypeInfo returnType
The return type


hash

protected int hash
The hash code

Constructor Detail

MethodInfoImpl

public MethodInfoImpl()
Create a new method info


MethodInfoImpl

public MethodInfoImpl(AnnotationValue[] annotations,
                      String name,
                      TypeInfo returnType,
                      TypeInfo[] parameterTypes,
                      AnnotationValue[][] parameterAnnotations,
                      ClassInfo[] exceptionTypes,
                      int modifiers,
                      ClassInfo declaring)
Create a new MethodInfo.

Parameters:
annotations - the annotations
name - the method name
returnType - the return type
parameterTypes - the parameter types
parameterAnnotations - the parameter annotations
exceptionTypes - the exception types
modifiers - the modifiers
declaring - the declaring class

MethodInfoImpl

public MethodInfoImpl(AnnotationValue[] annotations,
                      String name,
                      TypeInfo returnType,
                      ParameterInfo[] parameters,
                      ClassInfo[] exceptionTypes,
                      int modifiers,
                      ClassInfo declaring)
Create a new MethodInfo.

Parameters:
annotations - the annotations
name - the method name
returnType - the return type
parameters - the parameters
exceptionTypes - the exception types
modifiers - the modifiers
declaring - the declaring class
Method Detail

getName

public String getName()
Description copied from interface: MethodInfo
Get the method name

Specified by:
getName in interface MethodInfo
Returns:
the method name

getDeclaringClass

public ClassInfo getDeclaringClass()
Description copied from interface: MemberInfo
Get the declaring class

Specified by:
getDeclaringClass in interface MemberInfo
Returns:
the declaring class

getParameterTypes

public TypeInfo[] getParameterTypes()
Description copied from interface: MethodInfo
Get the parameter types

Specified by:
getParameterTypes in interface MethodInfo
Returns:
the parameter types

getParameters

public ParameterInfo[] getParameters()
Description copied from interface: MethodInfo
Get the parameters

Specified by:
getParameters in interface MethodInfo
Returns:
the parameters

getExceptionTypes

public ClassInfo[] getExceptionTypes()
Description copied from interface: MethodInfo
Get the exception types

Specified by:
getExceptionTypes in interface MethodInfo
Returns:
the exception types

getReturnType

public TypeInfo getReturnType()
Description copied from interface: MethodInfo
Get the return type

Specified by:
getReturnType in interface MethodInfo
Returns:
the return type

getModifiers

public int getModifiers()
Description copied from interface: ModifierInfo
Get the modifiers

Specified by:
getModifiers in interface ModifierInfo
Returns:
the modifiers

isStatic

public boolean isStatic()
Description copied from interface: ModifierInfo
Whether it is static

Specified by:
isStatic in interface ModifierInfo
Returns:
true when static

isPublic

public boolean isPublic()
Description copied from interface: ModifierInfo
Whether it is public

Specified by:
isPublic in interface ModifierInfo
Returns:
true when public

isVolatile

public boolean isVolatile()
Description copied from interface: ModifierInfo
Whether it is volatile

Specified by:
isVolatile in interface ModifierInfo
Returns:
true if volatile

invoke

public Object invoke(Object target,
                     Object[] args)
              throws Throwable
Description copied from interface: MethodInfo
Invoke the method

Specified by:
invoke in interface MethodInfo
Parameters:
target - the target
args - the arguments
Returns:
the result of the invocation
Throws:
Throwable - for any error

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class org.jboss.util.JBossObject

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class org.jboss.util.JBossObject

calculateHash

protected void calculateHash()
Calculate the hash code



Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.