Class ProjectionManager
- java.lang.Object
-
- com.broadleafcommerce.common.extension.projection.ProjectionManager
-
public class ProjectionManager extends Object
Handles projection creation through theProjectionFactory
, and is further responsible for registering type extensions with theTypeFactory
, as well as registering any required deserializer modules with the JacksonObjectMapper
for appropriate deserialization to the projection upon entry into the service endpoint.- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description ProjectionManager(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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 Detail
-
ProjectionManager
public ProjectionManager(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Detail
-
processCandidate
public <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.- 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
public <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.- 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
-
-