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 TypeMethodDescriptionvoidclear()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.booleanregister(Class<?> componentClass, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider with an explicitly specified binding priority.booleanregister(Class<?> componentClass, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider for the specified contracts.booleanregister(Class<?> componentClass, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class as a contract provider for the specified contracts.booleanregister(Class<?> componentClass, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component class using a given registration strategy.booleanregister(Object component, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider with an explicitly specified binding priority.booleanregister(Object component, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider for the specified contracts.booleanregister(Object component, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Register a component as a contract provider for the specified contracts.booleanregister(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:ComponentBagRegister a component class using a given registration strategy.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Class<?> componentClass, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component class as a contract provider with an explicitly specified binding priority.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Class<?> componentClass, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component class as a contract provider for the specified contracts.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Class<?> componentClass, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component class as a contract provider for the specified contracts.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Object component, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component using a given registration strategy.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Object component, int priority, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component as a contract provider with an explicitly specified binding priority.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Object component, Set<Class<?>> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component as a contract provider for the specified contracts.- Overrides:
registerin 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:
trueif the component registration was successful.
-
register
public boolean register(Object component, Map<Class<?>, Integer> contracts, Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) Description copied from class:ComponentBagRegister a component as a contract provider for the specified contracts.- Overrides:
registerin 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:
trueif the component registration was successful.
-
copy
Description copied from class:ComponentBagGet a copy of this component bag.- Overrides:
copyin classComponentBag- Returns:
- component bag copy.
-
immutableCopy
Description copied from class:ComponentBagGet immutable copy of a component bag.- Overrides:
immutableCopyin classComponentBag- Returns:
- immutable view of a component bag.
-
clear
public void clear()Description copied from class:ComponentBagRemoves all the component registrations and resets the component bag instance to a state as if it was create anew.- Overrides:
clearin classComponentBag
-