com.atlassian.renderer.util
Class NodeUtil

java.lang.Object
  extended by com.atlassian.renderer.util.NodeUtil

public class NodeUtil
extends Object

Utility methods for nodes.


Constructor Summary
NodeUtil()
           
 
Method Summary
static boolean attributeContains(Node node, String name, String value)
          Returns true if the named attribute exists and contains the passed in value.
static String getAttribute(Node node, String name)
          Retrieve the attribute value from the node.
static boolean getBooleanAttributeValue(Node node, String attributeName, boolean defaultValue)
          Retrieve the value of an attribute for a node as a boolean.
static boolean isList(Node node)
           
static boolean isTextNode(Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeUtil

public NodeUtil()
Method Detail

getAttribute

public static String getAttribute(Node node,
                                  String name)
Retrieve the attribute value from the node. Null is returned if the attribute is not found.

See Also:
NodeContext.getAttribute(String)

getBooleanAttributeValue

public static boolean getBooleanAttributeValue(Node node,
                                               String attributeName,
                                               boolean defaultValue)
Retrieve the value of an attribute for a node as a boolean. If the value is not present, or not readily convertible to a boolean return the requested defaultValue.

Parameters:
node - from which to retrieve the value
attributeName - the attribute to find the value of
defaultValue - the value to return if no boolean value is found.
Returns:
the value of an attribute
See Also:
NodeContext.getBooleanAttributeValue(String, boolean)

attributeContains

public static boolean attributeContains(Node node,
                                        String name,
                                        String value)
Returns true if the named attribute exists and contains the passed in value.


isTextNode

public static boolean isTextNode(Node node)

isList

public static boolean isList(Node node)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.