org.glassfish.jersey.server.internal.inject
Class StringReaderFactory

java.lang.Object
  extended by org.glassfish.jersey.server.internal.inject.StringReaderFactory
All Implemented Interfaces:
StringValueReaderProvider

@Singleton
public class StringReaderFactory
extends java.lang.Object
implements StringValueReaderProvider

An aggregate string reader provider that loads all the registered StringValueReaderProvider implementations.

When invoked, the provider iterates through the registered implementations until it finds the first implementation that returns a non-null string reader, which is subsequently returned from the factory. In case no non-null string reader instance is found, null is returned from the factory.

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

Method Summary
<T> StringValueReader<T>
getStringReader(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations)
          Obtain a StringValueReader that can produce an instance of a particular type from a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStringReader

public <T> StringValueReader<T> getStringReader(java.lang.Class<T> type,
                                                java.lang.reflect.Type genericType,
                                                java.lang.annotation.Annotation[] annotations)
Description copied from interface: StringValueReaderProvider
Obtain a StringValueReader that can produce an instance of a particular type from a string.

Specified by:
getStringReader in interface StringValueReaderProvider
Type Parameters:
T - The Java type to be produced.
Parameters:
type - the class of object to be produced.
genericType - the type of object to be produced. E.g. if the string is to be converted into a method parameter, this will be the formal type of the method parameter as returned by Class.getGenericParameterTypes.
annotations - an array of the annotations on the declaration of the artifact that will be initialized with the produced instance. E.g. if the string is to be converted into a method parameter, this will be the annotations on that parameter returned by Class.getParameterAnnotations.
Returns:
the string reader, otherwise null.


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