com.groiss.gui
Class HTMLOutputter

java.lang.Object
  extended by org.jdom.output.XMLOutputter
      extended by com.groiss.gui.HTMLOutputter
All Implemented Interfaces:
java.lang.Cloneable

public class HTMLOutputter
extends org.jdom.output.XMLOutputter

This ia a customized outputter that does not encode the \r chars and don't expand empty elements like br,img or input. The outputter is used if you call show() on a com.groiss.gui.Component subclass.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdom.output.XMLOutputter
org.jdom.output.XMLOutputter.NamespaceStack
 
Field Summary
static java.lang.String[] NOEXPAND
           
 
Fields inherited from class org.jdom.output.XMLOutputter
currentFormat, preserveFormat
 
Constructor Summary
HTMLOutputter()
           
 
Method Summary
 java.lang.String escapeElementEntities(java.lang.String str)
          This will take the three pre-defined entities in XML 1.0 (used specifically in XML elements) and convert their character representation to the appropriate entity reference, suitable for XML element content.
protected  void printElement(java.io.Writer out, org.jdom.Element element, int level, org.jdom.output.XMLOutputter.NamespaceStack namespaces)
          We change the format directive expandEmptyElements to false for HTML elements without content, for example br, img, input.
protected  void printProcessingInstruction(java.io.Writer out, org.jdom.ProcessingInstruction pi)
          This will handle printing of processing instructions.
 void setEscapeEntities(boolean escape)
          Set escape to false if you don't want to escape entities.
 
Methods inherited from class org.jdom.output.XMLOutputter
clone, escapeAttributeEntities, getFormat, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, outputElementContent, outputElementContent, outputString, outputString, outputString, outputString, outputString, outputString, outputString, outputString, outputString, printAttributes, printCDATA, printComment, printDeclaration, printDocType, printEntityRef, printText, setFormat, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOEXPAND

public static final java.lang.String[] NOEXPAND
Constructor Detail

HTMLOutputter

public HTMLOutputter()
Method Detail

setEscapeEntities

public void setEscapeEntities(boolean escape)
Set escape to false if you don't want to escape entities. This causes big trouble: security leaks, unparsable documents, etc. The function is for compatibility only.

Parameters:
escape -

escapeElementEntities

public java.lang.String escapeElementEntities(java.lang.String str)
This will take the three pre-defined entities in XML 1.0 (used specifically in XML elements) and convert their character representation to the appropriate entity reference, suitable for XML element content.

Overrides:
escapeElementEntities in class org.jdom.output.XMLOutputter
Parameters:
str - String input to escape.
Returns:
String with escaped content.

printProcessingInstruction

protected void printProcessingInstruction(java.io.Writer out,
                                          org.jdom.ProcessingInstruction pi)
                                   throws java.io.IOException
This will handle printing of processing instructions. No change in subclass.

Overrides:
printProcessingInstruction in class org.jdom.output.XMLOutputter
Parameters:
pi - ProcessingInstruction to write.
out - Writer to use.
Throws:
java.io.IOException

printElement

protected void printElement(java.io.Writer out,
                            org.jdom.Element element,
                            int level,
                            org.jdom.output.XMLOutputter.NamespaceStack namespaces)
                     throws java.io.IOException
We change the format directive expandEmptyElements to false for HTML elements without content, for example br, img, input. Some browsers (Safari) require this.

Overrides:
printElement in class org.jdom.output.XMLOutputter
Throws:
java.io.IOException


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.