public class SimpleElementHandler extends org.xml.sax.helpers.DefaultHandler
SimpleElementHandler is a default handler that
supplies utilities for simple elements and attributes.| Modifier and Type | Field and Description |
|---|---|
protected static String |
CDATA_ATTS_TYPE
The type of character data attributes.
|
static Attributes |
EMPTY_ATTS
An implementation of
Attributes with no
attributes. |
static org.xml.sax.helpers.DefaultHandler |
NO_OP_DEFAULT_HANDLER
A default handler which performs no operation for any method
calls.
|
| Constructor and Description |
|---|
SimpleElementHandler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addSimpleAttribute(org.xml.sax.helpers.AttributesImpl atts,
String localName,
String value)
Add a local name and value to an attributes implementation
as type
"CDATA". |
void |
characters(char[] cs)
Handls the specified character array by delegation to
DefaultHandler.characters(char[],int,int). |
static void |
characters(org.xml.sax.helpers.DefaultHandler handler,
char[] cs)
Handls the specified character array by delegation to
DefaultHandler.characters(char[],int,int). |
static void |
characters(org.xml.sax.helpers.DefaultHandler handler,
String s)
Converts the string to a character array in order to
call
DefaultHandler.characters(char[],int,int) to handle the
characters. |
void |
characters(String s)
Converts the string to a character array in order to
call
DefaultHandler.characters(char[],int,int) to handle the
characters. |
static Attributes |
createAttributes(String attribute,
String value)
Create an attributes list with the specified attribute
and value.
|
static Attributes |
createAttributes(String attribute1,
String value1,
String attribute2,
String value2)
Create an attributes list with the specified pair of
attributes.
|
static Attributes |
createAttributes(String attribute1,
String value1,
String attribute2,
String value2,
String attribute3,
String value3)
Create an attributes list with the specified tripe of
attributes and values.
|
static Attributes |
createAttributes(String attribute1,
String value1,
String attribute2,
String value2,
String attribute3,
String value3,
String attribute4,
String value4)
Create an attributes list with the specified four attributes and values.
|
static Attributes |
createAttributes(String attribute1,
String value1,
String attribute2,
String value2,
String attribute3,
String value3,
String attribute4,
String value4,
String attribute5,
String value5)
Create an attributes list with the specified five attributes
and values.
|
static Attributes |
createAttributes(String attribute1,
String value1,
String attribute2,
String value2,
String attribute3,
String value3,
String attribute4,
String value4,
String attribute5,
String value5,
String attribute6,
String value6)
Create an attributes list with the specified six attributes
and values.
|
static void |
endSimpleElement(org.xml.sax.helpers.DefaultHandler handler,
String localName)
End an element for the specified handler with a
null namespace, using the local name for both
local and qualified names. |
void |
endSimpleElement(String localName)
End an element with a
null namespace, using
the local name for both local and qualified names. |
void |
startEndSimpleElement(String localName)
Starts and then ends a simple element of the specified
local name.
|
void |
startEndSimpleElement(String localName,
Attributes atts)
Starts and then ends a simple element of the specified
local name with the specified attributes.
|
static void |
startSimpleElement(org.xml.sax.helpers.DefaultHandler handler,
String name)
Starts an element with a
null namespace
and no attributes. |
static void |
startSimpleElement(org.xml.sax.helpers.DefaultHandler handler,
String localName,
Attributes atts)
Starts an element with a
null namespace and the
specified local name, which is also provided as the qualified
name. |
static void |
startSimpleElement(org.xml.sax.helpers.DefaultHandler handler,
String name,
String att,
String value)
Starts an element with a
null namespace and a
single attribute and value. |
void |
startSimpleElement(String name)
Starts an element with a
null namespace
and no attributes. |
void |
startSimpleElement(String localName,
Attributes atts)
Starts an element with a
null namespace and the
specified local name, which is also provided as the qualified
name. |
void |
startSimpleElement(String name,
String att,
String value)
Starts an element with a
null namespace and a
single attribute and value. |
void |
startSimpleElement(String name,
String att1,
String val1,
String att2,
String val2)
Starts an element with a
null namespace and a
pair of attributes and values. |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warningpublic static final Attributes EMPTY_ATTS
Attributes with no
attributes.public static final org.xml.sax.helpers.DefaultHandler NO_OP_DEFAULT_HANDLER
protected static final String CDATA_ATTS_TYPE
public void characters(String s) throws SAXException
DefaultHandler.characters(char[],int,int) to handle the
characters.s - String whose characters are to be handled.SAXException - if the handler throws a SAX exception.public void characters(char[] cs)
throws SAXException
DefaultHandler.characters(char[],int,int).cs - Character array to be handled.SAXException - if the handler throws a SAX exception.public void startSimpleElement(String name) throws SAXException
null namespace
and no attributes.name - Name of element to start.SAXException - if the contained hanlder throws a SAX
exception.startSimpleElement(String,Attributes)public void startSimpleElement(String name, String att, String value) throws SAXException
null namespace and a
single attribute and value.name - Name of element to start.att - Name of single attribute.value - The attribute's value.SAXException - if the contained hanlder throws a SAX
exception.startSimpleElement(String,Attributes)public void startSimpleElement(String name, String att1, String val1, String att2, String val2) throws SAXException
null namespace and a
pair of attributes and values.name - Name of element to start.att1 - Name of the first attribute.val1 - Value of the first attribute.att2 - Name of the second attribute.val2 - Value of the second attribute.SAXException - if the contained hanlder throws a SAX
exception.public void startSimpleElement(String localName, Attributes atts) throws SAXException
null namespace and the
specified local name, which is also provided as the qualified
name.localName - Local name of element to start.atts - Attributes for this element.SAXException - if the contained hanlder throws a SAX
exception.public void endSimpleElement(String localName) throws SAXException
null namespace, using
the local name for both local and qualified names.localName - Local name of element to end.SAXException - if the contained hanlder throws a SAX
exception.public void startEndSimpleElement(String localName) throws SAXException
localName - Name of element.SAXException - If the contained handler throws a SAX
exception.public void startEndSimpleElement(String localName, Attributes atts) throws SAXException
localName - Name of element.atts - Attributes for the element.SAXException - If the contained handler throws a SAX
exception.public static void addSimpleAttribute(org.xml.sax.helpers.AttributesImpl atts, String localName, String value)
"CDATA". Sets both local and qualified
name on attribute.atts - Attributes to which the specified attribute and
value are added.localName - Local name of attribute to add.value - Value of attribute to add.public static final Attributes createAttributes(String attribute, String value)
attribute - Name of attribute.value - Value of attribute.public static final Attributes createAttributes(String attribute1, String value1, String attribute2, String value2)
attribute1 - Name of first attribute.value1 - Value of first attribute.attribute2 - Name of second attribute.value2 - Value of second attribute.public static final Attributes createAttributes(String attribute1, String value1, String attribute2, String value2, String attribute3, String value3)
attribute1 - Name of first attribute.value1 - Value of first attribute.attribute2 - Name of second attribute.value2 - Value of second attribute.attribute3 - Name of third attribute.value3 - Value of third attribute.public static final Attributes createAttributes(String attribute1, String value1, String attribute2, String value2, String attribute3, String value3, String attribute4, String value4)
attribute1 - Name of first attribute.value1 - Value of first attribute.attribute2 - Name of second attribute.value2 - Value of second attribute.attribute3 - Name of third attribute.value3 - Value of third attribute.attribute4 - Name of fourth attribute.value4 - Value of fourth attribute.public static final Attributes createAttributes(String attribute1, String value1, String attribute2, String value2, String attribute3, String value3, String attribute4, String value4, String attribute5, String value5)
attribute1 - Name of first attribute.value1 - Value of first attribute.attribute2 - Name of second attribute.value2 - Value of second attribute.attribute3 - Name of third attribute.value3 - Value of third attribute.attribute4 - Name of fourth attribute.value4 - Value of fourth attribute.attribute5 - Name of fifth attribute.value5 - Value of fifth attribute.public static final Attributes createAttributes(String attribute1, String value1, String attribute2, String value2, String attribute3, String value3, String attribute4, String value4, String attribute5, String value5, String attribute6, String value6)
attribute1 - Name of first attribute.value1 - Value of first attribute.attribute2 - Name of second attribute.value2 - Value of second attribute.attribute3 - Name of third attribute.value3 - Value of third attribute.attribute4 - Name of fourth attribute.value4 - Value of fourth attribute.attribute5 - Name of fifth attribute.value5 - Value of fifth attribute.attribute6 - Name of sixth attribute.value6 - Value of sixth attribute.public static void characters(org.xml.sax.helpers.DefaultHandler handler, String s) throws SAXException
DefaultHandler.characters(char[],int,int) to handle the
characters.handler - Handler for resulting event.s - String whose characters are to be handled.SAXException - if the handler throws a SAX exception.public static void characters(org.xml.sax.helpers.DefaultHandler handler, char[] cs) throws SAXException
DefaultHandler.characters(char[],int,int).handler - Handler for resulting event.cs - Character array to be handled.SAXException - if the handler throws a SAX exception.public static void startSimpleElement(org.xml.sax.helpers.DefaultHandler handler, String name) throws SAXException
null namespace
and no attributes.handler - Handler for resulting event.name - Name of element to start.SAXException - if the contained hanlder throws a SAX
exception.public static void startSimpleElement(org.xml.sax.helpers.DefaultHandler handler, String name, String att, String value) throws SAXException
null namespace and a
single attribute and value.handler - Handler for resulting event.name - Name of element to start.att - Name of single attribute.value - The attribute's value.SAXException - if the contained hanlder throws a SAX
exception.startSimpleElement(String,Attributes)public static void startSimpleElement(org.xml.sax.helpers.DefaultHandler handler, String localName, Attributes atts) throws SAXException
null namespace and the
specified local name, which is also provided as the qualified
name.handler - Handler for resulting event.localName - Local name of element to start.atts - Attributes for this element.SAXException - if the contained hanlder throws a SAX
exception.public static void endSimpleElement(org.xml.sax.helpers.DefaultHandler handler, String localName) throws SAXException
null namespace, using the local name for both
local and qualified names.handler - Handler for resulting event.localName - Local name of element to end.SAXException - if the contained hanlder throws a SAX
exception.Copyright © 2019 Alias-i, Inc.. All rights reserved.