|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.search.query.formhandlers.TagBuilder
public class TagBuilder
This class is a base class for things that iterate the HashMapMap objects
Field Summary | |
---|---|
protected static java.lang.String |
ATTRIBUTES_KEY
|
protected static java.lang.String |
BODY_KEY
|
static java.lang.String |
CLASS_VERSION
|
protected static java.lang.String |
NESTED_ATTR
|
protected static java.lang.String |
OPTIONS_KEY
|
protected static java.lang.String |
TAGNAME_KEY
|
Constructor Summary | |
---|---|
TagBuilder()
Create a builder with an initially empty buffer and a zero indentation value. |
|
TagBuilder(java.lang.StringBuffer pBuffer)
Create a builder which will use an existing string buffer |
|
TagBuilder(java.lang.StringBuffer pBuffer,
int pInitialIndent,
java.lang.String pNestedTagRegex)
Create a builder which will use an existing string buffer and which also uses the specified indentation level |
Method Summary | |
---|---|
protected void |
addIndent()
Add current level of indentation (whitespace) to output buffer |
java.lang.StringBuffer |
escape(java.lang.Object pObject)
Append escaped string to buffer |
java.lang.StringBuffer |
escape(java.lang.String pString,
java.lang.StringBuffer pBuffer)
Append escaped string to buffer |
protected java.lang.StringBuffer |
formatAttributes(java.util.Map pAttributes)
Format all values of map as XML tag attributes, return result in string buffer. |
int |
getIndent()
|
protected static java.util.Map |
getMapValueOrNull(java.util.Map pMap,
java.lang.Object pKey)
Return a Map value in the map for the specified key or null. |
protected java.util.regex.Pattern |
getNestedTagPattern()
Return a pattern that matches the 'tagname' of nested tags. |
protected HashMapMap |
getParentTag(HashMapMap pTag)
Look up the HashMapMap hierarchy for the parent tag |
java.lang.StringBuffer |
getStringBuffer()
Get the string buffer into which all the XML is written |
protected static java.lang.String |
getStringValueOrNull(java.util.Map pMap,
java.lang.Object pKey)
Return a String value in the map for the specified key or null. |
protected java.lang.String |
getTagName(java.util.Map pMap)
|
protected boolean |
hasValue(java.util.Map pMap,
java.lang.String pKey)
Return true if map contains a value associated with the specified key. |
int |
indent()
Indent one level |
protected boolean |
isNested(java.util.Map pMap)
Identify tags that can contain nested tags. |
void |
setIndent(int pIndent)
Set the indentation level |
int |
unindent()
unindent one level |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static final java.lang.String TAGNAME_KEY
protected static final java.lang.String ATTRIBUTES_KEY
protected static final java.lang.String OPTIONS_KEY
protected static final java.lang.String NESTED_ATTR
protected static final java.lang.String BODY_KEY
Constructor Detail |
---|
public TagBuilder()
public TagBuilder(java.lang.StringBuffer pBuffer)
pBuffer
- string buffer to usepublic TagBuilder(java.lang.StringBuffer pBuffer, int pInitialIndent, java.lang.String pNestedTagRegex)
pBuffer
- string buffer to usepInitialIndent
- initial indentation levelpNestedTagRegex
- the regular expression matching tags which
can contain other tags or null for default
PatternSyntaxException
- If the expression's syntax is
invalidMethod Detail |
---|
public void setIndent(int pIndent)
pIndent
- the indentation levelpublic int getIndent()
public int indent()
public int unindent()
public java.lang.StringBuffer getStringBuffer()
protected java.lang.String getTagName(java.util.Map pMap)
protected HashMapMap getParentTag(HashMapMap pTag)
pTag
- the current tagprotected boolean isNested(java.util.Map pMap)
pTagname
- name of tagpMap
- map of tag values
protected java.util.regex.Pattern getNestedTagPattern()
protected static java.lang.String getStringValueOrNull(java.util.Map pMap, java.lang.Object pKey)
pMap
- the mappKey
- the key
protected static java.util.Map getMapValueOrNull(java.util.Map pMap, java.lang.Object pKey)
pMap
- the mappKey
- the key
protected void addIndent()
public java.lang.StringBuffer escape(java.lang.Object pObject)
pObject
- invoke toString() on object, escape resultprotected boolean hasValue(java.util.Map pMap, java.lang.String pKey)
pKey
- the key to testpMap
- the map in which to locate the key's value
protected java.lang.StringBuffer formatAttributes(java.util.Map pAttributes)
pAttributes
- the attribute map
public java.lang.StringBuffer escape(java.lang.String pString, java.lang.StringBuffer pBuffer)
pString
- the string with characters to escape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |