sk.uniba.euromath.tools.xml.sax
Class AttributeReplacerHandler
java.lang.Object
sk.uniba.euromath.tools.xml.sax.ContentHandlerDelegate
sk.uniba.euromath.tools.xml.sax.AttributeReplacerHandler
- All Implemented Interfaces:
- ContentHandler
public class AttributeReplacerHandler
- extends ContentHandlerDelegate
Replaces attributes in all elements, optionally ensuring that each replaced
attribute has unique value. Sends all invoked events to given sink.
- Author:
- Martin Vysny
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
attrReplace
public final QName attrReplace
- Attribute to be replaced. Prefix part is ignored.
attrReplaceWith
public final QName attrReplaceWith
- The new attribute name. Prefix is required. If
null
then
the replace
attribute is removed.
unique
public final boolean unique
- If
true
then ensure that all replaced attributes have
unique value.
AttributeReplacerHandler
public AttributeReplacerHandler(ContentHandler sink,
QName attrReplace,
QName attrReplaceWith,
boolean unique)
- Constructor.
- Parameters:
sink
- receives all events.attrReplace
- attribute to be replaced. Prefix part is ignored.attrReplaceWith
- the new attribute name. Prefix is required. If
null
then the replace
attribute is removed.unique
- if true
then ensure that all replaced
attributes have unique value.
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Overrides:
startElement
in class ContentHandlerDelegate
- Throws:
SAXException
endDocument
public void endDocument()
throws SAXException
- Specified by:
endDocument
in interface ContentHandler
- Overrides:
endDocument
in class ContentHandlerDelegate
- Throws:
SAXException
startDocument
public void startDocument()
throws SAXException
- Specified by:
startDocument
in interface ContentHandler
- Overrides:
startDocument
in class ContentHandlerDelegate
- Throws:
SAXException
Copyright 2003-2003-2006 null. All Rights Reserved.