com.openharbor.beck
Class ObjectOHXPathMap

java.lang.Object
  extended bycom.openharbor.beck.ObjectOHXPathMap

public class ObjectOHXPathMap
extends java.lang.Object

Maps from Java objects to the OHXPaths of their corresponding XML elements. This class is not thread-safe; an instance should not be used by multiple threads.


Nested Class Summary
static class ObjectOHXPathMap.ObjectIdentity
          Defines equals and hashCode in terms of object identity.
static class ObjectOHXPathMap.Policy
          Controls the behavior of an ObjectOHXPathMap.
 
Constructor Summary
ObjectOHXPathMap()
           
 
Method Summary
 OHXPath get(java.lang.Object referent)
          Find the OHXPath of the XML element previously map(java.lang.Object, com.openharbor.beck.map.MapToXML.Source, com.openharbor.beck.ObjectOHXPathMap.Policy)ped from the given object.
 void map(java.lang.Object source, MapToXML.Source mapping, ObjectOHXPathMap.Policy policy)
          Map from Java objects to the OHXPaths of their corresponding XML elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectOHXPathMap

public ObjectOHXPathMap()
Method Detail

map

public void map(java.lang.Object source,
                MapToXML.Source mapping,
                ObjectOHXPathMap.Policy policy)
         throws java.lang.Exception
Map from Java objects to the OHXPaths of their corresponding XML elements. Previous mappings (if any) are cleared before computing the new mapping.

Throws:
java.lang.Exception

get

public OHXPath get(java.lang.Object referent)
Find the OHXPath of the XML element previously map(java.lang.Object, com.openharbor.beck.map.MapToXML.Source, com.openharbor.beck.ObjectOHXPathMap.Policy)ped from the given object.

Returns:
the desired OHXPath, or null to indicate that none is available (e.g. because the referent was restricted or didn't map to XML).