Class StringJSONValueConverter
java.lang.Object
org.ghotibeaun.json.converters.valueconverter.AbstractJSONValueConverter<String>
org.ghotibeaun.json.converters.valueconverter.StringJSONValueConverter
- All Implemented Interfaces:
ValueConverter<String>
public class StringJSONValueConverter extends AbstractJSONValueConverter<String>
Converts a JSONValue to a String. Optionally accepts a single argument to format the value
NOTE: This class uses the native String.format(String, Object...)
method.
As a result, please consult the appropriate formatting tokens.
- Author:
- Jim Earley (xml.jim@gmail.com)
-
Constructor Summary
Constructors Constructor Description StringJSONValueConverter(String... args)
-
Method Summary
Modifier and Type Method Description Class<?>[]
accepts()
Accepts any type<V> String
getConvertedValue(V value)
perform the value conversion and return the resultMethods inherited from class org.ghotibeaun.json.converters.valueconverter.AbstractJSONValueConverter
accept, convertValue, getAcceptedClassList, getArg, getArgs, getInvalidMessage
-
Constructor Details
-
StringJSONValueConverter
-
-
Method Details
-
accepts
Accepts any type- Specified by:
accepts
in interfaceValueConverter<String>
- Specified by:
accepts
in classAbstractJSONValueConverter<String>
- Returns:
- a list of class types
-
getConvertedValue
Description copied from class:AbstractJSONValueConverter
perform the value conversion and return the result- Specified by:
getConvertedValue
in classAbstractJSONValueConverter<String>
- Type Parameters:
V
- the value type- Parameters:
value
- the value- Returns:
- the converted value
- Throws:
JSONConversionException
- thrown if a conversion error occurs
-