net.stickycode.coercion
Interface CoercionTarget

All Known Implementing Classes:
AbstractCoercionTarget, ArrayCoercionTarget, ParameterizedArrayCoercionTarget, ParameterizedCoercionTarget, PrimitiveResolvingCoercionTarget

public interface CoercionTarget

Contract for something that can be the target of a coercion.


Method Summary
 Class<?> boxedType()
          If this target represents a primitive type return the boxing type for it
 boolean canBeAnnotated()
           
 AnnotatedElement getAnnotatedElement()
           
 CoercionTarget[] getComponentCoercionTypes()
          Return the CoercionTargets for the components.
 Class<?> getOwner()
          Return the owning type of the target, for a method this is the class the method was found on similarly for fields.
 CoercionTarget getParent()
           
 Class<?> getType()
          Return the type for the target to be coerced
 boolean hasComponents()
          Does the target have components, this is true of any container e.g.
 boolean hasParent()
           
 boolean isArray()
          Is the underlying target an array
 boolean isPrimitive()
          Return true if this target is a primitive type
 

Method Detail

getType

Class<?> getType()
Return the type for the target to be coerced


isArray

boolean isArray()
Is the underlying target an array


hasComponents

boolean hasComponents()
Does the target have components, this is true of any container e.g. Collection, Map


getComponentCoercionTypes

CoercionTarget[] getComponentCoercionTypes()
Return the CoercionTargets for the components. For a collection this would return a single CoercionTarget for the element contained. For a map you would get one for the key and one for the value.


isPrimitive

boolean isPrimitive()
Return true if this target is a primitive type


boxedType

Class<?> boxedType()
If this target represents a primitive type return the boxing type for it


canBeAnnotated

boolean canBeAnnotated()

getAnnotatedElement

AnnotatedElement getAnnotatedElement()

getOwner

Class<?> getOwner()
Return the owning type of the target, for a method this is the class the method was found on similarly for fields.


getParent

CoercionTarget getParent()

hasParent

boolean hasParent()


Copyright © 2003-2012 RedEngine Ltd. All Rights Reserved.