public class SquashAttributeHandler extends Object
Constructor and Description |
---|
SquashAttributeHandler(Writer out,
String attName,
boolean removeEmptyElement)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
flush()
Ensures that any pending output has been written.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
out(String text)
Writes a string raw.
|
void |
processingInstruction(String target,
String data) |
void |
setDocumentLocator(Locator locator) |
void |
setOutput(Writer out)
Sets the destination stream.
|
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
public SquashAttributeHandler(Writer out, String attName, boolean removeEmptyElement)
out
- output stream; SAX events are copied as XML text to hereattName
- name of attribute on level-0 element to removeremoveEmptyElement
- if true, then if removing the named
attribute from the level-0 element results in an element
with no interesting content and no other attributes,
the element itself is removed from the outputpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void setOutput(Writer out)
out
- output streampublic void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping
in interface ContentHandler
public void endPrefixMapping(String prefix)
endPrefixMapping
in interface ContentHandler
public void startDTD(String name, String publicId, String systemId)
startDTD
in interface LexicalHandler
public void endDTD()
endDTD
in interface LexicalHandler
public void startEntity(String name)
startEntity
in interface LexicalHandler
public void endEntity(String name)
endEntity
in interface LexicalHandler
public void flush() throws SAXException
SAXException
public void out(String text) throws SAXException
text
- string to writeSAXException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.