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> StringgetConvertedValue(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:
acceptsin interfaceValueConverter<String>- Specified by:
acceptsin classAbstractJSONValueConverter<String>- Returns:
- a list of class types
-
getConvertedValue
Description copied from class:AbstractJSONValueConverterperform the value conversion and return the result- Specified by:
getConvertedValuein classAbstractJSONValueConverter<String>- Type Parameters:
V- the value type- Parameters:
value- the value- Returns:
- the converted value
- Throws:
JSONConversionException- thrown if a conversion error occurs
-