java.lang.Object
org.eclipse.persistence.internal.jpa.rs.weaving.CollectionProxyClassWriter
All Implemented Interfaces:
EclipseLinkClassWriter

public class CollectionProxyClassWriter extends Object implements EclipseLinkClassWriter
Generates a subclass of given collection implementing CollectionProxy interface. CollectionProxy
Since:
EclipseLink 2.6.0
  • Constructor Details

    • CollectionProxyClassWriter

      public CollectionProxyClassWriter(String parentClassName, String entityName, String fieldName)
      Creates a new CollectionProxyClassWriter for the given attribute of the given entity of given type.
      Parameters:
      parentClassName - the superclass name.
      entityName - entity name
      fieldName - entity attribute name
  • Method Details

    • getClassName

      public static String getClassName(String entityName, String fieldName)
      Returns a class name for CollectionProxy based on parent class name and field name to generate proxy for. The name is constructed as _<className>_<fieldName>_RestCollectionProxy.
      Parameters:
      entityName - full class name (including package)
      fieldName - field name
      Returns:
      Rest collection proxy name.
    • getClassName

      public String getClassName()
      Returns a class name for generated CollectionProxy. getClassName(String, String)
      Returns:
      Rest collection proxy name.
    • writeClass

      public byte[] writeClass(DynamicClassLoader loader, String className)
      public class Proxy extends SuperType implements CollectionProxy { private List<LinkV2> links; public CollectionProxy(Collection c) { super(); this.addAll(c); } @Override public List<LinkV2> getLinks() { return links; } @Override public void setLinks(List<LinkV2> links) { this.links = links; } }
      Specified by:
      writeClass in interface EclipseLinkClassWriter
    • isCompatible

      public boolean isCompatible(EclipseLinkClassWriter writer)
      Specified by:
      isCompatible in interface EclipseLinkClassWriter
    • getParentClass

      public Class<?> getParentClass()
      Specified by:
      getParentClass in interface EclipseLinkClassWriter
    • getParentClassName

      public String getParentClassName()
      Specified by:
      getParentClassName in interface EclipseLinkClassWriter