org.jboss.reflect.spi
Interface Value

All Known Subinterfaces:
AnnotationValue, ArrayValue, ClassValue, EnumValue, StringValue
All Known Implementing Classes:
AbstractValue, AnnotationValueImpl, ArrayValueImpl, ClassValueImpl, EnumValueImpl, PrimitiveValue, StringValueImpl

public interface Value

A value

Author:
Bill Burke

Method Summary
 AnnotationValue asAnnotation()
          Get the value as an annotation
 ArrayValue asArray()
          Get the value as an annotation
 ClassValue asClass()
          Get the value as a class
 EnumValue asEnum()
          Get the value as an enum
 PrimitiveValue asPrimitive()
          Get the value as a primitive
 StringValue asString()
          Get the value as a string
 TypeInfo getType()
          Get the type of the value
 boolean isAnnotation()
          Is this value an annotation
 boolean isArray()
          Is this value an array
 boolean isClass()
          Is this value a class
 boolean isEnum()
          Is this value an enum
 boolean isPrimitive()
          Is this value a primitive
 boolean isString()
          Is this value a string
 

Method Detail

getType

TypeInfo getType()
Get the type of the value

Returns:
the type

isPrimitive

boolean isPrimitive()
Is this value a primitive

Returns:
true when a primitive

asPrimitive

PrimitiveValue asPrimitive()
Get the value as a primitive

Returns:
the value
Throws:
IllegalStateException - when not a primitive value

isClass

boolean isClass()
Is this value a class

Returns:
true when a class

asClass

ClassValue asClass()
Get the value as a class

Returns:
the value
Throws:
IllegalStateException - when not a class value

isString

boolean isString()
Is this value a string

Returns:
true when a string

asString

StringValue asString()
Get the value as a string

Returns:
the value
Throws:
IllegalStateException - when not a string value

isEnum

boolean isEnum()
Is this value an enum

Returns:
true when an enum

asEnum

EnumValue asEnum()
Get the value as an enum

Returns:
the value
Throws:
IllegalStateException - when not an enum

isAnnotation

boolean isAnnotation()
Is this value an annotation

Returns:
true when an annotation

asAnnotation

AnnotationValue asAnnotation()
Get the value as an annotation

Returns:
the value
Throws:
IllegalStateException - when not an annotation value

isArray

boolean isArray()
Is this value an array

Returns:
true when an array

asArray

ArrayValue asArray()
Get the value as an annotation

Returns:
the value
Throws:
IllegalStateException - when not an array value


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