EclipseLink 2.4.0, build 'v20120608-r11652' API Reference

org.eclipse.persistence.jpa.rs.util
Class LinkAdapter

java.lang.Object
  extended by javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.lang.Object>
      extended by org.eclipse.persistence.jpa.rs.util.LinkAdapter

public class LinkAdapter
extends XmlAdapter<java.lang.String,java.lang.Object>

Used with JAXB to convert from a URL representing an relationship to an object It provides functionality at marshall and unmarshall time At marshall time, the target of a relationship will be marshalled as a URL that could be used to find the object through a REST service At unmarsall time, the URL will be deconstructed and used to find the object in JPA.

Author:
tware

Field Summary
protected  PersistenceContext context
           
 
Constructor Summary
LinkAdapter()
           
LinkAdapter(java.lang.String baseURI, PersistenceContext context)
           
 
Method Summary
protected  java.lang.Object constructObjectForId(java.lang.String entityType, java.lang.Object id)
           
 java.lang.String marshal(java.lang.Object v)
          Convert a bound type to a value type.
 java.lang.Object unmarshal(java.lang.String v)
          Convert a value type to a bound type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected PersistenceContext context
Constructor Detail

LinkAdapter

public LinkAdapter()

LinkAdapter

public LinkAdapter(java.lang.String baseURI,
                   PersistenceContext context)
Method Detail

unmarshal

public java.lang.Object unmarshal(java.lang.String v)
                           throws java.lang.Exception
Description copied from class: XmlAdapter
Convert a value type to a bound type.

Specified by:
unmarshal in class XmlAdapter<java.lang.String,java.lang.Object>
Parameters:
v - The value to be converted. Can be null.
Throws:
java.lang.Exception - if there's an error during the conversion. The caller is responsible for reporting the error to the user through ValidationEventHandler.

constructObjectForId

protected java.lang.Object constructObjectForId(java.lang.String entityType,
                                                java.lang.Object id)

marshal

public java.lang.String marshal(java.lang.Object v)
                         throws java.lang.Exception
Description copied from class: XmlAdapter
Convert a bound type to a value type.

Specified by:
marshal in class XmlAdapter<java.lang.String,java.lang.Object>
Parameters:
v - The value to be convereted. Can be null.
Throws:
java.lang.Exception - if there's an error during the conversion. The caller is responsible for reporting the error to the user through ValidationEventHandler.

EclipseLink 2.4.0, build 'v20120608-r11652' API Reference