Class CommonScopeProvider
java.lang.Object
org.glassfish.jersey.message.filtering.CommonScopeProvider
- All Implemented Interfaces:
ScopeProvider
- Direct Known Subclasses:
ServerScopeProvider
Default implementation of
scope provider. This class can be used on client to retrieve
entity-filtering scopes from given entity annotations or injected configuration. Class can also serve
as a base class for server-side implementations.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final javax.ws.rs.core.Configurationprivate static final Loggerprivate final List<ScopeResolver> Fields inherited from interface ScopeProvider
DEFAULT_SCOPE -
Constructor Summary
ConstructorsConstructorDescriptionCommonScopeProvider(javax.ws.rs.core.Configuration config, InjectionManager injectionManager) Create new common scope provider with injectedconfigurationandinjection manager. -
Method Summary
Modifier and TypeMethodDescriptiongetFilteringScopes(Annotation[] annotations) Get entity-filtering scopes from all availablescope resolversfor given annotations.getFilteringScopes(Annotation[] entityAnnotations, boolean defaultIfNotFound) Get entity-filtering scopes to be used to process an entity.getFilteringScopes(javax.ws.rs.core.Configuration config) Get entity-filtering scopes fromConfiguration.protected voidmergeFilteringScopes(Set<String> filteringScopes, Set<String> resolvedScopes) Merge two sets of entity-filtering scopes.returnFilteringScopes(Set<String> filteringScopes, boolean returnDefaultFallback) Return the default entity-filtering scope if the given set of scopes is empty and the processing should fallback to the default.
-
Field Details
-
LOGGER
-
resolvers
-
config
private final javax.ws.rs.core.Configuration config
-
-
Constructor Details
-
CommonScopeProvider
@Inject public CommonScopeProvider(javax.ws.rs.core.Configuration config, InjectionManager injectionManager) Create new common scope provider with injectedconfigurationandinjection manager.
-
-
Method Details
-
getFilteringScopes
Description copied from interface:ScopeProviderGet entity-filtering scopes to be used to process an entity.- Specified by:
getFilteringScopesin interfaceScopeProvider- Parameters:
entityAnnotations- entity annotations provided with entity when creating request/response.defaultIfNotFound- flag determining whether the default entity-filtering scope should be returned if no other scope can be obtained.- Returns:
- non-null entity-filtering scopes.
-
returnFilteringScopes
protected Set<String> returnFilteringScopes(Set<String> filteringScopes, boolean returnDefaultFallback) Return the default entity-filtering scope if the given set of scopes is empty and the processing should fallback to the default.- Parameters:
filteringScopes- entity-filtering scopes to be examined.returnDefaultFallback-trueif the default entity-filtering scope should be returned if the given scopes are empty,falseotherwise.- Returns:
- entity-filtering scopes.
-
getFilteringScopes
Get entity-filtering scopes from all availablescope resolversfor given annotations.- Parameters:
annotations- annotations to retrieve entity-filtering scopes from.- Returns:
- entity-filtering scopes or an empty set if none scope can be resolved.
-
getFilteringScopes
-
mergeFilteringScopes
-