org.glassfish.jersey.spi
Interface StringValueReader<T>

Type Parameters:
T - the supported Java type produced as a result of string value conversion.

public interface StringValueReader<T>

Read a string value and convert to a Java type.

A StringValueReaderProvider is responsible for providing an instance of this interface.

If annotated with ValidateDefaultValue(true) or if the annotation is absent then the reader will be used to eagerly convert a default value (if any) by calling the fromString(java.lang.String) transformation method, perhaps at initialization, before any value – default or otherwise – is actually required. This enables the early reporting of errors for default values. If annotated with ValidateDefaultValue(false) then the reader will not be used to eagerly convert a default value (if any).

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

Nested Class Summary
static interface StringValueReader.ValidateDefaultValue
          Declares whether validation of a default value should occur before any value – default or otherwise – is actually required.
 
Method Summary
 T fromString(String value)
          Read a string value and convert to a Java type.
 

Method Detail

fromString

T fromString(String value)
Read a string value and convert to a Java type.

Parameters:
value - the string value to be converted.
Returns:
the instance of the supported Java type produced as a result of conversion.


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.