org.enhydra.xml.io
Class HTMLElements

java.lang.Object
  |
  +--org.enhydra.xml.io.HTMLElements

public final class HTMLElements
extends Object

Information about HTML elements and attributes for use HTML formatter.


Field Summary
static Integer BLOCK_FORMATTING
          Format element as a block.
static Integer HEADER_FORMATTING
          Format element as a header.
static Integer INLINE_FORMATTING
          Format element as a inline.
 
Method Summary
(package private) static void ()
          Static constructor.
 Integer getElementFormatting(String tagName)
          Determine the formatting to use for an element.
static boolean hasCloseTag(String tagName)
          Check if an element is may have a close tag.
static boolean isBooleanAttr(String attrName)
          Check if an attribute does not have a value (is boolean).
static boolean isPreserveSpaceTag(String tagName)
          Tests if a tag is one reserved for preserving space and, therefore, no formatting.
static boolean isScriptStyle(Element element)
          Deprecated. use isScriptStyleTag(String) instead
static boolean isScriptStyleTag(String tagName)
          Tests if a tag is one reserved for no formatting whatsoever, including preserving space and no special character or entity resolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_FORMATTING

public static final Integer BLOCK_FORMATTING
Format element as a block.

HEADER_FORMATTING

public static final Integer HEADER_FORMATTING
Format element as a header.

INLINE_FORMATTING

public static final Integer INLINE_FORMATTING
Format element as a inline.
Method Detail

static void ()
Static constructor.

isBooleanAttr

public static boolean isBooleanAttr(String attrName)
Check if an attribute does not have a value (is boolean).
Parameters:
attrName - Nme of attribute, must be lower-case.

getElementFormatting

public Integer getElementFormatting(String tagName)
Determine the formatting to use for an element. Unknown elements are returned as INLINE_FORMATTING.
Parameters:
tagName - Name of element, must be upper-case.
Returns:
One of the *_FORMATTING constants; references can be compared.

hasCloseTag

public static boolean hasCloseTag(String tagName)
Check if an element is may have a close tag.
Parameters:
tagName - Name of element, must be upper-case.

isScriptStyle

public static boolean isScriptStyle(Element element)
Deprecated. use isScriptStyleTag(String) instead

Test if an Element is a script or style element, which have special content handling.

isScriptStyleTag

public static boolean isScriptStyleTag(String tagName)
Tests if a tag is one reserved for no formatting whatsoever, including preserving space and no special character or entity resolution.
Parameters:
tagName - Name of element, must be upper-case.
Returns:
true for "SCRIPT" or "STYLE", otherwise false

isPreserveSpaceTag

public static boolean isPreserveSpaceTag(String tagName)
Tests if a tag is one reserved for preserving space and, therefore, no formatting.
Parameters:
tagName - Name of element, must be upper-case.
Returns:
true for "PRE", "SCRIPT", or "STYLE", otherwise false


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.