Class CollectionProxyClassWriter
java.lang.Object
org.eclipse.persistence.internal.jpa.rs.weaving.CollectionProxyClassWriter
- All Implemented Interfaces:
EclipseLinkClassWriter
Generates a subclass of given collection implementing CollectionProxy interface.
CollectionProxy
- Since:
- EclipseLink 2.6.0
-
Constructor Summary
ConstructorDescriptionCollectionProxyClassWriter
(String parentClassName, String entityName, String fieldName) Creates a new CollectionProxyClassWriter for the given attribute of the given entity of given type. -
Method Summary
Modifier and TypeMethodDescriptionReturns a class name for generated CollectionProxy.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.Class
<?> boolean
isCompatible
(EclipseLinkClassWriter writer) 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; } }
-
Constructor Details
-
CollectionProxyClassWriter
Creates a new CollectionProxyClassWriter for the given attribute of the given entity of given type.- Parameters:
parentClassName
- the superclass name.entityName
- entity namefieldName
- entity attribute name
-
-
Method Details
-
getClassName
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
Returns a class name for generated CollectionProxy.getClassName(String, String)
- Returns:
- Rest collection proxy name.
-
writeClass
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 interfaceEclipseLinkClassWriter
-
isCompatible
- Specified by:
isCompatible
in interfaceEclipseLinkClassWriter
-
getParentClass
- Specified by:
getParentClass
in interfaceEclipseLinkClassWriter
-
getParentClassName
- Specified by:
getParentClassName
in interfaceEclipseLinkClassWriter
-