Class ProjectionManager

java.lang.Object
com.broadleafcommerce.common.extension.projection.ProjectionManager

public class ProjectionManager extends Object
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

    Constructors
    Constructor
    Description
    ProjectionManager(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    processCandidate(Class<T> repoEntityClass, Class<T> candidate)
    Given a class identified as managed by a Repository, 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 a Repository, 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 a Repository, 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProjectionManager

      public ProjectionManager(TypeFactory typeFactory, ProjectionFactory projectionFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • processCandidate

      public <T> void processCandidate(Class<T> repoEntityClass, Class<T> candidate)
      Given a class identified as managed by a Repository, 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 a Repository
      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 a Repository, 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 a Repository
      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 a Repository, 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 than processCandidate(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 a Repository
      candidate - Either the same as repoEntityClass, or possibly more derived type
      autoProjectionType - The auto projection already created to process
      force - Whether or not to force the processing of this projection if one is already registered for the candidate