org.xwiki.rendering.renderer.printer
Class XHTMLWikiPrinter

java.lang.Object
  extended by org.xwiki.rendering.renderer.printer.XMLWikiPrinter
      extended by org.xwiki.rendering.renderer.printer.XHTMLWikiPrinter

public class XHTMLWikiPrinter
extends XMLWikiPrinter

Base toolkit class for all XHTML-based renderers. This printer handles whitespaces so that it prints " " when needed (i.e. when the spaces are at the beginning or at the end of an element's content or when there are more than 1 contiguous spaces, except for CDATA sections and inside PRE elements. It also knows how to handle XHTML comments).

Since:
1.7M1
Version:
$Id: 23081112f8d7950caa0c769fb2be0ebce2f749fe $

Field Summary
 
Fields inherited from class org.xwiki.rendering.renderer.printer.XMLWikiPrinter
wikiWriter, xmlWriter
 
Constructor Summary
XHTMLWikiPrinter(WikiPrinter printer)
           
 
Method Summary
 void printRaw(String raw)
          Print some text without escaping anything, it's supposed to be XML or at least contains only valid characters in XML text node.
 void printSpace()
          This method should be used to print a space rather than calling printXML(" ").
 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.
 
Methods inherited from class org.xwiki.rendering.renderer.printer.XMLWikiPrinter
getXMLWriter, printEntity, setWikiPrinter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XHTMLWikiPrinter

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

printXML

public void printXML(String str)
Description copied from class: XMLWikiPrinter
Print provided text. Takes care of xml escaping.

Overrides:
printXML in class XMLWikiPrinter

printXMLElement

public void printXMLElement(String name)
Description copied from class: XMLWikiPrinter
Print the xml element. In the form .

Overrides:
printXMLElement in class XMLWikiPrinter

printXMLElement

public void printXMLElement(String name,
                            String[][] attributes)
Description copied from class: XMLWikiPrinter
Print the xml element. In the form .

Overrides:
printXMLElement in class XMLWikiPrinter

printXMLElement

public void printXMLElement(String name,
                            Map<String,String> attributes)
Description copied from class: XMLWikiPrinter
Print the xml element. In the form .

Overrides:
printXMLElement in class XMLWikiPrinter

printXMLStartElement

public void printXMLStartElement(String name)
Description copied from class: XMLWikiPrinter
Print the start tag of xml element. In the form <name>.

Overrides:
printXMLStartElement in class XMLWikiPrinter

printXMLStartElement

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

Overrides:
printXMLStartElement in class XMLWikiPrinter

printXMLStartElement

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

Overrides:
printXMLStartElement in class XMLWikiPrinter

printXMLStartElement

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

Overrides:
printXMLStartElement in class XMLWikiPrinter

printXMLEndElement

public void printXMLEndElement(String name)
Description copied from class: XMLWikiPrinter
Print the end tag of xml element. In the form </name>.

Overrides:
printXMLEndElement in class XMLWikiPrinter

printXMLComment

public void printXMLComment(String content)
Description copied from class: XMLWikiPrinter
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 XMLWikiPrinter.printXMLComment(String, boolean) instead, passing true for the second parameter.

Overrides:
printXMLComment in class XMLWikiPrinter
Parameters:
content - the comment content

printXMLComment

public void printXMLComment(String content,
                            boolean escape)
Description copied from class: XMLWikiPrinter
Print a XML comment.

Overrides:
printXMLComment in class XMLWikiPrinter
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()
Description copied from class: XMLWikiPrinter
Start a CDATA section.

Overrides:
printXMLStartCData in class XMLWikiPrinter

printXMLEndCData

public void printXMLEndCData()
Description copied from class: XMLWikiPrinter
End a CDATA section.

Overrides:
printXMLEndCData in class XMLWikiPrinter

printSpace

public void printSpace()
This method should be used to print a space rather than calling printXML(" ").


printRaw

public void printRaw(String raw)
Description copied from class: XMLWikiPrinter
Print some text without escaping anything, it's supposed to be XML or at least contains only valid characters in XML text node.

Overrides:
printRaw in class XMLWikiPrinter
Parameters:
raw - the content


Copyright © 2004–2015 XWiki. All rights reserved.