public class EntityUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NON_FILE_CHARSSIMPLE |
| Constructor and Description |
|---|
EntityUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
basicUnQuote(java.lang.String value) |
static java.lang.String |
doubleToString(double d)
Produce a string from a double.
|
static java.lang.String |
getValidChars(java.lang.String source,
int maxLen) |
static java.lang.String |
quote(java.lang.String string)
Produce a string in double quotes with backslash sequences in all the
right places.
|
static java.lang.String |
repeat(char ch,
int repeat)
Repeat a Char and return a simple String
|
static java.lang.String |
strZero(int value,
int length)
format a String with 0
|
static java.lang.String |
strZero(int value,
int length,
int max)
Format a date with 0
|
static java.lang.String |
strZero(long value,
int length)
format a String with 0
|
static java.lang.String |
strZero(long value,
int length,
int max)
format a String with 0
|
static java.lang.String |
strZero(java.lang.String value,
int length,
int max) |
static java.lang.String |
unQuote(java.lang.String value) |
static java.lang.String |
valueToString(java.lang.Number number)
Produce a string from a Number.
|
static java.lang.String |
valueToString(java.lang.Object value,
boolean simpleText,
BaseItem reference) |
static java.lang.String |
valueToString(java.lang.Object value,
int indentFactor,
int intent,
boolean simpleText,
BaseItem reference)
Make a prettyprinted JSON text of an object value.
|
static java.lang.Object |
wrap(java.lang.Object object,
BaseItem reference)
Wrap an object, if necessary.
|
public static final java.lang.String NON_FILE_CHARSSIMPLE
public static java.lang.String doubleToString(double d)
d - A double.public static java.lang.String valueToString(java.lang.Number number)
throws java.lang.IllegalArgumentException
number - A Numberjava.lang.IllegalArgumentException - If n is a non-finite number.public static java.lang.String unQuote(java.lang.String value)
public static java.lang.String basicUnQuote(java.lang.String value)
public static java.lang.String quote(java.lang.String string)
string - A Stringpublic static java.lang.String valueToString(java.lang.Object value,
int indentFactor,
int intent,
boolean simpleText,
BaseItem reference)
Warning: This method assumes that the data structure is acyclical.
value - The value to be serialized.indentFactor - The number of spaces to add to each level of indentation.intent - The indentation of the top level.simpleText - Boolean for switch between text and Escaped-Textreference - A Reference Object to generate new Objects like Factory
Pattern{ (left
brace) and ending with } (right
brace).public static java.lang.String valueToString(java.lang.Object value,
boolean simpleText,
BaseItem reference)
public static java.lang.Object wrap(java.lang.Object object,
BaseItem reference)
object - The object to wrapreference - The referencepublic static java.lang.String repeat(char ch,
int repeat)
ch - Charrepeat - Number of Repeatpublic static java.lang.String strZero(int value,
int length)
value - the numericvaluelength - the length of Valuepublic static java.lang.String strZero(long value,
int length)
value - the numericvaluelength - the length of Valuepublic static java.lang.String strZero(long value,
int length,
int max)
value - the numericvaluelength - the length of Valuemax - the maxValuepublic static java.lang.String strZero(int value,
int length,
int max)
value - the numericvaluelength - the length of Valuemax - the maxValuepublic static java.lang.String strZero(java.lang.String value,
int length,
int max)
public static java.lang.String getValidChars(java.lang.String source,
int maxLen)