org.loom.binding
Class PropertyBinder

java.lang.Object
  extended by org.loom.binding.PropertyBinder

public class PropertyBinder
extends java.lang.Object

A binder for a nested property, e.g. address.street.name.

Author:
icoloma

Constructor Summary
PropertyBinder(java.lang.String propertyPath)
           
 
Method Summary
 void applyValidation(java.lang.Object action, PropertyValidator validator, Messages messages)
          Applies a validation.
 Converter getConverter()
           
 Node getLeafNode()
           
 java.lang.String getNormalizedPropertyPath()
           
 java.lang.Class<?> getPropertyClass()
           
 Node getRootNode()
           
 java.lang.Object getValue(java.lang.Object rootContainer, java.lang.String propertyPath)
          Gets the value on the given path
 java.lang.String getValueAsText(java.lang.Object rootContainer, java.lang.String propertyPath, MessagesRepository repository)
           
 void setConverter(Converter converter)
           
 void setRootNode(Node rootNode)
           
 void setValue(java.lang.Object rootContainer, java.lang.Object valueAsObject, java.lang.String propertyPath)
           
 void setValue(java.lang.Object rootContainer, ParameterValue valueAsString, Messages messages, MessagesRepository repository)
          Assigns a value to the given path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyBinder

public PropertyBinder(java.lang.String propertyPath)
Method Detail

setValue

public void setValue(java.lang.Object rootContainer,
                     ParameterValue valueAsString,
                     Messages messages,
                     MessagesRepository repository)
Assigns a value to the given path

Parameters:
rootContainer - the object where to assign the value
valueAsString - the value to assign

setValue

public void setValue(java.lang.Object rootContainer,
                     java.lang.Object valueAsObject,
                     java.lang.String propertyPath)

getValue

public java.lang.Object getValue(java.lang.Object rootContainer,
                                 java.lang.String propertyPath)
Gets the value on the given path

Parameters:
rootContainer - the root of the property path
propertyPath - the property path requested

getValueAsText

public java.lang.String getValueAsText(java.lang.Object rootContainer,
                                       java.lang.String propertyPath,
                                       MessagesRepository repository)

getRootNode

public Node getRootNode()

setRootNode

public void setRootNode(Node rootNode)

getNormalizedPropertyPath

public java.lang.String getNormalizedPropertyPath()

applyValidation

public void applyValidation(java.lang.Object action,
                            PropertyValidator validator,
                            Messages messages)
Applies a validation. If there is more than one value involved in this validation (i.e. lists, maps, or arrays), validates each and every node.

Parameters:
action - the action whose properties will be validated.
validator - The validator to be applied
messages - where to put any validation messages that may occur

getPropertyClass

public java.lang.Class<?> getPropertyClass()
Returns:
the property class of the end of this propertyPath

getLeafNode

public Node getLeafNode()

getConverter

public Converter getConverter()

setConverter

public void setConverter(Converter converter)


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.