Class EntityGraphProviderImpl

java.lang.Object
org.glassfish.jersey.message.filtering.EntityGraphProviderImpl
All Implemented Interfaces:
EntityGraphProvider

final class EntityGraphProviderImpl extends Object implements EntityGraphProvider
Provides entity graph and object graph instances.
  • Field Details

  • Constructor Details

    • EntityGraphProviderImpl

      EntityGraphProviderImpl()
  • Method Details

    • getOrCreateEntityGraph

      public EntityGraph getOrCreateEntityGraph(Class<?> entityClass, boolean forWriter)
      Description copied from interface: EntityGraphProvider
      Get an entity graph for given class. New graph is created if no graph exists for given class.
      Specified by:
      getOrCreateEntityGraph in interface EntityGraphProvider
      Parameters:
      entityClass - entity class the graph should be created for.
      forWriter - flag determining whether the graph should be created for writer/reader.
      Returns:
      an entity graph.
    • getOrCreateEmptyEntityGraph

      public EntityGraph getOrCreateEmptyEntityGraph(Class<?> entityClass, boolean forWriter)
      Description copied from interface: EntityGraphProvider
      Get an empty entity graph for given class. New graph is created if the stored one is not an empty entity graph or no graph exists for given class. This method overrides the graph created by EntityGraphProvider.getOrCreateEntityGraph(Class, boolean) method.
      Specified by:
      getOrCreateEmptyEntityGraph in interface EntityGraphProvider
      Parameters:
      entityClass - entity class the graph should be created for.
      forWriter - flag determining whether the graph should be created for writer/reader.
      Returns:
      an empty entity graph.
    • asMap

      public Map<Class<?>,EntityGraph> asMap(boolean forWriter)
      Return an unmodifiable map of entity graphs for reader/writer.
      Parameters:
      forWriter - flag determining whether the returned map should be for writer/reader.
      Returns:
      an unmodifiable map of entity graphs.
    • containsEntityGraph

      public boolean containsEntityGraph(Class<?> entityClass, boolean forWriter)
      Description copied from interface: EntityGraphProvider
      Determine whether an entity graph for given entity class has been created by this provider.
      Specified by:
      containsEntityGraph in interface EntityGraphProvider
      Parameters:
      entityClass - entity class for which the graph should be checked.
      forWriter - flag determining whether the check should be in writer/reader graphs.
      Returns:
      true if the entity graph already exists, false otherwise.
    • createObjectGraph

      public ObjectGraph createObjectGraph(Class<?> entityClass, Set<String> filteringScopes, boolean forWriter)
      Description copied from interface: EntityGraphProvider
      Create an ObjectGraph for given parameters. Every time this method is called a new instance of object graph is created.
      Specified by:
      createObjectGraph in interface EntityGraphProvider
      Parameters:
      entityClass - entity class which the object graph should be created for.
      filteringScopes - entity-filtering scopes the graph should be created for.
      forWriter - flag determining whether the graph should be created for writer/reader.
      Returns:
      an entity-filtering object graph instance.