Package org.codehaus.jettison.mapped
Class DefaultConverter
java.lang.Object
org.codehaus.jettison.mapped.DefaultConverter
- All Implemented Interfaces:
TypeConverter
Default converter that tries to convert value to appropriate primitive (if fails, returns original string)
- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
private static final String
private boolean
private static final int
private static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToJSONPrimitive
(String text) private static Double
Try to get a Double value efficiently, avoiding Exceptionsprivate static Integer
getInteger
(String text) Try to get an Integer value efficiently, avoiding Exceptionsprivate static Long
Try to get a Long value efficiently, avoiding Exceptionsvoid
setEnforce32BitInt
(boolean enforce32BitInt)
-
Field Details
-
ENFORCE_32BIT_INTEGER_KEY
- See Also:
-
ENFORCE_32BIT_INTEGER
public static final boolean ENFORCE_32BIT_INTEGER -
enforce32BitInt
private boolean enforce32BitInt -
MAX_LENGTH_LONG
private static final int MAX_LENGTH_LONG -
MAX_LENGTH_LONG_NEGATIVE
private static final int MAX_LENGTH_LONG_NEGATIVE -
MAX_LENGTH_INTEGER
private static final int MAX_LENGTH_INTEGER -
MAX_LENGTH_INTEGER_NEGATIVE
private static final int MAX_LENGTH_INTEGER_NEGATIVE
-
-
Constructor Details
-
DefaultConverter
public DefaultConverter()
-
-
Method Details
-
setEnforce32BitInt
public void setEnforce32BitInt(boolean enforce32BitInt) -
convertToJSONPrimitive
- Specified by:
convertToJSONPrimitive
in interfaceTypeConverter
-
getLong
Try to get a Long value efficiently, avoiding Exceptions -
getInteger
Try to get an Integer value efficiently, avoiding Exceptions -
getDouble
Try to get a Double value efficiently, avoiding Exceptions
-