JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins
Class AnnotationValueImpl

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.spi.AbstractValue
          extended by org.jboss.reflect.plugins.AnnotationValueImpl
All Implemented Interfaces:
Serializable, Cloneable, AnnotationValue, Value, org.jboss.util.JBossInterface

public class AnnotationValueImpl
extends AbstractValue
implements AnnotationValue

An annotation value

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

Field Summary
protected  AnnotationInfo annotationType
          The annotation type
protected  HashMap<String,Value> attributeValues
          The attribute values
protected  int hash
          The hash code
protected  Annotation underlying
          The underlying annotation
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
AnnotationValueImpl()
          Create a new Annotation value
AnnotationValueImpl(AnnotationInfo annotationType, HashMap<String,Value> attributeValues)
          Deprecated. 
AnnotationValueImpl(AnnotationInfo annotationType, HashMap<String,Value> attributeValues, Annotation underlying)
          Create a new Annotation value
 
Method Summary
protected  void calculateHash()
          Calculate the hashcode
 boolean equals(Object o)
           
 AnnotationInfo getAnnotationType()
          Get the annotation type
 TypeInfo getType()
          Get the type of the value
 Annotation getUnderlyingAnnotation()
          Get the underlying annotation
<T extends Annotation>
T
getUnderlyingAnnotation(Class<T> type)
          Get the underlying annotation
 Value getValue(String attributeName)
          Get an attribute value
 Map<String,Value> getValues()
          Get the values
 int hashCode()
           
 boolean isAnnotation()
          Is this value an annotation
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.reflect.spi.AbstractValue
asAnnotation, asArray, asClass, asEnum, asPrimitive, asString, isArray, isClass, isEnum, isPrimitive, isString
 
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.Value
asAnnotation, asArray, asClass, asEnum, asPrimitive, asString, isArray, isClass, isEnum, isPrimitive, isString
 

Field Detail

annotationType

protected AnnotationInfo annotationType
The annotation type


attributeValues

protected HashMap<String,Value> attributeValues
The attribute values


underlying

protected Annotation underlying
The underlying annotation


hash

protected int hash
The hash code

Constructor Detail

AnnotationValueImpl

public AnnotationValueImpl()
Create a new Annotation value


AnnotationValueImpl

@Deprecated
public AnnotationValueImpl(AnnotationInfo annotationType,
                                      HashMap<String,Value> attributeValues)
Deprecated. 

Create a new Annotation value

Parameters:
annotationType - the annotation info
attributeValues - the attribute values

AnnotationValueImpl

public AnnotationValueImpl(AnnotationInfo annotationType,
                           HashMap<String,Value> attributeValues,
                           Annotation underlying)
Create a new Annotation value

Parameters:
annotationType - the annotation info
attributeValues - the attribute values
underlying - the underlying annotation
Method Detail

isAnnotation

public boolean isAnnotation()
Description copied from interface: Value
Is this value an annotation

Specified by:
isAnnotation in interface Value
Overrides:
isAnnotation in class AbstractValue
Returns:
true when an annotation

getAnnotationType

public AnnotationInfo getAnnotationType()
Description copied from interface: AnnotationValue
Get the annotation type

Specified by:
getAnnotationType in interface AnnotationValue
Returns:
the annotation type

getValue

public Value getValue(String attributeName)
Description copied from interface: AnnotationValue
Get an attribute value

Specified by:
getValue in interface AnnotationValue
Parameters:
attributeName - the attribute name
Returns:
the value

getValues

public Map<String,Value> getValues()
Description copied from interface: AnnotationValue
Get the values

Specified by:
getValues in interface AnnotationValue
Returns:
the values

getType

public TypeInfo getType()
Description copied from interface: Value
Get the type of the value

Specified by:
getType in interface Value
Returns:
the type

getUnderlyingAnnotation

public Annotation getUnderlyingAnnotation()
Description copied from interface: AnnotationValue
Get the underlying annotation

Specified by:
getUnderlyingAnnotation in interface AnnotationValue
Returns:
the annotation

getUnderlyingAnnotation

public <T extends Annotation> T getUnderlyingAnnotation(Class<T> type)
Description copied from interface: AnnotationValue
Get the underlying annotation

Specified by:
getUnderlyingAnnotation in interface AnnotationValue
Type Parameters:
T - the annotation type
Parameters:
type - the annotationType
Returns:
the annotation

equals

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

hashCode

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

calculateHash

protected void calculateHash()
Calculate the hashcode


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

toString

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

JBoss Reflection 2.2.1.SP1

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