Class EntityGraphProviderImpl
java.lang.Object
org.glassfish.jersey.message.filtering.EntityGraphProviderImpl
- All Implemented Interfaces:
EntityGraphProvider
Provides
entity graph
and object graph
instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap
<Class<?>, EntityGraph> private final ConcurrentMap
<Class<?>, EntityGraph> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap
<Class<?>, EntityGraph> asMap
(boolean forWriter) Return an unmodifiable map of entity graphs for reader/writer.boolean
containsEntityGraph
(Class<?> entityClass, boolean forWriter) Determine whether an entity graph for given entity class has been created by this provider.createObjectGraph
(Class<?> entityClass, Set<String> filteringScopes, boolean forWriter) Create anObjectGraph
for given parameters.getOrCreateEmptyEntityGraph
(Class<?> entityClass, boolean forWriter) Get an empty entity graph for given class.getOrCreateEntityGraph
(Class<?> entityClass, boolean forWriter) Get an entity graph for given class.
-
Field Details
-
writerClassToGraph
-
readerClassToGraph
-
-
Constructor Details
-
EntityGraphProviderImpl
EntityGraphProviderImpl()
-
-
Method Details
-
getOrCreateEntityGraph
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 interfaceEntityGraphProvider
- 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
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 byEntityGraphProvider.getOrCreateEntityGraph(Class, boolean)
method.- Specified by:
getOrCreateEmptyEntityGraph
in interfaceEntityGraphProvider
- 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
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
Description copied from interface:EntityGraphProvider
Determine whether an entity graph for given entity class has been created by this provider.- Specified by:
containsEntityGraph
in interfaceEntityGraphProvider
- 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 anObjectGraph
for given parameters. Every time this method is called a new instance of object graph is created.- Specified by:
createObjectGraph
in interfaceEntityGraphProvider
- 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.
-