Class RestCollectionAdapter<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>
- java.lang.Object
-
- javax.xml.bind.annotation.adapters.XmlAdapter<org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T>,java.util.Collection<T>>
-
- org.eclipse.persistence.jpa.rs.util.xmladapters.RestCollectionAdapter<T>
-
- Type Parameters:
T- list generac type
public class RestCollectionAdapter<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest> extends XmlAdapter<org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T>,java.util.Collection<T>>
Collections adapter used in JPARS V2. Collections are wrapped into CollectionWrapper which has 'links'.- See Also:
CollectionWrapper- Author:
- Dmitry Kornilov
- Since:
- EclipseLink 2.6.0
-
-
Field Summary
Fields Modifier and Type Field Description protected PersistenceContextcontext
-
Constructor Summary
Constructors Constructor Description RestCollectionAdapter()RestCollectionAdapter(PersistenceContext context)Instantiates a new RestCollectionAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T>marshal(java.util.Collection<T> v)Convert a bound type to a value type.java.util.Collection<T>unmarshal(org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T> v)Convert a value type to a bound type.
-
-
-
Field Detail
-
context
protected PersistenceContext context
-
-
Constructor Detail
-
RestCollectionAdapter
public RestCollectionAdapter()
-
RestCollectionAdapter
public RestCollectionAdapter(PersistenceContext context)
Instantiates a new RestCollectionAdapter.- Parameters:
context- persistent context
-
-
Method Detail
-
unmarshal
public java.util.Collection<T> unmarshal(org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T> v) throws java.lang.Exception
Description copied from class:XmlAdapterConvert a value type to a bound type.- Specified by:
unmarshalin classXmlAdapter<org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>,java.util.Collection<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>>- 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 throughValidationEventHandler.
-
marshal
public org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T> marshal(java.util.Collection<T> v) throws java.lang.Exception
Description copied from class:XmlAdapterConvert a bound type to a value type.- Specified by:
marshalin classXmlAdapter<org.eclipse.persistence.internal.jpa.rs.metadata.model.CollectionWrapper<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>,java.util.Collection<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>>- 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 throughValidationEventHandler.
-
-