public class JSContentHandler extends Object implements ContentHandler, LexicalHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCODING |
protected char[] |
indentBuffer |
protected int |
level |
protected Writer |
outputWriter |
| Constructor and Description |
|---|
JSContentHandler() |
JSContentHandler(Writer outputWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
close() |
protected boolean |
closeElement(boolean endElement)
Write the end part of a start element (if necessary).
|
void |
comment(char[] ch,
int start,
int length) |
protected void |
encode(char[] data)
Encode and write an array of characters.
|
protected void |
encode(char[] data,
int start,
int length)
Encode and write a specific part of an array of characters.
|
protected void |
encode(String data)
Encode and write a
String |
protected void |
encodeAttributeValue(Attributes attributes,
int idx) |
protected void |
encodeText(char[] chars,
int start,
int length) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String uri,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
int |
getColumnNumber()
Return the column number where the current document event ends.
|
int |
getLineNumber()
Return the line number where the current document event ends.
|
protected String |
getLocation()
Return a
String describing the current location. |
String |
getPublicId()
Return the public identifier for the current document event.
|
String |
getSystemId()
Return the system identifier for the current document event.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
protected boolean |
isBeforeDocumentStart() |
protected boolean |
isProcessingCdata() |
void |
processingInstruction(String target,
String data) |
void |
setDocumentLocator(Locator locator)
Receive an object for locating the origin of SAX document events.
|
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
protected void |
writeIndent(int indent) |
public static final String DEFAULT_ENCODING
protected char[] indentBuffer
protected int level
protected Writer outputWriter
public JSContentHandler()
public JSContentHandler(Writer outputWriter)
outputWriter - public void close()
throws IOException
IOExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionprotected boolean closeElement(boolean endElement)
throws SAXException
endElement - Whether this method was called because an element is being closed or not.</element> is
required.SAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic final void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic String getPublicId()
String containing the public identifier, or null if none is available.public String getSystemId()
String containing the system identifier, or null if none is available.public int getLineNumber()
public int getColumnNumber()
protected String getLocation()
String describing the current location.public void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement in interface ContentHandlerSAXExceptionprotected void encodeAttributeValue(Attributes attributes, int idx) throws SAXException, IOException
SAXExceptionIOExceptionprotected void encodeText(char[] chars,
int start,
int length)
throws SAXException,
IOException
SAXExceptionIOExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionprotected void writeIndent(int indent)
throws SAXException
SAXExceptionprotected void encode(String data) throws SAXException
StringSAXExceptionprotected void encode(char[] data)
throws SAXException
SAXExceptionprotected void encode(char[] data,
int start,
int length)
throws SAXException
SAXExceptionprotected boolean isProcessingCdata()
protected boolean isBeforeDocumentStart()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.