com.wewebu.ow.server.util
Class OwXMLUtilPlaceholderFilter

java.lang.Object
  extended by com.wewebu.ow.server.util.OwXMLUtilPlaceholderFilter
All Implemented Interfaces:
OwXMLUtil
Direct Known Subclasses:
OwXMLUtilOptionAndPlaceholderFilter

public class OwXMLUtilPlaceholderFilter
extends Object
implements OwXMLUtil

Utility class for XML access and debugging.
Implements OwXMLUtil with a OwAttributeBag interface.
So the place holder values are converted with the given OwAttributeBag.

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

See Also:
OwStandardOptionXMLUtil

Field Summary
protected  OwXMLUtil m_wrappednode
           
 
Constructor Summary
OwXMLUtilPlaceholderFilter(Node node_p, OwAttributeBag placeholderattributeBag_p)
          construct a template XML util node
OwXMLUtilPlaceholderFilter(OwXMLUtil node_p, OwAttributeBag placeholderattributeBag_p)
          construct a template XML util node
 
Method Summary
protected  String getAttributeValue(String attributeName_p)
          get the specified attribute value replace placeholder if specified
 Node getNode()
          return the wrapped DOM Node reference
protected  String getNodeValue()
          get the value from the node replace placeholder if specified
protected  String getNodeValue(String strNodeName_p)
          get the value from the given node name replace placeholder if specified
protected  String getPlaceholderValue(String value_p)
          get the placeholder name if specified placeholders have the following syntax: {$Placeholdername}
 boolean getSafeBooleanAttributeValue(String strAttributeName_p, boolean default_p)
          get the value of a boolean attribute [true | false], catch exception
 boolean getSafeBooleanValue(String strNodeName_p, boolean default_p)
          get the value of a sub boolean node [true | false], catch exception
 List getSafeCDATAList()
          retrieve a CDATA string list in a subnode
 List getSafeCDATAList(String strNodeName_p)
          retrieve a CDATA string list in the node
 int getSafeIntegerAttributeValue(String strAttributeName_p, int default_p)
          get the value of a string attribute, catch exception
 int getSafeIntegerValue(String strNodeName_p, int default_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 default_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 default_p)
          get the value of THE node, catch exception
 String getSafeTextValue(String strNodeName_p, String default_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 tagname
 OwXMLUtil getSubUtil(String nodeName_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 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

m_wrappednode

protected OwXMLUtil m_wrappednode
Constructor Detail

OwXMLUtilPlaceholderFilter

public OwXMLUtilPlaceholderFilter(OwXMLUtil node_p,
                                  OwAttributeBag placeholderattributeBag_p)
                           throws Exception
construct a template XML util node

Parameters:
node_p - OwXMLUtil wrapped node
placeholderattributeBag_p -
Throws:
Exception

OwXMLUtilPlaceholderFilter

public OwXMLUtilPlaceholderFilter(Node node_p,
                                  OwAttributeBag placeholderattributeBag_p)
                           throws Exception
construct a template XML util node

Parameters:
node_p - DOM Node
placeholderattributeBag_p -
Throws:
Exception
Method Detail

getAttributeValue

protected String getAttributeValue(String attributeName_p)
                            throws Exception
get the specified attribute value replace placeholder if specified

Parameters:
attributeName_p -
Returns:
a String
Throws:
Exception

getNodeValue

protected String getNodeValue(String strNodeName_p)
                       throws Exception
get the value from the given node name replace placeholder if specified

Parameters:
strNodeName_p -
Returns:
a String
Throws:
Exception

getNodeValue

protected String getNodeValue()
                       throws Exception
get the value from the node replace placeholder if specified

Returns:
a String
Throws:
Exception

getSafeBooleanValue

public boolean getSafeBooleanValue(String strNodeName_p,
                                   boolean default_p)
Description copied from interface: OwXMLUtil
get the value of a sub boolean node [true | false], catch exception

Specified by:
getSafeBooleanValue in interface OwXMLUtil
Parameters:
strNodeName_p - name of the subnode
default_p - Default value in case the node could not be found
Returns:
boolean value of node or fDefault_p on failure

getSafeIntegerValue

public int getSafeIntegerValue(String strNodeName_p,
                               int default_p)
Description copied from interface: OwXMLUtil
get the value of a sub Integer node, catch exception

Specified by:
getSafeIntegerValue in interface OwXMLUtil
Parameters:
strNodeName_p - name of the subnode
default_p - Default value in case the node could not be found
Returns:
int value of node or fDefault_p on failure

getSafeTextValue

public String getSafeTextValue(String strNodeName_p,
                               String default_p)
Description copied from interface: OwXMLUtil
get the value of a sub text node, catch exception

Specified by:
getSafeTextValue in interface OwXMLUtil
Parameters:
strNodeName_p - name of the text subnode
default_p - Default string in case the node could not be found
Returns:
string value of subnode or strDefault_p on failure

getSafeTextValue

public String getSafeTextValue(String default_p)
Description copied from interface: OwXMLUtil
get the value of THE node, catch exception

Specified by:
getSafeTextValue in interface OwXMLUtil
Parameters:
default_p - Default string in case the node could not be found
Returns:
string value of subnode or strDefault_p on failure

getPlaceholderValue

protected String getPlaceholderValue(String value_p)
get the placeholder name if specified placeholders have the following syntax: {$Placeholdername}

Parameters:
value_p -
Returns:
String placeholder value or given value if not found

getSafeBooleanAttributeValue

public boolean getSafeBooleanAttributeValue(String strAttributeName_p,
                                            boolean default_p)
Description copied from interface: OwXMLUtil
get the value of a boolean attribute [true | false], catch exception

Specified by:
getSafeBooleanAttributeValue in interface OwXMLUtil
Parameters:
strAttributeName_p - name of the String attribute
default_p - Default string in case the attribute could not be found
Returns:
boolean value of attribute or fDefault_p on failure

getSafeIntegerAttributeValue

public int getSafeIntegerAttributeValue(String strAttributeName_p,
                                        int default_p)
Description copied from interface: OwXMLUtil
get the value of a string attribute, catch exception

Specified by:
getSafeIntegerAttributeValue in interface OwXMLUtil
Parameters:
strAttributeName_p - name of the String attribute
default_p - Default int in case the attribute could not be found
Returns:
int value of attribute or iDefault_p on failure

getSafeStringAttributeValue

public String getSafeStringAttributeValue(String strAttributeName_p,
                                          String default_p)
Description copied from interface: OwXMLUtil
get the value of a string attribute, catch exception

Specified by:
getSafeStringAttributeValue in interface OwXMLUtil
Parameters:
strAttributeName_p - name of the String attribute
default_p - Default string in case the attribute could not be found
Returns:
string value of attribute or strDefault_p on failure

getSafeStringList

public List getSafeStringList()
Description copied from interface: OwXMLUtil
retrieve a string list in the node

Specified by:
getSafeStringList in interface OwXMLUtil
Returns:
List of Strings

getSafeCDATAList

public List getSafeCDATAList()
Description copied from interface: OwXMLUtil
retrieve a CDATA string list in a subnode

Specified by:
getSafeCDATAList in interface OwXMLUtil
Returns:
List of Strings

getSafeCDATAList

public List getSafeCDATAList(String strNodeName_p)
Description copied from interface: OwXMLUtil
retrieve a CDATA string list in the node

Specified by:
getSafeCDATAList in interface OwXMLUtil
Returns:
List of Strings

getSafeStringList

public List getSafeStringList(String strNodeName_p)
Description copied from interface: OwXMLUtil
retrieve a string list in a subnode

Specified by:
getSafeStringList in interface OwXMLUtil
Parameters:
strNodeName_p - String name of the subnode with the string list
Returns:
List of Strings

getSafeStringSet

public Set getSafeStringSet(String strNodeName_p)
Description copied from interface: OwXMLUtil
retrieve a string list in a subnode

Specified by:
getSafeStringSet in interface OwXMLUtil
Parameters:
strNodeName_p - String name of the subnode with the string list
Returns:
List of Strings

writeHtmlDump

public void writeHtmlDump(Writer w_p)
                   throws Exception
Description copied from interface: OwXMLUtil
write configuration as HTML to a writer object

Specified by:
writeHtmlDump in interface OwXMLUtil
Parameters:
w_p - a Writer
Throws:
Exception

getNode

public Node getNode()
Description copied from interface: OwXMLUtil
return the wrapped DOM Node reference

Specified by:
getNode in interface OwXMLUtil
Returns:
Node

getSafeNodeList

public List getSafeNodeList()
Description copied from interface: OwXMLUtil
retrieve a node list in a subnode

Specified by:
getSafeNodeList in interface OwXMLUtil
Returns:
List of DOM Nodes

getSafeNodeList

public List getSafeNodeList(String strNodeName_p)
Description copied from interface: OwXMLUtil
retrieve a node list in a subnode

Specified by:
getSafeNodeList in interface OwXMLUtil
Parameters:
strNodeName_p - String name of the subnode with the node list
Returns:
List of DOM Nodes

getSubNode

public Node getSubNode(String strNodeName_p)
                throws Exception
Description copied from interface: OwXMLUtil
get the subnode with the given tagname

Specified by:
getSubNode in interface OwXMLUtil
Parameters:
strNodeName_p - tag name of requested node
Returns:
org.w3c.dom.Node
Throws:
Exception

getSafeUtilList

public List getSafeUtilList(String nodeName_p,
                            String itemName_p)
Description copied from interface: OwXMLUtil
get a list with OwXMLUtil's with the given subname

Specified by:
getSafeUtilList in interface OwXMLUtil
Parameters:
nodeName_p - the subnode name
itemName_p - the name of the item's or null to retrieve all items
Returns:
a List

getSafeUtilList

public List getSafeUtilList(String itemName_p)
Description copied from interface: OwXMLUtil
get a list with OwXMLUtil's

Specified by:
getSafeUtilList in interface OwXMLUtil
Parameters:
itemName_p - the name of the item's or null to retrieve all items
Returns:
a List

getSubUtil

public OwXMLUtil getSubUtil(String nodeName_p)
                     throws Exception
Description copied from interface: OwXMLUtil
get a sub util node with the given name

Specified by:
getSubUtil in interface OwXMLUtil
Parameters:
nodeName_p - the subnode name
Returns:
OwXMLUtil or null if not found
Throws:
Exception

getURLFromNode

public URL getURLFromNode(String nodeName_p)
                   throws MalformedURLException
Description copied from interface: OwXMLUtil
Helper method to create an URL from given configuration node.

Specified by:
getURLFromNode in interface OwXMLUtil
Parameters:
nodeName_p - String name of child node, where to extract the URL
Returns:
java.net.URL
Throws:
MalformedURLException - if the extracted text is not URL conform string


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.