Class ViewAttributeValueReader

java.lang.Object
org.kuali.rice.krad.datadictionary.validation.BaseAttributeValueReader
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
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • ViewAttributeValueReader

      public ViewAttributeValueReader(ViewModel 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:
      form - model object representing the View's form data
  • Method Details

    • 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:
      constrainable input fields
    • getLabel

      public String getLabel(String attributeName)
      Returns the label associated with the InputField which has that AttributeName
      Parameters:
      attributeName - attribute name
      Returns:
      label associated with the named attribute
    • getObject

      public Object getObject()
      Returns the Form object
      Returns:
      form 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:
      attribute type
    • 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