org.apache.bval.util
Class AccessStrategy

java.lang.Object
  extended by org.apache.bval.util.AccessStrategy
Direct Known Subclasses:
FieldAccess, IndexedAccess, KeyedAccess, MethodAccess, ParameterAccess, PropertyAccess, ReturnAccess

public abstract class AccessStrategy
extends Object

Description: abstract class to encapsulate different strategies to get the value of a Property. This class is designed such that subclasses are intended to know internally to which property they refer, with only the particular target instance being externally required to calculate the property's value. One intent of this design is that the notion of the very definition of a property is abstracted along with the mechanism for accessing that property.


Constructor Summary
AccessStrategy()
           
 
Method Summary
abstract  Object get(Object instance)
          Get the value from the given instance.
abstract  ElementType getElementType()
          Get the Java program ElementType used by this AccessStrategy to determine property values.
abstract  Type getJavaType()
          Get the type of the property
abstract  String getPropertyName()
          Get a name representative of this property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessStrategy

public AccessStrategy()
Method Detail

get

public abstract Object get(Object instance)
Get the value from the given instance.

Parameters:
instance -
Returns:
the value
Throws:
IllegalArgumentException - in case of an error

getElementType

public abstract ElementType getElementType()
Get the Java program ElementType used by this AccessStrategy to determine property values.

Returns:
ElementType

getJavaType

public abstract Type getJavaType()
Get the type of the property

Returns:
Type

getPropertyName

public abstract String getPropertyName()
Get a name representative of this property.

Returns:
String


Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.