Class EntityGraphImpl
java.lang.Object
org.glassfish.jersey.message.filtering.EntityGraphImpl
- All Implemented Interfaces:
EntityGraph
Default implementation of
EntityGraph
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEntityGraphImpl
(Class<?> entityClass) Create an entity graph for given class. -
Method Summary
Modifier and TypeMethodDescriptionAdd a field into this graph for all existing entity-filtering scopes.Add a field into this graph for given list of entity-filtering scopes.Add a field into this graph for given set of entity-filtering scopes.addFilteringScopes
(Set<String> filteringScopes) Add a set of entity-filtering scopes to this graph.addSubgraph
(String fieldName, Class<?> fieldClass) Add a subgraph into this graph for all existing entity-filtering scopes.addSubgraph
(String fieldName, Class<?> fieldClass, String... filteringScopes) Add a subgraph into this graph for given list of entity-filtering scopes.addSubgraph
(String fieldName, Class<?> fieldClass, Set<String> filteringScopes) Add a subgraph into this graph for given set of entity-filtering scopes.private void
createFilteringScope
(String filteringScope) Create a new entity-filtering scope based on thedefault one
.boolean
Get all available entity-filtering scopes defined on a class.Class
<?> Get an entity class this graph is created for.Get fields for given entity-filtering scope.Get fields for given entity-filtering scopes.Get fields for given entity-filtering scopes.Get all available entity-filtering scopes.getSubgraphs
(String filteringScope) Get subgraphs for given entity-filtering scope.getSubgraphs
(String... filteringScopes) Get subgraphs for given entity-filtering scopes.getSubgraphs
(Set<String> filteringScopes) Get subgraphs for given entity-filtering scopes.int
hashCode()
boolean
presentInScope
(String field, String filteringScope) Determines whether a field/subgraph is present in ANY of the given scopes.boolean
presentInScopes
(String name) Determines whether a field/subgraph is present in ANY of the existing scopes.Remove a field/subgraph from the graph (all entity-filtering scopes).
-
Field Details
-
entityClass
-
globalScopes
-
localScopes
-
fields
-
subgraphs
-
-
Constructor Details
-
EntityGraphImpl
Create an entity graph for given class.- Parameters:
entityClass
- entity class the graph should be created for.
-
-
Method Details
-
addField
Description copied from interface:EntityGraph
Add a field into this graph for all existing entity-filtering scopes.- Specified by:
addField
in interfaceEntityGraph
- Parameters:
fieldName
- name of the field to be added.- Returns:
- an entity-filtering graph instance.
-
addField
Description copied from interface:EntityGraph
Add a field into this graph for given list of entity-filtering scopes.- Specified by:
addField
in interfaceEntityGraph
- Parameters:
fieldName
- name of the field to be added.filteringScopes
- entity-filtering scopes for the field.- Returns:
- an entity-filtering graph instance.
-
addField
Description copied from interface:EntityGraph
Add a field into this graph for given set of entity-filtering scopes.- Specified by:
addField
in interfaceEntityGraph
- Parameters:
fieldName
- name of the field to be added.filteringScopes
- entity-filtering scopes for the field.- Returns:
- an entity-filtering graph instance.
-
addFilteringScopes
Description copied from interface:EntityGraph
Add a set of entity-filtering scopes to this graph.- Specified by:
addFilteringScopes
in interfaceEntityGraph
- Parameters:
filteringScopes
- entity-filtering scopes to be added.- Returns:
- an entity-filtering graph instance.
-
addSubgraph
Description copied from interface:EntityGraph
Add a subgraph into this graph for all existing entity-filtering scopes.- Specified by:
addSubgraph
in interfaceEntityGraph
- Parameters:
fieldName
- name of the subgraph field to be added.fieldClass
- entity class representing the subgraph.- Returns:
- an entity-filtering graph instance.
-
addSubgraph
public EntityGraphImpl addSubgraph(String fieldName, Class<?> fieldClass, String... filteringScopes) Description copied from interface:EntityGraph
Add a subgraph into this graph for given list of entity-filtering scopes.- Specified by:
addSubgraph
in interfaceEntityGraph
- Parameters:
fieldName
- name of the subgraph field to be added.fieldClass
- entity class representing the subgraph.filteringScopes
- entity-filtering scopes for the subgraph.- Returns:
- an entity-filtering graph instance.
-
addSubgraph
public EntityGraphImpl addSubgraph(String fieldName, Class<?> fieldClass, Set<String> filteringScopes) Description copied from interface:EntityGraph
Add a subgraph into this graph for given set of entity-filtering scopes.- Specified by:
addSubgraph
in interfaceEntityGraph
- Parameters:
fieldName
- name of the subgraph field to be added.fieldClass
- entity class representing the subgraph.filteringScopes
- entity-filtering scopes for the subgraph.- Returns:
- an entity-filtering graph instance.
-
getEntityClass
Description copied from interface:EntityGraph
Get an entity class this graph is created for.- Specified by:
getEntityClass
in interfaceEntityGraph
- Returns:
- an entity class.
-
getFields
Description copied from interface:EntityGraph
Get fields for given entity-filtering scope.- Specified by:
getFields
in interfaceEntityGraph
- Parameters:
filteringScope
- scope the returned fields have to be in.- Returns:
- set of fields present in given scope.
-
getFields
Description copied from interface:EntityGraph
Get fields for given entity-filtering scopes.- Specified by:
getFields
in interfaceEntityGraph
- Parameters:
filteringScopes
- scopes the returned fields have to be in.- Returns:
- set of fields present in given scopes.
-
getFields
Description copied from interface:EntityGraph
Get fields for given entity-filtering scopes.- Specified by:
getFields
in interfaceEntityGraph
- Parameters:
filteringScopes
- scopes the returned fields have to be in.- Returns:
- set of fields present in given scopes.
-
getFilteringScopes
Description copied from interface:EntityGraph
Get all available entity-filtering scopes.- Specified by:
getFilteringScopes
in interfaceEntityGraph
- Returns:
- all available entity-filtering scopes.
-
getClassFilteringScopes
Description copied from interface:EntityGraph
Get all available entity-filtering scopes defined on a class.- Specified by:
getClassFilteringScopes
in interfaceEntityGraph
- Returns:
- all available entity-filtering scopes.
-
getSubgraphs
Description copied from interface:EntityGraph
Get subgraphs for given entity-filtering scope.- Specified by:
getSubgraphs
in interfaceEntityGraph
- Parameters:
filteringScope
- scope the returned subgraphs have to be in.- Returns:
- map of subgraphs present in given scope.
-
getSubgraphs
Description copied from interface:EntityGraph
Get subgraphs for given entity-filtering scopes.- Specified by:
getSubgraphs
in interfaceEntityGraph
- Parameters:
filteringScopes
- scopes the returned subgraphs have to be in.- Returns:
- map of subgraphs present in given scopes.
-
getSubgraphs
Description copied from interface:EntityGraph
Get subgraphs for given entity-filtering scopes.- Specified by:
getSubgraphs
in interfaceEntityGraph
- Parameters:
filteringScopes
- scopes the returned subgraphs have to be in.- Returns:
- map of subgraphs present in given scopes.
-
presentInScopes
Description copied from interface:EntityGraph
Determines whether a field/subgraph is present in ANY of the existing scopes.- Specified by:
presentInScopes
in interfaceEntityGraph
- Parameters:
name
- field to be checked.- Returns:
true
if field is present in ANY of the existing scopes,false
otherwise.
-
presentInScope
Description copied from interface:EntityGraph
Determines whether a field/subgraph is present in ANY of the given scopes. If no scopes are given the return value determines whether the field is present in any scope.- Specified by:
presentInScope
in interfaceEntityGraph
- Parameters:
field
- field to be checked.filteringScope
- entity-filtering scope.- Returns:
true
if field is present in the given scope,false
otherwise.
-
remove
Description copied from interface:EntityGraph
Remove a field/subgraph from the graph (all entity-filtering scopes).- Specified by:
remove
in interfaceEntityGraph
- Parameters:
fieldName
- name of the field/subgraph to be removed.- Returns:
- an entity-filtering graph instance.
-
createFilteringScope
Create a new entity-filtering scope based on thedefault one
.- Parameters:
filteringScope
- entity-filtering scope to be created.
-
equals
-
hashCode
public int hashCode()
-