public class EntityUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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(Entity entityA,
Entity entityB) |
static boolean |
compareEntity(Entity entityA,
Entity entityB,
Entity sameObject) |
static boolean |
compareEntity(java.util.List<?> jsonA,
java.util.List<?> jsonB) |
static boolean |
compareEntity(java.util.List<?> jsonA,
java.util.List<?> jsonB,
BaseItem sameList) |
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 SimpleList<Pos> |
getExcelRange(java.lang.String tag) |
static byte |
getGroup(byte typ) |
static java.lang.String |
getId(java.lang.String name) |
static java.lang.String |
getStringTyp(byte typ) |
static byte |
getSubGroup(byte typ) |
static byte |
getTyp(byte group,
byte subGroup) |
static byte |
getTyp(byte typ,
int len,
boolean isLast) |
static int |
getTypLen(byte typ,
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 typ)
CHeck if the Typ is typ of Group
|
static boolean |
isNumericType(java.lang.String type) |
static boolean |
isPrimitive(byte typ) |
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 typ,
int valueLength) |
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 java.lang.String doubleToString(double d)
d - a double.public static SimpleList<Pos> getExcelRange(java.lang.String tag)
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 unQuoteControlCharacter(java.lang.CharSequence value)
public static java.lang.String unQuote(java.lang.CharSequence 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,
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 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 boolean stringEquals(java.lang.String s1,
java.lang.String s2)
s1 - first strings2 - second stringpublic 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)
public static boolean compareEntity(Entity entityA, Entity entityB, Entity sameObject)
public static boolean compareEntity(java.util.List<?> jsonA,
java.util.List<?> jsonB)
public static boolean compareEntity(java.util.List<?> jsonA,
java.util.List<?> jsonB,
BaseItem sameList)
public static boolean isEMFType(java.lang.String tag)
public static boolean isPrimitiveType(java.lang.String type)
public static boolean isNumericType(java.lang.String type)
public static java.lang.String convertPrimitiveToObjectType(java.lang.String type)
public static java.lang.String toValidJavaId(java.lang.String tag)
public static java.lang.String getId(java.lang.String name)
public static java.lang.String shortClassName(java.lang.String name)
public static 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 void writeByteHeader(ByteBuffer buffer, byte typ, int valueLength)
public static byte[] clone(byte[] entity)
public static byte getTyp(byte group,
byte subGroup)
public static byte getTyp(byte typ,
int len,
boolean isLast)
public static int getTypLen(byte typ,
int len,
boolean isLast)
public static ByteBuffer getBuffer(int len)
public static boolean isPrimitive(byte typ)
public static boolean isGroup(byte typ)
typ - the the typ of datapublic static java.lang.String getStringTyp(byte typ)
public static byte getGroup(byte typ)
public static byte getSubGroup(byte typ)