Class AbstractResourceBeanMapper
java.lang.Object
org.onehippo.cms7.crisp.api.resource.AbstractResourceBeanMapper
- All Implemented Interfaces:
ResourceBeanMapper
Abstract implementation for
ResourceBeanMapper
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Collection<T>
mapCollection
(ResourceCollection resourceCollection, Class<T> beanType) Map the child resources of theResourceCollection
to a new collection ofbeanType
to return.<T> Collection<T>
mapCollection
(ResourceCollection resourceCollection, Class<T> beanType, int offset, int limit) Map the child resources of theResourceCollection
to a new collection ofbeanType
to return.<T> void
mapCollection
(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection) Map the child resources of theResourceCollection
and push them to the giventargetBeanCollection
ofbeanType
.<T> void
mapCollection
(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection, int offset, int length) Map the child resources of theResourceCollection
and push them to the giventargetBeanCollection
ofbeanType
from theoffset
index up tolimit
size at max.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.onehippo.cms7.crisp.api.resource.ResourceBeanMapper
map
-
Constructor Details
-
AbstractResourceBeanMapper
public AbstractResourceBeanMapper()
-
-
Method Details
-
mapCollection
public <T> Collection<T> mapCollection(ResourceCollection resourceCollection, Class<T> beanType) throws ResourceException Description copied from interface:ResourceBeanMapper
Map the child resources of theResourceCollection
to a new collection ofbeanType
to return.- Specified by:
mapCollection
in interfaceResourceBeanMapper
- Parameters:
resourceCollection
- aResourceCollection
objectbeanType
- type of bean to which theResource
should be mapped- Returns:
- a new collection of beans converted from the child resources of the
resourceCollection
- Throws:
ResourceException
- if aresource
cannot be mapped to thebeanType
-
mapCollection
public <T> Collection<T> mapCollection(ResourceCollection resourceCollection, Class<T> beanType, int offset, int limit) throws ResourceException Description copied from interface:ResourceBeanMapper
Map the child resources of theResourceCollection
to a new collection ofbeanType
to return.- Specified by:
mapCollection
in interfaceResourceBeanMapper
- Parameters:
resourceCollection
- aResourceCollection
objectbeanType
- type of bean to which theResource
should be mappedoffset
- start index ofresourceCollection
to convert from. If offset is a negative value, it's ignored, meaning zero index being effective.limit
- max size ofresourceCollection
to convert fromoffset
index. If limit is a negative value, it's ignored, meaning no limit being applied.- Returns:
- a new collection of beans converted from the child resources of the
resourceCollection
- Throws:
ResourceException
- if aresource
cannot be mapped to thebeanType
-
mapCollection
public <T> void mapCollection(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection) throws ResourceException Description copied from interface:ResourceBeanMapper
Map the child resources of theResourceCollection
and push them to the giventargetBeanCollection
ofbeanType
.- Specified by:
mapCollection
in interfaceResourceBeanMapper
- Parameters:
resourceCollection
- aResourceCollection
objectbeanType
- type of bean to which theResource
should be mappedtargetBeanCollection
- target collection of beans converted from the child resources of theresourceCollection
.- Throws:
ResourceException
- if aresource
cannot be mapped to thebeanType
-
mapCollection
public <T> void mapCollection(ResourceCollection resourceCollection, Class<T> beanType, Collection<T> targetBeanCollection, int offset, int length) throws ResourceException Description copied from interface:ResourceBeanMapper
Map the child resources of theResourceCollection
and push them to the giventargetBeanCollection
ofbeanType
from theoffset
index up tolimit
size at max.- Specified by:
mapCollection
in interfaceResourceBeanMapper
- Parameters:
resourceCollection
- aResourceCollection
objectbeanType
- type of bean to which theResource
should be mappedtargetBeanCollection
- target collection of beans converted from the child resources of theresourceCollection
.offset
- start index ofresourceCollection
to convert from. If offset is a negative value, it's ignored, meaning zero index being effective.length
- max size ofresourceCollection
to convert fromoffset
index. If limit is a negative value, it's ignored, meaning no limit being applied.- Throws:
ResourceException
- if aresource
cannot be mapped to thebeanType
-