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 ContentHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void setOutput(Writer out)
out - output streampublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri)
startPrefixMapping in interface ContentHandlerpublic void endPrefixMapping(String prefix)
endPrefixMapping in interface ContentHandlerpublic void startDTD(String name, String publicId, String systemId)
startDTD in interface LexicalHandlerpublic void endDTD()
endDTD in interface LexicalHandlerpublic void startEntity(String name)
startEntity in interface LexicalHandlerpublic void endEntity(String name)
endEntity in interface LexicalHandlerpublic void flush()
throws SAXException
SAXExceptionpublic void out(String text) throws SAXException
text - string to writeSAXExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.