scriptella.configuration
Class XmlElement

java.lang.Object
  extended by scriptella.configuration.XmlElement

public class XmlElement
extends java.lang.Object

Represents XML element

Version:
1.0
Author:
Fyodor Kupolov

Constructor Summary
XmlElement(org.w3c.dom.Element element, java.net.URL documentUrl, PropertiesSubstitutor substitutor)
           
XmlElement(org.w3c.dom.Element element, XmlElement parent)
           
 
Method Summary
protected  java.util.List<XmlElement> asList(org.w3c.dom.NodeList list)
           
 java.lang.String expandProperties(java.lang.String s)
          Expands properties in a string.
 java.lang.String getAttribute(java.lang.String attribute)
          Gets the value of attribute.
protected  boolean getBooleanAttribute(java.lang.String attribute, boolean defaultValue)
          Returns the value of boolean attribute.
 XmlElement getChild(java.lang.String name)
           
protected  java.util.List<XmlElement> getChildren()
           
 java.util.List<XmlElement> getChildren(java.util.Set<java.lang.String> names)
           
 java.util.List<XmlElement> getChildren(java.lang.String name)
           
 java.net.URL getDocumentUrl()
           
 org.w3c.dom.Element getElement()
           
 java.lang.String getTagName()
           
 java.lang.String getXPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlElement

public XmlElement(org.w3c.dom.Element element,
                  java.net.URL documentUrl,
                  PropertiesSubstitutor substitutor)

XmlElement

public XmlElement(org.w3c.dom.Element element,
                  XmlElement parent)
Method Detail

getTagName

public java.lang.String getTagName()

getElement

public org.w3c.dom.Element getElement()

getDocumentUrl

public java.net.URL getDocumentUrl()

getChildren

protected java.util.List<XmlElement> getChildren()

getXPath

public java.lang.String getXPath()

getChildren

public java.util.List<XmlElement> getChildren(java.lang.String name)

getChildren

public java.util.List<XmlElement> getChildren(java.util.Set<java.lang.String> names)

getChild

public XmlElement getChild(java.lang.String name)

asList

protected java.util.List<XmlElement> asList(org.w3c.dom.NodeList list)

getAttribute

public java.lang.String getAttribute(java.lang.String attribute)
Gets the value of attribute.

Additionally property expansion is performed.

Parameters:
attribute - attribute name.
Returns:
value of the attribute or null if attribute is absent or has empty value.

getBooleanAttribute

protected boolean getBooleanAttribute(java.lang.String attribute,
                                      boolean defaultValue)
Returns the value of boolean attribute.

Parameters:
attribute - attribute name.
defaultValue - default value to use if attribute value unspecified.
See Also:
getAttribute(String)

expandProperties

public java.lang.String expandProperties(java.lang.String s)
Expands properties in a string.

Parameters:
s - string to expand properties.
Returns:
string with substituted properties.


Copyright © Copyright 2006-2009 The Scriptella Project Team.