org.apache.tapestry.dom
Class DefaultMarkupModel

java.lang.Object
  extended by org.apache.tapestry.dom.DefaultMarkupModel
All Implemented Interfaces:
MarkupModel
Direct Known Subclasses:
XMLMarkupModel

public class DefaultMarkupModel
extends Object
implements MarkupModel

Default implementation of MarkupModel that is appropriate for traditional HTML markup. This conforms to the SGML HTML definition, including some things that are not well formed XML-style markup. Assumes that all tags are lower-case.


Constructor Summary
DefaultMarkupModel()
           
 
Method Summary
 void encode(String content, StringBuilder buffer)
          Passes all characters but '<', '>' and '&' through unchanged.
 void encodeQuoted(String content, StringBuilder buffer)
          Encodes the characters into the buffer for use in a quoted value (that is, an attribute value), converting control characters (such as '<') into corresponding entities (such as &lt;).
 EndTagStyle getEndTagStyle(String element)
          For a given element, determines how the end tag for the element should be rendered.
 boolean isXML()
          Returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMarkupModel

public DefaultMarkupModel()
Method Detail

encode

public void encode(String content,
                   StringBuilder buffer)
Passes all characters but '<', '>' and '&' through unchanged.

Specified by:
encode in interface MarkupModel
Parameters:
content - to be filtered
buffer - to receive the filtered content

encodeQuoted

public void encodeQuoted(String content,
                         StringBuilder buffer)
Description copied from interface: MarkupModel
Encodes the characters into the buffer for use in a quoted value (that is, an attribute value), converting control characters (such as '<') into corresponding entities (such as &lt;). In addition, double quotes must be quoted or otherwise escaped.

Specified by:
encodeQuoted in interface MarkupModel
Parameters:
content - to be filtered
buffer - to receive the filtered content

getEndTagStyle

public EndTagStyle getEndTagStyle(String element)
Description copied from interface: MarkupModel
For a given element, determines how the end tag for the element should be rendered.

Specified by:
getEndTagStyle in interface MarkupModel

isXML

public boolean isXML()
Returns false.

Specified by:
isXML in interface MarkupModel
Returns:
true for XML output, false for HTML (SGML) output


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.