|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.ObjectSummary
A helper class that provides a set of static methods to assemble and parse object "summary" strings. A summary is a collection of one or more name/value pairs, that may be returned by certain repository queries instead of the entire object. This speeds up things like tree views and select lists, since you often only need the name and a few interesting attributes of the object. This saves XML parsing time, DOM tree construction time, PersistentObject construction time, and garbage collection time.
Summaries resemble XML attributes, they basically look like this:
name1="value" name2="value" ...Double quotes are used to make these look more natural once they're in SQL databases which normally escape single quotes.
If an attribute has multiple values, the contents of the 'value' string may contain list of substrings separated by a vertical bar.
cars="porche|lexus|yugo"If the vertical bar or double quote must appear as data in a value, it must be preceeded by a backslash.
expression="x \|\| y"
Field Summary | |
static java.lang.String |
code_id
|
Constructor Summary | |
ObjectSummary()
|
Method Summary | |
static java.lang.String |
findSummaryText(java.lang.String xml)
Locate the summary string within an the XML for a persistent object. |
static void |
main(java.lang.String[] args)
|
static RepositoryResult |
makeFakeUsers(int howMany,
java.lang.String summary)
|
static void |
pack(java.lang.StringBuffer sb,
WSAttributes atts)
|
static void |
pack(java.lang.StringBuffer sb,
WSAttributes atts,
boolean comment)
pack all of the passed in attributes following the rules for multiple values and charactor escaping described above. |
static void |
packAttr(java.lang.StringBuffer sb,
java.lang.String name,
java.lang.Object val)
place a name="value" pair in the buffer, with a space before the name. |
static void |
packAttr(java.lang.StringBuffer sb,
WSAttribute attr)
place a name="value" pair in the buffer, with a space before the name. |
static java.lang.String |
packMessage(Message m)
|
static void |
packValue(java.lang.StringBuffer sb,
java.lang.String value)
Append the string to the buffer, escaping | and " chars with a \. |
static void |
println(java.lang.String msg)
|
static WSAttributes |
unpack(java.lang.String summary)
Given a string buffer containing an object summary, unpack it into an WSAttributes object. |
static Message |
unpackMessage(java.lang.String packedMessage)
|
static WSAttributes |
unpackSummaryFromObject(java.lang.String xml)
This does a quick scan of the XML for an object, looking for a "summary" string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public ObjectSummary()
Method Detail |
public static WSAttributes unpack(java.lang.String summary)
public static WSAttributes unpackSummaryFromObject(java.lang.String xml)
This can be used for applications that want some quick information about an object, without the overhead of a full XML parse and PersistentObject construction.
This was built to allow the summary text to appear in the XML serialization of the object. We're actually now storing this as a "queryable" attribute, so this code is dormant.
public static java.lang.String packMessage(Message m)
public static Message unpackMessage(java.lang.String packedMessage)
public static java.lang.String findSummaryText(java.lang.String xml)
This was built to allow the summary text to appear in the XML serialization of the object. We're actually now storing this as a "queryable" attribute, so this code is dormant.
public static void packValue(java.lang.StringBuffer sb, java.lang.String value)
public static void packAttr(java.lang.StringBuffer sb, WSAttribute attr)
public static void packAttr(java.lang.StringBuffer sb, java.lang.String name, java.lang.Object val)
public static void pack(java.lang.StringBuffer sb, WSAttributes atts, boolean comment)
You will end up with a buffer that looks like:
public static void pack(java.lang.StringBuffer sb, WSAttributes atts)
public static void main(java.lang.String[] args)
public static RepositoryResult makeFakeUsers(int howMany, java.lang.String summary)
public static void println(java.lang.String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |