|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.util.OwStandardXMLUtil
public class OwStandardXMLUtil
Implements OwXMLUtil utility class for structured configuration data access.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Field Summary | |
---|---|
static String |
DEPTH_FIRST_PREORDER
Defines a search order based on the order in which the searched nodes are encountered in a pre-order traversal of the Document tree. |
static String |
WIDTH_FIRST_LEVEL_ORDER
Defines a search order based on the order in which the searched nodes are encountered in level-first-order traversal of the Document tree. |
Constructor Summary | |
---|---|
OwStandardXMLUtil()
construct an empty configuration |
|
OwStandardXMLUtil(InputStream inputStream_p,
String strRootNodeName_p)
Construct the utility class, wrap around the given first root node. |
|
OwStandardXMLUtil(InputStream inputStream_p,
String strRootNodeName_p,
String rootSearchMode_p)
Construct the utility class, wrap around the given first root node. |
|
OwStandardXMLUtil(Node node_p)
construct the utility class, wrap around the given node |
Method Summary | |
---|---|
String |
getFileEncoding()
|
protected String |
getKeyName(Node node_p)
(overridable) get the name the node is keyed in the lookup map |
Node |
getNode()
return the wrapped DOM Node reference |
boolean |
getSafeBooleanAttributeValue(String strAttributeName_p,
boolean fDefault_p)
get the value of a boolean attribute [true | false], catch exception |
boolean |
getSafeBooleanValue(String strNodeName_p,
boolean fDefault_p)
get the value of a sub boolean node [true | false], catch exception |
List |
getSafeCDATAList()
retrieve a CDATA strings list in the node |
List |
getSafeCDATAList(String strNodeName_p)
retrieve a CDATA string list in a subnode |
int |
getSafeIntegerAttributeValue(String strAttributeName_p,
int iDefault_p)
get the value of a string attribute, catch exception |
int |
getSafeIntegerValue(String strNodeName_p,
int fDefault_p)
get the value of a sub Integer node, catch exception |
List |
getSafeNodeList()
retrieve a node list in a subnode |
List |
getSafeNodeList(String strNodeName_p)
retrieve a node list in a subnode |
String |
getSafeStringAttributeValue(String strAttributeName_p,
String strDefault_p)
get the value of a string attribute, catch exception |
List |
getSafeStringList()
retrieve a string list in the node |
List |
getSafeStringList(String strNodeName_p)
retrieve a string list in a subnode |
Set |
getSafeStringSet(String strNodeName_p)
retrieve a string list in a subnode |
String |
getSafeTextValue(String strDefault_p)
get the value of THE node, catch exception |
String |
getSafeTextValue(String strNodeName_p,
String strDefault_p)
get the value of a sub text node, catch exception |
List |
getSafeUtilList(String itemName_p)
get a list with OwXMLUtil's |
List |
getSafeUtilList(String nodeName_p,
String itemName_p)
get a list with OwXMLUtil's with the given subname |
Node |
getSubNode(String strNodeName_p)
get the subnode with the given tag name |
OwXMLUtil |
getSubUtil(String strName_p)
get a sub util node with the given name |
URL |
getURLFromNode(String nodeName_p)
Helper method to create an URL from given configuration node. |
void |
setFileEncoding(String mFileEncoding_p)
|
protected void |
setNode(Node node_p)
|
void |
writeHtmlDump(Writer w_p)
write configuration as HTML to a writer object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEPTH_FIRST_PREORDER
public static final String WIDTH_FIRST_LEVEL_ORDER
Constructor Detail |
---|
public OwStandardXMLUtil() throws Exception
Exception
public OwStandardXMLUtil(Node node_p) throws Exception
node_p
- DOM Node
Exception
public OwStandardXMLUtil(InputStream inputStream_p, String strRootNodeName_p) throws Exception
DEPTH_FIRST_PREORDER
.
inputStream_p
- Input Stream with XML ContentstrRootNodeName_p
- Name of the root node to be wrapped by the utility class. The
root node is searched in the order in which nodes are
encountered in a pre-order traversal of the Document tree (see
DEPTH_FIRST_PREORDER
).
Exception
public OwStandardXMLUtil(InputStream inputStream_p, String strRootNodeName_p, String rootSearchMode_p) throws Exception
inputStream_p
- Input Stream with XML ContentstrRootNodeName_p
- Name of the root node to be wrapped by the utility class. The
root node is searched in the order given by
rootSearchMode_p
parameter.rootSearchMode_p
- Defines the search order for the root node search. Must be one
of DEPTH_FIRST_PREORDER
or
WIDTH_FIRST_LEVEL_ORDER
.
Exception
Method Detail |
---|
protected String getKeyName(Node node_p)
node_p
- public List getSafeStringList()
getSafeStringList
in interface OwXMLUtil
public List getSafeCDATAList()
getSafeCDATAList
in interface OwXMLUtil
public List getSafeCDATAList(String strNodeName_p)
getSafeCDATAList
in interface OwXMLUtil
public List getSafeStringList(String strNodeName_p)
getSafeStringList
in interface OwXMLUtil
strNodeName_p
- String name of the subnode with the string list
public Set getSafeStringSet(String strNodeName_p)
getSafeStringSet
in interface OwXMLUtil
strNodeName_p
- String name of the subnode with the string list
public String getSafeStringAttributeValue(String strAttributeName_p, String strDefault_p)
getSafeStringAttributeValue
in interface OwXMLUtil
strAttributeName_p
- name of the String attributestrDefault_p
- Default string in case the attribute could not be found
public int getSafeIntegerAttributeValue(String strAttributeName_p, int iDefault_p)
getSafeIntegerAttributeValue
in interface OwXMLUtil
strAttributeName_p
- name of the String attributeiDefault_p
- Default int in case the attribute could not be found
public boolean getSafeBooleanAttributeValue(String strAttributeName_p, boolean fDefault_p)
getSafeBooleanAttributeValue
in interface OwXMLUtil
strAttributeName_p
- name of the String attributefDefault_p
- Default string in case the attribute could not be found
public boolean getSafeBooleanValue(String strNodeName_p, boolean fDefault_p)
getSafeBooleanValue
in interface OwXMLUtil
strNodeName_p
- name of the subnodefDefault_p
- Default value in case the node could not be found
public URL getURLFromNode(String nodeName_p) throws MalformedURLException
getURLFromNode
in interface OwXMLUtil
nodeName_p
- String name of child node, where to extract the URL
MalformedURLException
- if the extracted text is not URL conform stringpublic int getSafeIntegerValue(String strNodeName_p, int fDefault_p)
getSafeIntegerValue
in interface OwXMLUtil
strNodeName_p
- name of the subnodefDefault_p
- Default value in case the node could not be found
public String getSafeTextValue(String strNodeName_p, String strDefault_p)
getSafeTextValue
in interface OwXMLUtil
strNodeName_p
- name of the text subnodestrDefault_p
- Default string in case the node could not be found
public String getSafeTextValue(String strDefault_p)
getSafeTextValue
in interface OwXMLUtil
strDefault_p
- Default string in case the node could not be found
public Node getNode()
getNode
in interface OwXMLUtil
protected void setNode(Node node_p)
public Node getSubNode(String strNodeName_p) throws Exception
getSubNode
in interface OwXMLUtil
strNodeName_p
- tag name of requested node
Exception
public List getSafeNodeList()
getSafeNodeList
in interface OwXMLUtil
public List getSafeNodeList(String strNodeName_p)
getSafeNodeList
in interface OwXMLUtil
strNodeName_p
- String name of the subnode with the node list
public void writeHtmlDump(Writer w_p) throws Exception
writeHtmlDump
in interface OwXMLUtil
w_p
- a Writer
Exception
public List getSafeUtilList(String nodeName_p, String itemName_p)
OwXMLUtil
getSafeUtilList
in interface OwXMLUtil
nodeName_p
- the subnode nameitemName_p
- the name of the item's or null to retrieve all items
List
public List getSafeUtilList(String itemName_p)
OwXMLUtil
getSafeUtilList
in interface OwXMLUtil
itemName_p
- the name of the item's or null to retrieve all items
List
public OwXMLUtil getSubUtil(String strName_p) throws Exception
OwXMLUtil
getSubUtil
in interface OwXMLUtil
strName_p
- the subnode name
Exception
public String getFileEncoding()
public void setFileEncoding(String mFileEncoding_p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |