class: ShortContentHandler

public class: ShortContentHandler
Author: franke (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 1743 $ $LastChangedDate: 2009-03-25 11:; Complexity: 1
Dates: Created: 16.07.2009 15:13:17; Modified: 16.07.2009 15:13:17;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {BEB3ACD2-E667-4931-9DAB-83FCDA6B425A}
Generic SAX handler with convenience methods. Useful for XML with only short string content. Classes that extend this class should always call super() at the beginning of an overridden method. Important: This class is not useful for XMLs with mixed contents: <a><b/>xyz</a>
 

Goto: Custom Properties, Fields, Methods

See also: IdentityHandler, XMLStack, XMLStack, RDFHandler

Appears in: util

Connections
 
Custom Properties
 
ShortContentHandler Attributes
Attribute Details
private StringBuffer
  currentContent
protected XMLStack
  localStack
Initial: new XMLStack()
protected Map
  namespaces
Initial: null
protected HashMap>
  namespacesMap
Initial: new HashMap>()
protected XMLStack
  stack
Initial: new XMLStack()
 
ShortContentHandler Methods
Operation Details
public const
characters(
   char[] ch,
   int start,
   int length):void
Sequential
Tags: annotations=@Override
throws=SAXException
Notes: Append characters to current content.
public
content(
   String uri,
   String localName,
   String name,
   String content):void
Sequential
Tags: throws=SAXException
Notes: Called when string content was found.
public
encodeAttribute(
   String str):String
Sequential
Notes: Encodes an XML attribute. Replaces characters that might break the XML into XML entities. Includes " and '.
@return The encoded string
public
encodeContent(
   String str):String
Sequential
Notes: Encodes XML string content. Replaces characters that might break the XML into XML entities.
@return The encoded string
public
endElement(
   String uri,
   String localName,
   String name):void
Sequential
Tags: annotations=@Override
throws=SAXException
Notes: Call {@link ShortContentHandler.content} if there is some. Then delete Current content.
public
getLocalStack():XMLStack
Sequential
public
getNamespaces():Map
Sequential
public
getStack():XMLStack
Sequential
public
startElement(
   String uri,
   String localName,
   String name,
   Attributes attributes):void
Sequential
Tags: annotations=@Override
throws=SAXException
Notes: Manage stack and namespaces.