Class PersistentEntityProjector

java.lang.Object
org.springframework.data.rest.webmvc.support.DefaultExcerptProjector
org.springframework.data.rest.webmvc.support.PersistentEntityProjector
All Implemented Interfaces:
ExcerptProjector, Projector

public class PersistentEntityProjector extends DefaultExcerptProjector implements Projector
Projector looking up a projection by name for the given source type.
Author:
Oliver Gierke
  • Constructor Details

    • PersistentEntityProjector

      public PersistentEntityProjector(org.springframework.data.rest.core.projection.ProjectionDefinitions projectionDefinitions, ProjectionFactory factory, String projection, org.springframework.data.rest.core.mapping.ResourceMappings mappings)
      Creates a new PersistentEntityProjector using the given ProjectionDefinitions, ProjectionFactory and projection name.
      Parameters:
      projectionDefinitions - must not be null.
      factory - must not be null.
      projection - can be empty.
  • Method Details

    • project

      public Object project(Object source)
      Description copied from interface: Projector
      Returns the projection object for the given source. This may result in the same object being returned or a completely different acting as projection for the source.
      Specified by:
      project in interface Projector
      Parameters:
      source - must not be null.
      Returns:
    • projectExcerpt

      public Object projectExcerpt(Object source)
      Description copied from interface: ExcerptProjector
      Creates a excerpt projection for the given source. If no excerpt projection is available, the object will be returned as is. If you completely wish to skip handling the object, check for the presence of an excerpt projection using ExcerptProjector.hasExcerptProjection(Class).
      Specified by:
      projectExcerpt in interface ExcerptProjector
      Overrides:
      projectExcerpt in class DefaultExcerptProjector
      Parameters:
      source - must not be null.
      Returns: