org.n52.security.common.xml
Class XMLBuilder

java.lang.Object
  extended by org.n52.security.common.xml.XMLBuilder

public class XMLBuilder
extends Object

Smart wrapper arround the Document.create* methods, which is desinged to support the creation of DOM structures within the source code.

Author:
Marko Reiprecht

Nested Class Summary
static class XMLBuilder.XMLElement
           
 
Method Summary
 XMLBuilder appendAfter(String xpath, XMLBuilder.XMLElement element)
           
 XMLBuilder appendBefore(String xpath, XMLBuilder.XMLElement element)
           
 XMLBuilder appendTo(String xpath, XMLBuilder.XMLElement element)
           
 XMLBuilder appendToRoot(XMLBuilder.XMLElement element)
           
 Attr attribute(String qname, String value)
           
 Comment comment(String comment)
           
 XMLBuilder.XMLElement element(QName qname, Attr... attributes)
           
 XMLBuilder.XMLElement element(String qname, Attr... attributes)
           
 Document getDocument()
           
 SimpleNamespaceContext getNamespaces()
           
 XMLBuilder namespace(String prefix, String namespace)
           
 XMLBuilder replaceNodeAt(String xpath, XMLBuilder.XMLElement element)
           
 Text text(String content)
           
static XMLBuilder withDocument(Document source)
           
static XMLBuilder withNewDocument()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withNewDocument

public static XMLBuilder withNewDocument()

withDocument

public static XMLBuilder withDocument(Document source)

getDocument

public Document getDocument()

getNamespaces

public SimpleNamespaceContext getNamespaces()

appendToRoot

public XMLBuilder appendToRoot(XMLBuilder.XMLElement element)

appendTo

public XMLBuilder appendTo(String xpath,
                           XMLBuilder.XMLElement element)

replaceNodeAt

public XMLBuilder replaceNodeAt(String xpath,
                                XMLBuilder.XMLElement element)

appendBefore

public XMLBuilder appendBefore(String xpath,
                               XMLBuilder.XMLElement element)

appendAfter

public XMLBuilder appendAfter(String xpath,
                              XMLBuilder.XMLElement element)

namespace

public XMLBuilder namespace(String prefix,
                            String namespace)

element

public XMLBuilder.XMLElement element(String qname,
                                     Attr... attributes)

element

public XMLBuilder.XMLElement element(QName qname,
                                     Attr... attributes)

text

public Text text(String content)

comment

public Comment comment(String comment)

attribute

public Attr attribute(String qname,
                      String value)


Copyright © 2004–2013 52north.org. All rights reserved.