org.kuali.rice.krad.datadictionary.validation
Class ViewAttributeValueReader

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.validation.BaseAttributeValueReader
      extended by org.kuali.rice.krad.datadictionary.validation.ViewAttributeValueReader
All Implemented Interfaces:
AttributeValueReader

public class ViewAttributeValueReader
extends BaseAttributeValueReader

AttributeValueReader which can read the correct values from all InputFields which exist on the View


Field Summary
 
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.BaseAttributeValueReader
attributeName, entryName
 
Constructor Summary
ViewAttributeValueReader(View view, Object form)
          Constructor for ViewAttributeValueReader, the View must already be indexed and the InputFields must have already be initialized for this reader to work properly
 
Method Summary
 AttributeValueReader clone()
          Cones this AttributeValueReader
 Constrainable getDefinition(String attributeName)
          Gets the definition which is an InputField on the View/Page
 List<Constrainable> getDefinitions()
          Gets all InputFields (which extend Constrainable)
 Constrainable getEntry()
          Not used for this reader, returns null
 String getLabel(String attributeName)
          Returns the label associated with the InputField which has that AttributeName
 Object getObject()
          Returns the View object
 String getPath()
          Returns current attributeName which represents the path
 Class<?> getType(String attributeName)
          Gets the type of value for this AttributeName as represented on the Form
<X> X
getValue()
          Return value of the field for the attributeName currently set on this reader
<X> X
getValue(String attributeName)
          Return value of the field for the attributeName passed in
 boolean isReadable()
          If the current attribute being evaluated is a field of an addLine return false because it should not be evaluated during Validation.
 
Methods inherited from class org.kuali.rice.krad.datadictionary.validation.BaseAttributeValueReader
getAttributeName, getCleanSearchableValues, getEntryName, setAttributeName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewAttributeValueReader

public ViewAttributeValueReader(View view,
                                Object form)
Constructor for ViewAttributeValueReader, the View must already be indexed and the InputFields must have already be initialized for this reader to work properly

Parameters:
view - the View to validate
form - model object representing the View's form data
Method Detail

getDefinition

public Constrainable getDefinition(String attributeName)
Gets the definition which is an InputField on the View/Page

Parameters:
attributeName - - the name of the attribute/field whose metadata is being requested
Returns:
dictionary metadata object implementing some constrainable capability

getDefinitions

public List<Constrainable> getDefinitions()
Gets all InputFields (which extend Constrainable)

Returns:

getLabel

public String getLabel(String attributeName)
Returns the label associated with the InputField which has that AttributeName

Parameters:
attributeName -
Returns:

getObject

public Object getObject()
Returns the View object

Returns:
view set in the constructor

getEntry

public Constrainable getEntry()
Not used for this reader, returns null

Returns:
null

getPath

public String getPath()
Returns current attributeName which represents the path

Returns:
attributeName set on this reader

getType

public Class<?> getType(String attributeName)
Gets the type of value for this AttributeName as represented on the Form

Parameters:
attributeName -
Returns:

isReadable

public boolean isReadable()
If the current attribute being evaluated is a field of an addLine return false because it should not be evaluated during Validation.

Returns:
false if InputField is part of an addLine for a collection, true otherwise

getValue

public <X> X getValue()
           throws AttributeValidationException
Return value of the field for the attributeName currently set on this reader

Type Parameters:
X - return type
Returns:
value of the field for the attributeName currently set on this reader
Throws:
AttributeValidationException

getValue

public <X> X getValue(String attributeName)
           throws AttributeValidationException
Return value of the field for the attributeName passed in

Type Parameters:
X - return type
Parameters:
attributeName - name (which represents a path) of the value to be retrieved on the Form
Returns:
value of that attributeName represents on the form
Throws:
AttributeValidationException

clone

public AttributeValueReader clone()
Cones this AttributeValueReader

Specified by:
clone in interface AttributeValueReader
Specified by:
clone in class BaseAttributeValueReader
Returns:
AttributeValueReader


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.