public class EntityUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS |
static java.lang.String |
CONTROLCHARACTER |
static java.lang.String |
emfTypes |
static java.lang.String |
HTMLTOKEN
Map to convert extended characters in html entities.
|
static java.lang.String |
javaKeyWords |
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 byte[] |
clone(byte[] entity) |
static boolean |
compareEntity(java.util.Collection<?> jsonA,
java.util.Collection<?> jsonB) |
static boolean |
compareEntity(Entity entityA,
Entity entityB) |
static boolean |
compareEntity(java.lang.Object entityA,
java.lang.Object entityB,
TextDiff diffList,
BaseItem sameObject) |
protected static java.lang.Object |
compareValue(java.lang.String key,
java.lang.Object valueA,
java.lang.Object valueB,
TextDiff diffList,
BaseItem sameElement) |
static java.lang.String |
convertPrimitiveToObjectType(java.lang.String type) |
java.lang.String |
decode(java.lang.String str)
Convert HTML entities to special and extended unicode characters
equivalents.
|
static java.lang.String |
doubleToString(double d)
Produce a string from a double.
|
java.lang.String |
encode(java.lang.String str)
Convert special and extended characters into HTML entitities.
|
static ByteBuffer |
getBuffer(int len) |
static byte[] |
getBytes(java.lang.CharSequence string)
Convert String to ByteArray
|
static java.lang.String |
getDefaultValue(java.lang.String datatype) |
static SimpleList<Pos> |
getExcelRange(java.lang.String tag) |
static byte |
getGroup(byte type) |
static java.lang.String |
getId(java.lang.String name) |
static java.lang.String |
getStringType(byte type) |
static byte |
getSubGroup(byte type) |
static byte |
getType(byte group,
byte subGroup) |
static byte |
getType(byte type,
int len,
boolean isLast) |
static int |
getTypeLen(byte type,
int len,
boolean isLast) |
static java.lang.String |
getValidChars(java.lang.String source,
int maxLen) |
static boolean |
isEMFType(java.lang.String tag) |
static boolean |
isGroup(byte type)
Check if the Type is type of Group
|
static boolean |
isNumeric(java.lang.String strNum) |
static boolean |
isNumericType(java.lang.String type) |
static boolean |
isPrimitive(byte type) |
static boolean |
isPrimitiveType(java.lang.String type) |
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 |
shortClassName(java.lang.String name) |
static boolean |
stringEquals(java.lang.String s1,
java.lang.String s2)
Safe String comparison.
|
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 |
toValidJavaId(java.lang.String tag) |
static java.lang.String |
unQuote(java.lang.CharSequence value) |
static java.lang.String |
unQuoteControlCharacter(java.lang.CharSequence value) |
static java.lang.String |
upFirstChar(java.lang.String name) |
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,
Converter converter)
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.
|
static void |
writeByteHeader(ByteBuffer buffer,
byte type,
int valueLength) |
public static final java.lang.String CLASS
public static final java.lang.String NON_FILE_CHARSSIMPLE
public static java.lang.String CONTROLCHARACTER
public static final java.lang.String emfTypes
public static final java.lang.String javaKeyWords
public static final java.lang.String HTMLTOKEN
public static final java.lang.String doubleToString(double d)
d - a double.public static final boolean isNumeric(java.lang.String strNum)
public static final SimpleList<Pos> getExcelRange(java.lang.String tag)
public static final 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 final java.lang.String unQuoteControlCharacter(java.lang.CharSequence value)
public static final java.lang.String unQuote(java.lang.CharSequence value)
public static final java.lang.String basicUnQuote(java.lang.String value)
public static final java.lang.String quote(java.lang.String string)
string - A Stringpublic static final java.lang.String valueToString(java.lang.Object value,
boolean simpleText,
BaseItem reference,
Converter converter)
Warning: This method assumes that the data structure is acyclical.
value - The value to be serialized.simpleText - Boolean for switch between text and Escaped-Textreference - A Reference Object to generate new Objects like Factory Patternconverter - The Converter to transform Item{ (left
brace) and ending with } (right
brace).public static final java.lang.Object wrap(java.lang.Object object,
BaseItem reference)
object - The object to wrapreference - The referencepublic static final java.lang.String repeat(char ch,
int repeat)
ch - Charrepeat - Number of Repeatpublic static final boolean stringEquals(java.lang.String s1,
java.lang.String s2)
s1 - first strings2 - second stringpublic static final java.lang.String strZero(int value,
int length)
value - the numericvaluelength - the length of Valuepublic static final java.lang.String strZero(long value,
int length)
value - the numericvaluelength - the length of Valuepublic static final java.lang.String strZero(long value,
int length,
int max)
value - the numericvaluelength - the length of Valuemax - the maxValuepublic static final java.lang.String strZero(int value,
int length,
int max)
value - the numericvaluelength - the length of Valuemax - the maxValuepublic static final java.lang.String strZero(java.lang.String value,
int length,
int max)
public static final java.lang.String getValidChars(java.lang.String source,
int maxLen)
public static final java.lang.String getDefaultValue(java.lang.String datatype)
public static final boolean compareEntity(java.util.Collection<?> jsonA,
java.util.Collection<?> jsonB)
public static final boolean compareEntity(java.lang.Object entityA,
java.lang.Object entityB,
TextDiff diffList,
BaseItem sameObject)
protected static final java.lang.Object compareValue(java.lang.String key,
java.lang.Object valueA,
java.lang.Object valueB,
TextDiff diffList,
BaseItem sameElement)
public static final boolean isEMFType(java.lang.String tag)
public static final boolean isPrimitiveType(java.lang.String type)
public static final boolean isNumericType(java.lang.String type)
public static final java.lang.String convertPrimitiveToObjectType(java.lang.String type)
public static final java.lang.String toValidJavaId(java.lang.String tag)
public static final java.lang.String getId(java.lang.String name)
public static final java.lang.String shortClassName(java.lang.String name)
public static final java.lang.String upFirstChar(java.lang.String name)
public java.lang.String encode(java.lang.String str)
str - input stringpublic java.lang.String decode(java.lang.String str)
str - input stringpublic static final void writeByteHeader(ByteBuffer buffer, byte type, int valueLength)
public static final byte[] clone(byte[] entity)
public static final byte getType(byte group,
byte subGroup)
public static final byte getType(byte type,
int len,
boolean isLast)
public static final int getTypeLen(byte type,
int len,
boolean isLast)
public static final byte[] getBytes(java.lang.CharSequence string)
string - The Stringpublic static final ByteBuffer getBuffer(int len)
public static final boolean isPrimitive(byte type)
public static final boolean isGroup(byte type)
type - the the type of datapublic static final java.lang.String getStringType(byte type)
public static final byte getGroup(byte type)
public static final byte getSubGroup(byte type)