|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.Obj2StrParser
Parser to make a String-based representation out of an object. Obj2StrParser has been developed in the context of transferring data between a server and a client in the predecessor architecture of the GJSA. Since then, it has been evolved into a general Object-to-String parser.
Obj2StrParser can be extended through ClassParser objects, which can be loaded into the parser at runtime. After loading the parser for a specific class, it can be parsed in any context, especially as part of another object (which can be either parsed by the builtin parser parts or by other external class parsers. By default, Obj2StrParser parses Numbers, Strings, boolean values, Lists and Maps.
Obj2StrParser can be roughly compared to Object.toString(), though it is much superior. Its counterpart is Str2ObjParser, which can recreate a Java object from a String representation.
Due to its history and current usage, Obj2StrParser has several special conversion methods for ServerRequest- and ServerReply-objects.
Obj2StrParser has only instance methods and is not instancizable (private constructor).
Field Summary | |
private static java.util.List |
classparsers
|
(package private) static java.text.DecimalFormatSymbols |
dfs
|
static java.text.DecimalFormat |
doubleformatter
Description of the Field |
(package private) static java.text.FieldPosition |
dummyfieldposition
|
private static java.lang.String |
legacynonencodechars
|
private static Logger |
mess
|
protected static java.util.Map |
nspreq
Parameters that must not be logged, e.g. passwords. |
Constructor Summary | |
private |
Obj2StrParser()
Constructor for the Obj2StrParser object |
Method Summary | |
static void |
addClassParser(ClassParser cp)
Adds a feature to the ClassParser attribute of the Obj2StrParser class |
static void |
addNoShowParameters(int request,
int[] params)
Adds a feature to the NoShowParameters attribute of the Obj2StrParser class |
static java.lang.String |
formatDouble(double d)
Description of the Method |
static java.lang.String |
parseEnvelopeAsReply(ServerEnvelope se,
boolean alwaysparse)
parse a ServerEnvelope object including leading signs |
static java.lang.String |
parseEnvelopeAsRequest(ServerEnvelope se,
boolean alwaysparse)
parse a ServerEnvelope object including leading signs |
private static java.lang.String |
parseIterator(java.util.Iterator it)
Parses through an iterator |
static java.lang.String |
parseList(java.util.List l)
Parse the contents of a List |
static java.lang.String |
parseMap(java.util.Map m)
Parse the contents of a Map |
private static java.lang.String |
parseMapsLegacy(java.util.Map m)
Legacy transformation method to transfer Maps in old style if possible |
static java.lang.String |
parseMapStringKey(java.util.Map m)
Parse map with String-only keys |
static java.lang.String |
parseObject(java.lang.Object o)
parses any object. |
static java.lang.String |
parseProperties(java.util.Properties p)
Parse the contents of a Properties including any ancestor/default values |
static java.lang.String |
parseReply(ServerEnvelope se)
Description of the Method |
static java.lang.String |
parseReply(ServerEnvelope se,
boolean alwaysparse)
parses the ServerReply part of a ServerEnvelope object |
static java.lang.String |
parseReply(ServerReply rep)
parses a ServerReply object directly |
static java.lang.String |
parseReply(ServerReply rep,
boolean alwaysparse)
parses a ServerReply object directly |
static java.lang.String |
parseReplyList(java.util.List reqv,
boolean alwaysparse)
parse a vector af replies (separate output with semicolons). |
static java.lang.String |
parseRequest(ServerEnvelope se)
Description of the Method |
static java.lang.String |
parseRequest(ServerEnvelope se,
boolean alwaysparse)
Description of the Method |
static java.lang.String |
parseRequest(ServerRequest req,
boolean alwaysparse)
parse a ServerRequest object directly |
static java.lang.String |
parseRequestList(java.util.List reqv,
boolean alwaysparse)
parse a vector af requests (separate output with semicolons). |
static java.lang.String |
parseResourceBundle(java.util.ResourceBundle rb)
Parse a ResourceBundle |
static java.lang.String |
parseSet(java.util.Set s)
Parse the contents of a Set |
static void |
setLogger(Logger m)
Sets the logger attribute of the Obj2StrParser class |
private static char |
toHex(int nibble)
Convert a nibble to a hex character |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Logger mess
private static java.util.List classparsers
protected static java.util.Map nspreq
private static java.lang.String legacynonencodechars
static java.text.DecimalFormatSymbols dfs
public static java.text.DecimalFormat doubleformatter
static java.text.FieldPosition dummyfieldposition
Constructor Detail |
private Obj2StrParser()
Method Detail |
public static void setLogger(Logger m)
m
- The new logger valuepublic static void addClassParser(ClassParser cp)
cp
- The feature to be added to the ClassParser attributepublic static void addNoShowParameters(int request, int[] params)
request
- The feature to be added to the NoShowParameters attributeparams
- The feature to be added to the NoShowParameters attributepublic static java.lang.String formatDouble(double d)
d
- Description of the Parameter
private static char toHex(int nibble)
nibble
- the nibble to convert.
public static java.lang.String parseObject(java.lang.Object o)
o
- Description of the Parameter
private static java.lang.String parseIterator(java.util.Iterator it)
it
- Iterator, not yet evaluated in any way
public static java.lang.String parseList(java.util.List l)
l
- The List to be parsed
public static java.lang.String parseSet(java.util.Set s)
s
- The Set to be parsed
public static java.lang.String parseProperties(java.util.Properties p)
p
- The Properties bundle to be parsed
public static java.lang.String parseMap(java.util.Map m)
m
- The Map to be parsed
public static java.lang.String parseMapStringKey(java.util.Map m)
private static java.lang.String parseMapsLegacy(java.util.Map m)
public static java.lang.String parseResourceBundle(java.util.ResourceBundle rb)
public static java.lang.String parseEnvelopeAsReply(ServerEnvelope se, boolean alwaysparse)
se
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseEnvelopeAsRequest(ServerEnvelope se, boolean alwaysparse)
se
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseReply(ServerReply rep, boolean alwaysparse)
rep
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseReply(ServerReply rep)
rep
- Description of the Parameter
public static java.lang.String parseReplyList(java.util.List reqv, boolean alwaysparse)
reqv
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseReply(ServerEnvelope se, boolean alwaysparse)
se
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseReply(ServerEnvelope se)
se
- Description of the Parameter
public static java.lang.String parseRequest(ServerEnvelope se, boolean alwaysparse)
se
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseRequest(ServerEnvelope se)
se
- Description of the Parameter
public static java.lang.String parseRequest(ServerRequest req, boolean alwaysparse)
req
- Description of the Parameteralwaysparse
- Description of the Parameter
public static java.lang.String parseRequestList(java.util.List reqv, boolean alwaysparse)
reqv
- Description of the Parameteralwaysparse
- Description of the Parameter
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |