|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
org.openoffice.ide.eclipse.core.utils.XMLWriter
public class XMLWriter
A simple XML writer.
Field Summary | |
---|---|
protected int |
mTab
|
protected static java.lang.String |
XML_VERSION
|
Fields inherited from class java.io.PrintWriter |
---|
out |
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
XMLWriter(java.io.OutputStream pOutput)
Creates a new writer using the given output stream to write the data. |
Method Summary | |
---|---|
void |
endTag(java.lang.String pName)
Write the end of an XML tag. |
void |
endTag(java.lang.String pName,
boolean pIndentation)
Write the end of an XML tag. |
static java.lang.String |
getEscaped(java.lang.String pS)
Replace the XML problematic characters by their entities in the string. |
void |
printSimpleTag(java.lang.String pName,
java.lang.Object pValue)
Write a simple XML tag, on the form <name>value</name>. |
void |
printSingleTag(java.lang.String pName,
java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
Print an XML Tag in the form <name ... |
void |
printTabulation()
Write the tab characters at the beginning of the line. |
void |
printTag(java.lang.String pName,
java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
Print an XML Tag. |
void |
printTag(java.lang.String pName,
java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters,
boolean pShouldTab,
boolean pNewLine,
boolean pSingleTag)
Print an XML tag. |
void |
startTag(java.lang.String pName,
java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
Write the start of an XML element. |
void |
startTag(java.lang.String pName,
java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters,
boolean pNewLine)
Write the start of an XML element. |
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String XML_VERSION
protected int mTab
Constructor Detail |
---|
public XMLWriter(java.io.OutputStream pOutput) throws java.io.UnsupportedEncodingException
pOutput
- where to write the XML
java.io.UnsupportedEncodingException
- if the UTF8 charset isn't supported (would be strange)Method Detail |
---|
public void endTag(java.lang.String pName)
pName
- the name of the tagpublic void endTag(java.lang.String pName, boolean pIndentation)
pName
- the name of the tagpIndentation
- whether to print the indentation or notpublic void printSimpleTag(java.lang.String pName, java.lang.Object pValue)
pName
- the name of the tagpValue
- the valuepublic void printTabulation()
public void printSingleTag(java.lang.String pName, java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
pName
- the tag namepParameters
- the tag attributesstartTag(String, HashMap)
,
startTag(String, HashMap, boolean)
public void printTag(java.lang.String pName, java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
pName
- the tag namepParameters
- the tag attributesstartTag(String, HashMap)
,
startTag(String, HashMap, boolean)
public void printTag(java.lang.String pName, java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters, boolean pShouldTab, boolean pNewLine, boolean pSingleTag)
pName
- the tag namepParameters
- the tag attributespShouldTab
- whether to add a tab or not before the tagpNewLine
- whether to add a new line or not after the tagpSingleTag
- writes a tag in the form <name />startTag(String, HashMap)
,
startTag(String, HashMap, boolean)
public void startTag(java.lang.String pName, java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters)
pName
- the name of the elementpParameters
- the attributes of the elementpublic void startTag(java.lang.String pName, java.util.HashMap<java.lang.String,? extends java.lang.Object> pParameters, boolean pNewLine)
pName
- the name of the elementpParameters
- the attributes of the elementpNewLine
- whether to add a line after the tag or not.public static java.lang.String getEscaped(java.lang.String pS)
pS
- the string to escape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |