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
IOException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
SAXException
protected boolean closeElement(boolean endElement) throws SAXException
endElement
- Whether this method was called because an element is being closed or not.</element>
is
required.SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public final void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public 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 ContentHandler
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
SAXException
protected void encodeAttributeValue(Attributes attributes, int idx) throws SAXException, IOException
SAXException
IOException
protected void encodeText(char[] chars, int start, int length) throws SAXException, IOException
SAXException
IOException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
SAXException
protected void writeIndent(int indent) throws SAXException
SAXException
protected void encode(String data) throws SAXException
String
SAXException
protected void encode(char[] data) throws SAXException
SAXException
protected void encode(char[] data, int start, int length) throws SAXException
SAXException
protected boolean isProcessingCdata()
protected boolean isBeforeDocumentStart()
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.