org.xwiki.rendering.renderer.printer
Class XMLWikiPrinter

java.lang.Object
  extended by org.xwiki.rendering.renderer.printer.XMLWikiPrinter
Direct Known Subclasses:
XHTMLWikiPrinter

public class XMLWikiPrinter
extends Object

Base toolkit class for all XML-based printers.

Since:
1.9M1

Field Summary
protected  WikiWriter wikiWriter
           
protected  XMLWriter xmlWriter
           
 
Constructor Summary
XMLWikiPrinter(WikiPrinter printer)
           
 
Method Summary
 XMLWriter getXMLWriter()
           
 void printEntity(String entity)
           
 void printRaw(String row)
          Print some text without escaping anything, it's supposed to be XML or at least contains only valid characters in XML text node.
 void printXML(String str)
          Print provided text.
 void printXMLComment(String content)
          Print a XML comment.
 void printXMLComment(String content, boolean escape)
          Print a XML comment.
 void printXMLElement(String name)
          Print the xml element.
 void printXMLElement(String name, Map<String,String> attributes)
          Print the xml element.
 void printXMLElement(String name, String[][] attributes)
          Print the xml element.
 void printXMLEndCData()
          End a CDATA section.
 void printXMLEndElement(String name)
          Print the end tag of xml element.
 void printXMLStartCData()
          Start a CDATA section.
 void printXMLStartElement(String name)
          Print the start tag of xml element.
 void printXMLStartElement(String name, Attributes attributes)
          Print the start tag of xml element.
 void printXMLStartElement(String name, Map<String,String> attributes)
          Print the start tag of xml element.
 void printXMLStartElement(String name, String[][] attributes)
          Print the start tag of xml element.
 void setWikiPrinter(WikiPrinter printer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikiWriter

protected WikiWriter wikiWriter

xmlWriter

protected XMLWriter xmlWriter
Constructor Detail

XMLWikiPrinter

public XMLWikiPrinter(WikiPrinter printer)
Parameters:
printer - the object to which to write the XHTML output to
Method Detail

getXMLWriter

public XMLWriter getXMLWriter()

setWikiPrinter

public void setWikiPrinter(WikiPrinter printer)

printXML

public void printXML(String str)
Print provided text. Takes care of xml escaping.


printXMLElement

public void printXMLElement(String name)
Print the xml element. In the form .


printXMLElement

public void printXMLElement(String name,
                            String[][] attributes)
Print the xml element. In the form .


printXMLElement

public void printXMLElement(String name,
                            Map<String,String> attributes)
Print the xml element. In the form .


printXMLStartElement

public void printXMLStartElement(String name)
Print the start tag of xml element. In the form <name>.


printXMLStartElement

public void printXMLStartElement(String name,
                                 String[][] attributes)
Print the start tag of xml element. In the form <name att1="value1" att2="value2">.


printXMLStartElement

public void printXMLStartElement(String name,
                                 Map<String,String> attributes)
Print the start tag of xml element. In the form <name att1="value1" att2="value2">.


printXMLStartElement

public void printXMLStartElement(String name,
                                 Attributes attributes)
Print the start tag of xml element. In the form <name att1="value1" att2="value2">.


printXMLEndElement

public void printXMLEndElement(String name)
Print the end tag of xml element. In the form </name>.


printXMLComment

public void printXMLComment(String content)
Print a XML comment. Note that the content that you pass must be valid XML comment, ie not have -- characters (or - if it's the last character). If you're not sure what the comment content will be use printXMLComment(String, boolean) instead, passing true for the second parameter.

Parameters:
content - the comment content

printXMLComment

public void printXMLComment(String content,
                            boolean escape)
Print a XML comment.

Parameters:
content - the comment content
escape - indicate if comment content has to be escaped. XML content does not support -- and - (when it's the last character). Escaping is based on backslash. "- --\ -" give "- \-\-\\ \-\ ".

printXMLStartCData

public void printXMLStartCData()
Start a CDATA section.


printXMLEndCData

public void printXMLEndCData()
End a CDATA section.


printEntity

public void printEntity(String entity)

printRaw

public void printRaw(String row)
Print some text without escaping anything, it's supposed to be XML or at least contains only valid characters in XML text node.

Parameters:
row - the content