public abstract class XmlFragment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
level |
protected static javax.xml.xpath.XPath |
xpath |
Constructor and Description |
---|
XmlFragment()
Creates a new instance of XmlFragment
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
att(java.lang.String attribute,
java.lang.String value)
returns an tag attribute attribute="value"
with conversion of values attributes to have >,<,',",&
|
protected static java.lang.String |
closeTag(java.lang.String tagName)
returns an close tag </tagName>
|
protected static java.lang.StringBuffer |
composeXml(java.util.Vector<XmlFragment> fragments)
Composes xml from multiples xml fragments.
|
protected static java.lang.StringBuffer |
composeXml(XmlFragment... fragments)
Composes xml from multiples xml fragments.
|
static java.lang.String |
getLevelIndentation()
Getter for level indentation,
this class maintains level indentation when you open
and close tags.
|
abstract java.lang.StringBuffer |
getXml() |
static javax.xml.xpath.XPath |
getXPath()
Getter for xpath to be used to navigate through elements and attributes in an XML document.
|
boolean |
hidden()
Getter for visibility of this xml fragment.
|
void |
hide(boolean hide)
Setter for visibility of this xml fragment.
|
protected static java.lang.String |
openTag(java.lang.String tagName)
returns an open tag without attributes <tagName>
|
protected static java.lang.String |
openTag(java.lang.String tagName,
java.lang.String attributes)
returns an open tag with attributes <tagName attributes>
|
protected static java.lang.String |
tag(java.lang.String tagName)
returns a tag "<tagName />"
|
protected static java.lang.String |
tag(java.lang.String tagName,
java.lang.String attributes)
returns a fully inline closed tag <tagName attributes />
|
java.lang.String |
taginline(java.lang.String tagName,
java.lang.String text)
returns inline open and close tag <tagName>text</tagName>
|
java.lang.String |
taginline(java.lang.String tagName,
java.lang.String attributes,
java.lang.String text)
returns inline open and close tag <tagName attributes>text</tagName>
|
protected static java.lang.String |
toText(java.lang.String xml)
transforms xml text to ascii text
with characters <,>,',",&
|
static java.lang.String |
toXml(java.lang.String text)
transforms ascii text with <,>,',",&
to xml text with characters >,<,',",&
|
protected static java.lang.String |
xml(java.lang.String xml)
Indents an xml sub part to follow current indentation.
|
public abstract java.lang.StringBuffer getXml()
public void hide(boolean hide)
hide
- true to hidepublic boolean hidden()
public static java.lang.String getLevelIndentation()
public static javax.xml.xpath.XPath getXPath()
protected static java.lang.StringBuffer composeXml(java.util.Vector<XmlFragment> fragments)
fragments
- the xml fragments to composeprotected static java.lang.StringBuffer composeXml(XmlFragment... fragments)
fragments
- the xml fragments to composeprotected static java.lang.String toText(java.lang.String xml)
xml
- xml textpublic static java.lang.String toXml(java.lang.String text)
text
- ascii textprotected static java.lang.String tag(java.lang.String tagName)
tagName
- name of tagpublic java.lang.String taginline(java.lang.String tagName, java.lang.String text)
tagName
- the tag nametext
- the text within tags with >,<,',",& (you may use ToXml() method to format this parameter)public java.lang.String taginline(java.lang.String tagName, java.lang.String attributes, java.lang.String text)
tagName
- the tag nameattributes
- attributs de la balise ouvrante avec >,<,',",&text
- the text within tags with >,<,',",& (you may use ToXml() method to format this parameter)protected static java.lang.String xml(java.lang.String xml)
xml
- xml sub partprotected static java.lang.String tag(java.lang.String tagName, java.lang.String attributes)
tagName
- the name of tagattributes
- the tag attributesprotected static java.lang.String openTag(java.lang.String tagName)
tagName
- the name of tagprotected static java.lang.String openTag(java.lang.String tagName, java.lang.String attributes)
tagName
- the name of tagattributes
- tag attributesprotected static java.lang.String closeTag(java.lang.String tagName)
tagName
- the name of tagprotected static java.lang.String att(java.lang.String attribute, java.lang.String value)
attribute
- attribute namevalue
- attribute value