org.millscript.millscript.render
Class HTMLCDATARenderer

java.lang.Object
  extended by org.millscript.millscript.render.HTMLCDATARenderer
All Implemented Interfaces:
Renderer

public final class HTMLCDATARenderer
extends java.lang.Object
implements Renderer

This renderer is used for rendering the CDATA content of an element in HTML. As such it delegates most of it's rendering methods to a normal HTML renderer.


Constructor Summary
HTMLCDATARenderer(HTMLRenderer hr)
          Constructs a new HTML CDATA renderer, to use the specified HTML renderer for rendering.
 
Method Summary
 void append(char ch)
          Appends the specified character, allowing the character to be escaped as appropriate for this renderer.
 void append(java.lang.CharSequence cs)
          Appends the specified character sequence, allowing any the sequences characters to be escaped as appropriate for this renderer.
 void appendEscapeFor(char ch)
          Appends the escape sequence for the specified character.
 void appendNoEscape(char ch)
          Appends the specified character, without using an escape sequence.
 void appendNoEscape(java.lang.CharSequence cs)
          Appends the specified character sequence, without escaping any characters in the sequence.
 boolean canEncode(char ch)
          Checks if the specified character can be encoded by this renderer.
 void render(java.lang.Object o)
          Renders the specified object with this renderer.
 void renderAsDocument(java.lang.Object o)
          Renders the specified object to the output file and then closes it.
 void renderAsFragment(org.millscript.commons.util.IList l)
          Renders the specified object to the output file as a fragment of a complete document.
 void renderCDATA(CDATA c)
          Renders the specified CDATA object using this renderer.
 void renderDocumentFooter()
          Renders the required document footer for this renderer.
 void renderDocumentHeader()
          Renders the required document header for this renderer.
 void renderObject(java.lang.Object o)
          Renders the specified object using this renderer.
 void renderXMLComment(XmlComment c)
          Renders the specified XML comment using this renderer.
 void renderXMLElement(XmlElement x)
          Renders the specified XML element using this renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLCDATARenderer

public HTMLCDATARenderer(HTMLRenderer hr)
Constructs a new HTML CDATA renderer, to use the specified HTML renderer for rendering.

Parameters:
hr - the HTML renderer to delegate to
Method Detail

append

public void append(char ch)
            throws java.io.IOException
Description copied from interface: Renderer
Appends the specified character, allowing the character to be escaped as appropriate for this renderer.

Specified by:
append in interface Renderer
Parameters:
ch - the character to append, allowing it to be escaped
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.append(char)

append

public void append(java.lang.CharSequence cs)
            throws java.io.IOException
Description copied from interface: Renderer
Appends the specified character sequence, allowing any the sequences characters to be escaped as appropriate for this renderer.

Specified by:
append in interface Renderer
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.append(java.lang.CharSequence)

appendEscapeFor

public void appendEscapeFor(char ch)
                     throws java.io.IOException
Description copied from interface: Renderer
Appends the escape sequence for the specified character.

Specified by:
appendEscapeFor in interface Renderer
Parameters:
ch - the character to append an escape sequence for
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.appendEscapeFor(char)

appendNoEscape

public void appendNoEscape(char ch)
                    throws java.io.IOException
Description copied from interface: Renderer
Appends the specified character, without using an escape sequence. This method will raise an alert if the character cannot be appended without an escape sequence.

Specified by:
appendNoEscape in interface Renderer
Parameters:
ch - the character to append, without using an escape sequence.
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.appendNoEscape(char)

appendNoEscape

public void appendNoEscape(java.lang.CharSequence cs)
                    throws java.io.IOException
Description copied from interface: Renderer
Appends the specified character sequence, without escaping any characters in the sequence. This method will raise an alert if any of the characters cannot be appended without an escape sequence.

Specified by:
appendNoEscape in interface Renderer
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.appendNoEscape(java.lang.CharSequence)

canEncode

public boolean canEncode(char ch)
Description copied from interface: Renderer
Checks if the specified character can be encoded by this renderer.

Specified by:
canEncode in interface Renderer
Parameters:
ch - the character to check
Returns:
true if the character can be encoded by this renderer
See Also:
Renderer.canEncode(char)

render

public void render(java.lang.Object o)
            throws java.io.IOException
Description copied from interface: Renderer
Renders the specified object with this renderer.

Specified by:
render in interface Renderer
Parameters:
o - the object to render
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.render(java.lang.Object)

renderAsDocument

public void renderAsDocument(java.lang.Object o)
Description copied from interface: Renderer
Renders the specified object to the output file and then closes it. A document will have a DOCTYPE relevant to the specific type of file being rendered.

Specified by:
renderAsDocument in interface Renderer
Parameters:
o - the object to render to the file
See Also:
Renderer.renderAsDocument(java.lang.Object)

renderAsFragment

public void renderAsFragment(org.millscript.commons.util.IList l)
Description copied from interface: Renderer
Renders the specified object to the output file as a fragment of a complete document. A fragment will not have a DOCTYPE, just the incomplete fragment of a complete document.

Specified by:
renderAsFragment in interface Renderer
Parameters:
l - the list of objects to write to the file
See Also:
Renderer.renderAsFragment(org.millscript.commons.util.IList)

renderCDATA

public void renderCDATA(CDATA c)
                 throws java.io.IOException
Description copied from interface: Renderer
Renders the specified CDATA object using this renderer.

Specified by:
renderCDATA in interface Renderer
Parameters:
c - the CDATA object to render
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderCDATA(org.millscript.millscript.datatypes.CDATA)

renderDocumentFooter

public void renderDocumentFooter()
                          throws java.io.IOException
Description copied from interface: Renderer
Renders the required document footer for this renderer.

Specified by:
renderDocumentFooter in interface Renderer
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderDocumentFooter()

renderDocumentHeader

public void renderDocumentHeader()
                          throws java.io.IOException
Description copied from interface: Renderer
Renders the required document header for this renderer.

Specified by:
renderDocumentHeader in interface Renderer
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderDocumentHeader()

renderObject

public void renderObject(java.lang.Object o)
                  throws java.io.IOException
Description copied from interface: Renderer
Renders the specified object using this renderer.

Specified by:
renderObject in interface Renderer
Parameters:
o - the object to render
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderObject(java.lang.Object)

renderXMLComment

public void renderXMLComment(XmlComment c)
                      throws java.io.IOException
Description copied from interface: Renderer
Renders the specified XML comment using this renderer.

Specified by:
renderXMLComment in interface Renderer
Parameters:
c - the XML comment to render
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderXMLComment(org.millscript.millscript.datatypes.XmlComment)

renderXMLElement

public void renderXMLElement(XmlElement x)
                      throws java.io.IOException
Description copied from interface: Renderer
Renders the specified XML element using this renderer.

Specified by:
renderXMLElement in interface Renderer
Parameters:
x - the XML element to render
Throws:
java.io.IOException - thrown if an IO problem occurs
See Also:
Renderer.renderXMLElement(org.millscript.millscript.datatypes.XmlElement)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.