public interface EntityGraph
entity-filtering processors providing means to add/remove entity-filtering scopes
(e.g. based on annotations) for entity members.
Differences between this class and object graph:
EntityGraph can be modified, ObjectGraph is read-only.EntityGraph contains information about all entity-filtering scopes found during inspecting an entity class,
ObjectGraph provides information about entity to create a filtering object for a subset of these scopes
(which are determined from the current context).ScopeResolver.ScopeResolver| Modifier and Type | Method and Description |
|---|---|
EntityGraph |
addField(String fieldName)
Add a field into this graph for all existing entity-filtering scopes.
|
EntityGraph |
addField(String fieldName,
Set<String> filteringScopes)
Add a field into this graph for given set of entity-filtering scopes.
|
EntityGraph |
addField(String fieldName,
String... filteringScopes)
Add a field into this graph for given list of entity-filtering scopes.
|
EntityGraph |
addFilteringScopes(Set<String> filteringScopes)
Add a set of entity-filtering scopes to this graph.
|
EntityGraph |
addSubgraph(String fieldName,
Class<?> fieldClass)
Add a subgraph into this graph for all existing entity-filtering scopes.
|
EntityGraph |
addSubgraph(String fieldName,
Class<?> fieldClass,
Set<String> filteringScopes)
Add a subgraph into this graph for given set of entity-filtering scopes.
|
EntityGraph |
addSubgraph(String fieldName,
Class<?> fieldClass,
String... filteringScopes)
Add a subgraph into this graph for given list of entity-filtering scopes.
|
Set<String> |
getClassFilteringScopes()
Get all available entity-filtering scopes defined on a class.
|
Class<?> |
getEntityClass()
Get an entity class this graph is created for.
|
Set<String> |
getFields(Set<String> filteringScopes)
Get fields for given entity-filtering scopes.
|
Set<String> |
getFields(String... filteringScopes)
Get fields for given entity-filtering scopes.
|
Set<String> |
getFields(String filteringScope)
Get fields for given entity-filtering scope.
|
Set<String> |
getFilteringScopes()
Get all available entity-filtering scopes.
|
Map<String,Class<?>> |
getSubgraphs(Set<String> filteringScopes)
Get subgraphs for given entity-filtering scopes.
|
Map<String,Class<?>> |
getSubgraphs(String... filteringScopes)
Get subgraphs for given entity-filtering scopes.
|
Map<String,Class<?>> |
getSubgraphs(String filteringScope)
Get subgraphs for given entity-filtering scope.
|
boolean |
presentInScope(String field,
String filteringScope)
Determines whether a field/subgraph is present in ANY of the given scopes.
|
boolean |
presentInScopes(String field)
Determines whether a field/subgraph is present in ANY of the existing scopes.
|
EntityGraph |
remove(String name)
Remove a field/subgraph from the graph (all entity-filtering scopes).
|
EntityGraph addField(String fieldName)
fieldName - name of the field to be added.EntityGraph addField(String fieldName, String... filteringScopes)
fieldName - name of the field to be added.filteringScopes - entity-filtering scopes for the field.EntityGraph addField(String fieldName, Set<String> filteringScopes)
fieldName - name of the field to be added.filteringScopes - entity-filtering scopes for the field.EntityGraph addSubgraph(String fieldName, Class<?> fieldClass)
fieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.EntityGraph addSubgraph(String fieldName, Class<?> fieldClass, String... filteringScopes)
fieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.filteringScopes - entity-filtering scopes for the subgraph.EntityGraph addSubgraph(String fieldName, Class<?> fieldClass, Set<String> filteringScopes)
fieldName - name of the subgraph field to be added.fieldClass - entity class representing the subgraph.filteringScopes - entity-filtering scopes for the subgraph.EntityGraph addFilteringScopes(Set<String> filteringScopes)
filteringScopes - entity-filtering scopes to be added.boolean presentInScope(String field, String filteringScope)
field - field to be checked.filteringScope - entity-filtering scope.true if field is present in the given scope, false otherwise.boolean presentInScopes(String field)
field - field to be checked.true if field is present in ANY of the existing scopes, false otherwise.Class<?> getEntityClass()
Set<String> getFields(String filteringScope)
filteringScope - scope the returned fields have to be in.Set<String> getFields(String... filteringScopes)
filteringScopes - scopes the returned fields have to be in.Set<String> getFields(Set<String> filteringScopes)
filteringScopes - scopes the returned fields have to be in.Set<String> getFilteringScopes()
Set<String> getClassFilteringScopes()
Map<String,Class<?>> getSubgraphs(String filteringScope)
filteringScope - scope the returned subgraphs have to be in.Map<String,Class<?>> getSubgraphs(String... filteringScopes)
filteringScopes - scopes the returned subgraphs have to be in.Map<String,Class<?>> getSubgraphs(Set<String> filteringScopes)
filteringScopes - scopes the returned subgraphs have to be in.EntityGraph remove(String name)
name - name of the field/subgraph to be removed.Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.