org.glassfish.jersey.server.internal.inject
Class AbstractValueFactoryProvider<A extends Annotation>

java.lang.Object
  extended by org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider<A>
Type Parameters:
A - injection annotation type that is supported by the provider.
All Implemented Interfaces:
ValueFactoryProvider

public abstract class AbstractValueFactoryProvider<A extends Annotation>
extends Object
implements ValueFactoryProvider

A parameter value factory provider that provides parameter value factories which are using MultivaluedParameterExtractorProvider to extract parameter values from the supplied multivalued parameter map.

Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.jersey.server.spi.internal.ValueFactoryProvider
ValueFactoryProvider.Priority, ValueFactoryProvider.PriorityType
 
Constructor Summary
protected AbstractValueFactoryProvider(MultivaluedParameterExtractorProvider mpep, ServiceLocator injector, Parameter.Source... compatibleSources)
          Initialize the provider.
 
Method Summary
protected abstract  Factory<?> createValueFactory(Parameter parameter)
          Create a value factory for the parameter.
protected  MultivaluedParameterExtractor<?> get(Parameter parameter)
          Get a parameter extractor.
 ValueFactoryProvider.PriorityType getPriority()
          Gets the priority of this provider.
 Factory<?> getValueFactory(Parameter parameter)
          Get an injected value factory for the parameter.
protected  MultivaluedParameterExtractor<?> getWithoutDefaultValue(Parameter parameter)
          Get a parameter extractor that ignores default value set on the parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractValueFactoryProvider

protected AbstractValueFactoryProvider(MultivaluedParameterExtractorProvider mpep,
                                       ServiceLocator injector,
                                       Parameter.Source... compatibleSources)
Initialize the provider.

Parameters:
mpep - MultivaluedParameterExtractorProvider to be used for retrieving extractors that can parameter values from the supplied multivalued parameter map.
Method Detail

getWithoutDefaultValue

protected final MultivaluedParameterExtractor<?> getWithoutDefaultValue(Parameter parameter)
Get a parameter extractor that ignores default value set on the parameter.

Parameters:
parameter - parameter supported by the returned extractor.
Returns:
extractor supporting the parameter. The returned instance ignores any default values set on the parameter.
See Also:
get(org.glassfish.jersey.server.model.Parameter)

get

protected final MultivaluedParameterExtractor<?> get(Parameter parameter)
Get a parameter extractor. Unlike the extractor returned by the getWithoutDefaultValue(org.glassfish.jersey.server.model.Parameter) method, the extractor returned from this method will use the default value set on the parameter, in case the parameter is not found in the supplied multivalued parameter map.

Parameters:
parameter - parameter supported by the returned extractor.
Returns:
extractor supporting the parameter. The returned instance ignores any default values set on the parameter.

createValueFactory

protected abstract Factory<?> createValueFactory(Parameter parameter)
Create a value factory for the parameter. May return null in case the parameter is not supported by the value factory provider.

Parameters:
parameter - parameter requesting the value factory instance.
Returns:
parameter value factory. Returns null if parameter is not supported.

getValueFactory

public final Factory<?> getValueFactory(Parameter parameter)
Get an injected value factory for the parameter. May return null in case the parameter is not supported by the value factory provider.

Specified by:
getValueFactory in interface ValueFactoryProvider
Parameters:
parameter - parameter requesting the value factory instance.
Returns:
injected parameter value factory. Returns null if parameter is not supported.

getPriority

public ValueFactoryProvider.PriorityType getPriority()
Description copied from interface: ValueFactoryProvider
Gets the priority of this provider.

Specified by:
getPriority in interface ValueFactoryProvider
Returns:
the priority of this provider.
See Also:
ValueFactoryProvider.PriorityType, ValueFactoryProvider.Priority


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.