Class EntityGraphProviderImpl
- java.lang.Object
-
- org.glassfish.jersey.message.filtering.EntityGraphProviderImpl
-
- All Implemented Interfaces:
EntityGraphProvider
final class EntityGraphProviderImpl extends java.lang.Object implements EntityGraphProvider
Providesentity graph
andobject graph
instances.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,EntityGraph>
readerClassToGraph
private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,EntityGraph>
writerClassToGraph
-
Constructor Summary
Constructors Constructor Description EntityGraphProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.Class<?>,EntityGraph>
asMap(boolean forWriter)
Return an unmodifiable map of entity graphs for reader/writer.boolean
containsEntityGraph(java.lang.Class<?> entityClass, boolean forWriter)
Determine whether an entity graph for given entity class has been created by this provider.ObjectGraph
createObjectGraph(java.lang.Class<?> entityClass, java.util.Set<java.lang.String> filteringScopes, boolean forWriter)
Create anObjectGraph
for given parameters.EntityGraph
getOrCreateEmptyEntityGraph(java.lang.Class<?> entityClass, boolean forWriter)
Get an empty entity graph for given class.EntityGraph
getOrCreateEntityGraph(java.lang.Class<?> entityClass, boolean forWriter)
Get an entity graph for given class.
-
-
-
Field Detail
-
writerClassToGraph
private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,EntityGraph> writerClassToGraph
-
readerClassToGraph
private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,EntityGraph> readerClassToGraph
-
-
Method Detail
-
getOrCreateEntityGraph
public EntityGraph getOrCreateEntityGraph(java.lang.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 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
public EntityGraph getOrCreateEmptyEntityGraph(java.lang.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 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
public java.util.Map<java.lang.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(java.lang.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 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(java.lang.Class<?> entityClass, java.util.Set<java.lang.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.
-
-