org.apache.cocoon.xml.sax
Class SAXUtils

java.lang.Object
  extended by org.apache.cocoon.xml.sax.SAXUtils

public class SAXUtils
extends Object

XML utility methods.

Version:
$Id: SAXUtils.java 729283 2008-12-24 09:25:21Z cziegeler $

Field Summary
static Attributes EMPTY_ATTRIBUTES
          Empty attributes immutable object.
 
Constructor Summary
SAXUtils()
           
 
Method Summary
static void createElement(ContentHandler contentHandler, String localName)
          Create a start and endElement with a empty Namespace and without Attributes
static void createElement(ContentHandler contentHandler, String localName, Attributes atts)
          Create a start and endElement with a empty Namespace
static void createElement(ContentHandler contentHandler, String localName, Attributes atts, String stringValue)
          Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
static void createElement(ContentHandler contentHandler, String localName, String stringValue)
          Create a start and endElement with a empty Namespace and without Attributes The content of the Element is set to the stringValue parameter
static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName)
          Create a start and endElement without Attributes
static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts)
          Create a start and endElement
static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts, String stringValue)
          Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, String stringValue)
          Create a start and endElement without Attributes The content of the Element is set to the stringValue parameter
static void data(ContentHandler contentHandler, String data)
          Add string data
static void endElement(ContentHandler contentHandler, String localName)
          Create endElement with empty Namespace For information on the names, see startElement.
static void endElement(ContentHandler contentHandler, String namespaceURI, String localName)
          Create endElement Prefix must be mapped to empty String For information on the names, see startElement.
static void startElement(ContentHandler contentHandler, String localName)
          Create a startElement with a empty Namespace and without Attributes
static void startElement(ContentHandler contentHandler, String localName, Attributes atts)
          Create a startElement with a empty Namespace
static void startElement(ContentHandler contentHandler, String namespaceURI, String localName)
          Create a startElement without Attributes Prefix must be mapped to empty String
static void startElement(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts)
          Create a startElement with a empty Namespace Prefix must be mapped to empty String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ATTRIBUTES

public static final Attributes EMPTY_ATTRIBUTES
Empty attributes immutable object.

Constructor Detail

SAXUtils

public SAXUtils()
Method Detail

data

public static void data(ContentHandler contentHandler,
                        String data)
                 throws SAXException
Add string data

Parameters:
contentHandler - The SAX content handler
data - The string data
Throws:
SAXException

createElement

public static void createElement(ContentHandler contentHandler,
                                 String localName)
                          throws SAXException
Create a start and endElement with a empty Namespace and without Attributes

Parameters:
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

createElement

public static void createElement(ContentHandler contentHandler,
                                 String localName,
                                 String stringValue)
                          throws SAXException
Create a start and endElement with a empty Namespace and without Attributes The content of the Element is set to the stringValue parameter

Parameters:
localName - The local name (without prefix)
stringValue - The content of the Element
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

createElement

public static void createElement(ContentHandler contentHandler,
                                 String localName,
                                 Attributes atts)
                          throws SAXException
Create a start and endElement with a empty Namespace

Parameters:
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes

createElement

public static void createElement(ContentHandler contentHandler,
                                 String localName,
                                 Attributes atts,
                                 String stringValue)
                          throws SAXException
Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter

Parameters:
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
stringValue - The content of the Element
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes

createElementNS

public static void createElementNS(ContentHandler contentHandler,
                                   String namespaceURI,
                                   String localName)
                            throws SAXException
Create a start and endElement without Attributes

Parameters:
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

createElementNS

public static void createElementNS(ContentHandler contentHandler,
                                   String namespaceURI,
                                   String localName,
                                   String stringValue)
                            throws SAXException
Create a start and endElement without Attributes The content of the Element is set to the stringValue parameter

Parameters:
localName - The local name (without prefix)
stringValue - The content of the Element
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

createElementNS

public static void createElementNS(ContentHandler contentHandler,
                                   String namespaceURI,
                                   String localName,
                                   Attributes atts)
                            throws SAXException
Create a start and endElement

Parameters:
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes

createElementNS

public static void createElementNS(ContentHandler contentHandler,
                                   String namespaceURI,
                                   String localName,
                                   Attributes atts,
                                   String stringValue)
                            throws SAXException
Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter

Parameters:
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
stringValue - The content of the Element
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes

endElement

public static void endElement(ContentHandler contentHandler,
                              String localName)
                       throws SAXException
Create endElement with empty Namespace

For information on the names, see startElement.

Parameters:
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

endElement

public static void endElement(ContentHandler contentHandler,
                              String namespaceURI,
                              String localName)
                       throws SAXException
Create endElement Prefix must be mapped to empty String

For information on the names, see startElement.

Parameters:
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

startElement

public static void startElement(ContentHandler contentHandler,
                                String localName)
                         throws SAXException
Create a startElement with a empty Namespace and without Attributes

Parameters:
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

startElement

public static void startElement(ContentHandler contentHandler,
                                String namespaceURI,
                                String localName)
                         throws SAXException
Create a startElement without Attributes Prefix must be mapped to empty String

Parameters:
namespaceURI - The Namespace URI
localName - The local name (without prefix)
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String)

startElement

public static void startElement(ContentHandler contentHandler,
                                String localName,
                                Attributes atts)
                         throws SAXException
Create a startElement with a empty Namespace

Parameters:
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes

startElement

public static void startElement(ContentHandler contentHandler,
                                String namespaceURI,
                                String localName,
                                Attributes atts)
                         throws SAXException
Create a startElement with a empty Namespace Prefix must be mapped to empty String

Parameters:
namespaceURI - The Namespace URI
localName - The local name (without prefix)
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(ContentHandler, String), Attributes


Copyright © 1999-2009 The Apache Software Foundation. All Rights Reserved.