Class RestCollectionAdapter<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>

  • 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
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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: XmlAdapter
        Convert a value type to a bound type.
        Specified by:
        unmarshal in class XmlAdapter<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 through ValidationEventHandler.
      • 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: XmlAdapter
        Convert a bound type to a value type.
        Specified by:
        marshal in class XmlAdapter<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 through ValidationEventHandler.