org.camunda.bpm.engine.impl.util.xml
Class Element

java.lang.Object
  extended by org.camunda.bpm.engine.impl.util.xml.Element

public class Element
extends Object

Represents one XML element.

Author:
Tom Baeyens, Joram Barrez

Field Summary
protected  Map<String,Attribute> attributeMap
           
protected  int column
           
protected  List<Element> elements
           
protected  int line
           
protected  String tagName
           
protected  StringBuilder text
           
protected  String uri
           
 
Constructor Summary
Element(String uri, String localName, String qName, Attributes attributes, Locator locator)
           
 
Method Summary
 void add(Element element)
           
 void appendText(String text)
          Due to the nature of SAX parsing, sometimes the characters of an element are not processed at once.
 String attribute(String name)
           
 String attribute(String name, String defaultValue)
           
 String attributeNS(Namespace namespace, String name)
           
 String attributeNS(Namespace namespace, String name, String defaultValue)
           
 Set<String> attributes()
           
 void collectIds(List<String> ids)
          allows to recursively collect the ids of all elements in the tree.
protected  String composeMapKey(String attributeUri, String attributeName)
           
 Element element(String tagName)
           
 Element elementNS(Namespace nameSpace, String tagName)
           
 List<Element> elements()
           
 List<Element> elements(String tagName)
           
 List<Element> elementsNS(Namespace nameSpace, String tagName)
           
protected  List<Element> elementsNS(String nameSpaceUri, String tagName)
           
 int getColumn()
           
 int getLine()
           
 String getTagName()
           
 String getText()
           
 String getUri()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uri

protected String uri

tagName

protected String tagName

attributeMap

protected Map<String,Attribute> attributeMap

line

protected int line

column

protected int column

text

protected StringBuilder text

elements

protected List<Element> elements
Constructor Detail

Element

public Element(String uri,
               String localName,
               String qName,
               Attributes attributes,
               Locator locator)
Method Detail

elements

public List<Element> elements(String tagName)

elementsNS

public List<Element> elementsNS(Namespace nameSpace,
                                String tagName)

elementsNS

protected List<Element> elementsNS(String nameSpaceUri,
                                   String tagName)

element

public Element element(String tagName)

elementNS

public Element elementNS(Namespace nameSpace,
                         String tagName)

add

public void add(Element element)

attribute

public String attribute(String name)

attributes

public Set<String> attributes()

attributeNS

public String attributeNS(Namespace namespace,
                          String name)

attribute

public String attribute(String name,
                        String defaultValue)

attributeNS

public String attributeNS(Namespace namespace,
                          String name,
                          String defaultValue)

composeMapKey

protected String composeMapKey(String attributeUri,
                               String attributeName)

elements

public List<Element> elements()

toString

public String toString()
Overrides:
toString in class Object

getUri

public String getUri()

getTagName

public String getTagName()

getLine

public int getLine()

getColumn

public int getColumn()

appendText

public void appendText(String text)
Due to the nature of SAX parsing, sometimes the characters of an element are not processed at once. So instead of a setText operation, we need to have an appendText operation.


getText

public String getText()

collectIds

public void collectIds(List<String> ids)
allows to recursively collect the ids of all elements in the tree.



Copyright © 2015 camunda services GmbH. All rights reserved.