Interface ProjectionFactory

All Known Implementing Classes:
SpelAwareProxyProjectionFactory

public interface ProjectionFactory
A factory to create projecting instances for other objects usually used to allow easy creation of representation projections to define which properties of a domain objects shall be exported in which way.
Since:
1.10
Author:
Oliver Gierke
  • Method Details

    • createProjection

      <T> T createProjection(Class<T> projectionType, Object source)
      Creates a projection of the given type for the given source object. The individual mapping strategy is defined by the implementations.
      Parameters:
      projectionType - the type to create, must not be null.
      source - the object to create a projection for, must not be null.
      Returns:
    • createNullableProjection

      @Nullable default <T> T createNullableProjection(Class<T> projectionType, @Nullable Object source)
      Creates a projection to the given type for the given nullable source.
      Parameters:
      projectionType - must not be null.
      source - can be null.
      Returns:
    • createProjection

      <T> T createProjection(Class<T> projectionType)
      Creates a projection instance for the given type.
      Parameters:
      projectionType - the type to create, must not be null.
      Returns:
    • getProjectionInformation

      ProjectionInformation getProjectionInformation(Class<?> projectionType)
      Returns the ProjectionInformation for the given projection type.
      Parameters:
      projectionType - must not be null.
      Returns:
      Since:
      1.12