fr.reseaumexico.model.writer
Class XmlNode

java.lang.Object
  extended by fr.reseaumexico.model.writer.XmlNode

public class XmlNode
extends Object

Represent an XML node

Since:
0.1
Author:
sletellier

Field Summary
protected  Map<String,String> attributes
           
protected  LinkedList<XmlNode> children
           
static String CLOSED_TAG
           
static String END_TAG
           
static String START_TAG
           
protected  String tagName
           
protected  String text
           
static String XML_META
           
 
Constructor Summary
XmlNode(String tagName)
           
XmlNode(String tagName, String text)
           
 
Method Summary
 void add(XmlNode e)
           
 void addAttribute(String name, String value)
           
protected  void addToBuilder(StringBuilder stringBuilder, String template, String prefix, String tagName)
           
protected  void buildXml(int start, int indent, StringBuilder stringBuilder)
           
static XmlNode createElement(String tagName, String text)
           
static XmlNode createElement(XmlNode parentXmlNode, String tagName)
           
static XmlNode createElement(XmlNode parentXmlNode, String tagName, String text)
           
protected  String getAttributesAsString()
           
protected  String getIndentPrefix(int start, int lenght)
           
 String toXml(int indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_META

public static final String XML_META
See Also:
Constant Field Values

CLOSED_TAG

public static final String CLOSED_TAG
See Also:
Constant Field Values

START_TAG

public static final String START_TAG
See Also:
Constant Field Values

END_TAG

public static final String END_TAG
See Also:
Constant Field Values

children

protected LinkedList<XmlNode> children

attributes

protected Map<String,String> attributes

tagName

protected String tagName

text

protected String text
Constructor Detail

XmlNode

public XmlNode(String tagName)

XmlNode

public XmlNode(String tagName,
               String text)
Method Detail

add

public void add(XmlNode e)

addAttribute

public void addAttribute(String name,
                         String value)

toXml

public String toXml(int indent)

buildXml

protected void buildXml(int start,
                        int indent,
                        StringBuilder stringBuilder)

addToBuilder

protected void addToBuilder(StringBuilder stringBuilder,
                            String template,
                            String prefix,
                            String tagName)

getIndentPrefix

protected String getIndentPrefix(int start,
                                 int lenght)

getAttributesAsString

protected String getAttributesAsString()

createElement

public static XmlNode createElement(XmlNode parentXmlNode,
                                    String tagName)

createElement

public static XmlNode createElement(XmlNode parentXmlNode,
                                    String tagName,
                                    String text)

createElement

public static XmlNode createElement(String tagName,
                                    String text)


Copyright © 2011-2012 Code Lutin. All Rights Reserved.