Class ProjectionManager
java.lang.Object
com.broadleafcommerce.common.extension.projection.ProjectionManager
Handles projection creation through the
ProjectionFactory
, and is further responsible for
registering type extensions with the TypeFactory
, as well as registering any required
deserializer modules with the Jackson ObjectMapper
for appropriate deserialization to the
projection upon entry into the service endpoint.- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorDescriptionProjectionManager
(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescription<T> void
processCandidate
(Class<T> repoEntityClass, Class<T> candidate) Given a class identified as managed by aRepository
, and a candidate domain class (either the same, or possibly more derived type), process all projection creation, type factory registration, and ObjectMapper deserialization module registration.<T> void
processProjection
(Class<T> repoEntityClass, Class<T> candidate, Class<?> autoProjectionType, boolean force) Given a class identified as managed by aRepository
, and a candidate domain class (either the same, or possibly more derived type), process all projection creation, type factory registration, and ObjectMapper deserialization module registration.<T> void
processProjection
(Class<T> repoEntityClass, String projectionName) Given a class identified as managed by aRepository
, and a target simple name for a projection class based on the managed class, process all projection creation, type factory registration, and ObjectMapper deserialization module registration.
-
Constructor Details
-
ProjectionManager
public ProjectionManager(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
processCandidate
Given a class identified as managed by aRepository
, and a candidate domain class (either the same, or possibly more derived type), process all projection creation, type factory registration, and ObjectMapper deserialization module registration.- Type Parameters:
T
- The shared domain class type- Parameters:
repoEntityClass
- A class identified as managed by aRepository
candidate
- Either the same as repoEntityClass, or possibly more derived type
-
processProjection
Given a class identified as managed by aRepository
, and a target simple name for a projection class based on the managed class, process all projection creation, type factory registration, and ObjectMapper deserialization module registration.- Type Parameters:
T
- The shared domain class type- Parameters:
repoEntityClass
- A class identified as managed by aRepository
projectionName
- The simple name of the target projection class
-
processProjection
public <T> void processProjection(Class<T> repoEntityClass, Class<T> candidate, Class<?> autoProjectionType, boolean force) Given a class identified as managed by aRepository
, and a candidate domain class (either the same, or possibly more derived type), process all projection creation, type factory registration, and ObjectMapper deserialization module registration. This case is different thanprocessCandidate(Class, Class)
.processCandidate
is intended for cases where a auto projection does not yet exist, whereas usage here is primarily intended for classloader injection use cases where a auto projection was pre-created.- Type Parameters:
T
- The shared domain class type- Parameters:
repoEntityClass
- A class identified as managed by aRepository
candidate
- Either the same as repoEntityClass, or possibly more derived typeautoProjectionType
- The auto projection already created to processforce
- Whether or not to force the processing of this projection if one is already registered for the candidate
-