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 graphandobject graphinstances.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,EntityGraph>readerClassToGraphprivate 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.booleancontainsEntityGraph(java.lang.Class<?> entityClass, boolean forWriter)Determine whether an entity graph for given entity class has been created by this provider.ObjectGraphcreateObjectGraph(java.lang.Class<?> entityClass, java.util.Set<java.lang.String> filteringScopes, boolean forWriter)Create anObjectGraphfor given parameters.EntityGraphgetOrCreateEmptyEntityGraph(java.lang.Class<?> entityClass, boolean forWriter)Get an empty entity graph for given class.EntityGraphgetOrCreateEntityGraph(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:EntityGraphProviderGet an entity graph for given class. New graph is created if no graph exists for given class.- Specified by:
getOrCreateEntityGraphin 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:EntityGraphProviderGet 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:
getOrCreateEmptyEntityGraphin 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:EntityGraphProviderDetermine whether an entity graph for given entity class has been created by this provider.- Specified by:
containsEntityGraphin 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:
trueif the entity graph already exists,falseotherwise.
-
createObjectGraph
public ObjectGraph createObjectGraph(java.lang.Class<?> entityClass, java.util.Set<java.lang.String> filteringScopes, boolean forWriter)
Description copied from interface:EntityGraphProviderCreate anObjectGraphfor given parameters. Every time this method is called a new instance of object graph is created.- Specified by:
createObjectGraphin 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.
-
-