Class ComponentBag.ImmutableComponentBag
java.lang.Object
org.glassfish.jersey.model.internal.ComponentBag
org.glassfish.jersey.model.internal.ComponentBag.ImmutableComponentBag
- Enclosing class:
- ComponentBag
Immutable version of
ComponentBag
.-
Field Summary
Fields inherited from class org.glassfish.jersey.model.internal.ComponentBag
AS_IS, BINDERS_ONLY, EXCLUDE_EMPTY, EXECUTOR_SERVICE_PROVIDER_ONLY, EXTERNAL_ONLY, INCLUDE_ALL, SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all the component registrations and resets the component bag instance to a state as if it was create anew.copy()
Get a copy of this component bag.Get immutable copy of a component bag.boolean
register
(Class<?> componentClass, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider with an explicitly specified binding priority.boolean
register
(Class<?> componentClass, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider for the specified contracts.boolean
register
(Class<?> componentClass, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider for the specified contracts.boolean
register
(Class<?> componentClass, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class using a given registration strategy.boolean
register
(Object component, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider with an explicitly specified binding priority.boolean
register
(Object component, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider for the specified contracts.boolean
register
(Object component, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider for the specified contracts.boolean
register
(Object component, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component using a given registration strategy.Methods inherited from class org.glassfish.jersey.model.internal.ComponentBag
excludeMetaProviders, getClasses, getClasses, getFromBinders, getInstances, getInstances, getModel, getRegistrations, loadFrom, modelFor, newInstance
-
Constructor Details
-
ImmutableComponentBag
ImmutableComponentBag(ComponentBag original)
-
-
Method Details
-
register
public boolean register(Class<?> componentClass, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component class using a given registration strategy.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered, based on the registration strategy decision.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Class<?> componentClass, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component class as a contract provider with an explicitly specified binding priority.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.priority
- explicitly specified binding priority for the provider contracts implemented by the component.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Class<?> componentClass, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component class as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.contracts
- contracts to bind the component class to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Class<?> componentClass, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component class as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
componentClass
- class to be introspected as a contract provider and registered.contracts
- contracts with their priorities to bind the component class to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Object component, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component using a given registration strategy.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Object component, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component as a contract provider with an explicitly specified binding priority.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.priority
- explicitly specified binding priority for the provider contracts implemented by the component.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Object component, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.contracts
- contracts to bind the component to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
register
public boolean register(Object component, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBag
Register a component as a contract provider for the specified contracts.- Overrides:
register
in classComponentBag
- Parameters:
component
- instance to be introspected as a contract provider and registered, based on the registration strategy decision.contracts
- contracts with their priorities to bind the component to.modelEnhancer
- custom contract provider model enhancer.- Returns:
true
if the component registration was successful.
-
copy
Description copied from class:ComponentBag
Get a copy of this component bag.- Overrides:
copy
in classComponentBag
- Returns:
- component bag copy.
-
immutableCopy
Description copied from class:ComponentBag
Get immutable copy of a component bag.- Overrides:
immutableCopy
in classComponentBag
- Returns:
- immutable view of a component bag.
-
clear
public void clear()Description copied from class:ComponentBag
Removes all the component registrations and resets the component bag instance to a state as if it was create anew.- Overrides:
clear
in classComponentBag
-