org.apache.pivot.beans
Class NamespaceBinding

java.lang.Object
  extended by org.apache.pivot.beans.NamespaceBinding

public class NamespaceBinding
extends Object

Represents a binding relationship between a source property and a target property within a namespace.


Nested Class Summary
static interface NamespaceBinding.BindMapping
          Namespace bind mapping interface.
 
Constructor Summary
NamespaceBinding(Map<String,Object> namespace, String sourcePath, String targetPath)
           
NamespaceBinding(Map<String,Object> namespace, String sourcePath, String targetPath, NamespaceBinding.BindMapping bindMapping)
           
 
Method Summary
 void bind()
          Binds the source property to the target property.
 boolean equals(Object o)
           
 NamespaceBinding.BindMapping getBindMapping()
          Returns the bind mapping.
 Map<String,Object> getNamespace()
          Returns the namespace.
 Object getSource()
          Returns the source object.
 String getSourceKey()
          Returns the name of the source property.
 String getSourcePath()
          Returns the path to the source property.
 Object getTarget()
          Returns the target object.
 String getTargetKey()
          Returns the name of the target property.
 String getTargetPath()
          Returns the path to the target property.
 Object getTransformedSourceValue()
          Returns the current source value with any bind mapping applied.
 int hashCode()
           
 void unbind()
          Unbinds the source property from the target property.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceBinding

public NamespaceBinding(Map<String,Object> namespace,
                        String sourcePath,
                        String targetPath)

NamespaceBinding

public NamespaceBinding(Map<String,Object> namespace,
                        String sourcePath,
                        String targetPath,
                        NamespaceBinding.BindMapping bindMapping)
Method Detail

getNamespace

public Map<String,Object> getNamespace()
Returns the namespace.


getSourcePath

public String getSourcePath()
Returns the path to the source property.


getSource

public Object getSource()
Returns the source object.


getSourceKey

public String getSourceKey()
Returns the name of the source property.


getTargetPath

public String getTargetPath()
Returns the path to the target property.


getTarget

public Object getTarget()
Returns the target object.


getTargetKey

public String getTargetKey()
Returns the name of the target property.


getBindMapping

public NamespaceBinding.BindMapping getBindMapping()
Returns the bind mapping.

Returns:
The bind mapping to use during binding, or null if no bind mapping is specified.

getTransformedSourceValue

public Object getTransformedSourceValue()
Returns the current source value with any bind mapping applied.


bind

public void bind()
Binds the source property to the target property.


unbind

public void unbind()
Unbinds the source property from the target property.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object