javolution.xml.sax.DefaultHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javolution-core-java-msftbx Show documentation
Show all versions of javolution-core-java-msftbx Show documentation
Only the Java Core part of Javolution library, with slight modifications for use in MSFTBX.
/*
* Javolution - Java(TM) Solution for Real-Time and Embedded Systems
* Copyright (C) 2012 - Javolution (http://javolution.org/)
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software is
* freely granted, provided that this notice is preserved.
*/
package javolution.xml.sax;
import javolution.text.CharArray;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
/**
* Default base class for real-time handling of XML events.
*
* @author David Megginson
* @author Jean-Marie Dautelle
* @version 3.1, March 11, 2005
*/
public class DefaultHandler implements ContentHandler, ErrorHandler {
/**
* Receives notification of a warning. The default behaviour is to take no
* action.
*
* @param e the warning information encapsulated in a SAX parse exception.
* @throws org.xml.sax.SAXException any SAX exception.
*/
public void warning(SAXParseException e) throws SAXException {}
/**
* Receives notification of recoverable parser error. The default behaviour
* is to take no action.
*
* @param e the error information encapsulated in a SAX parse exception.
* @throws org.xml.sax.SAXException any SAX exception.
*/
public void error(SAXParseException e) throws SAXException {}
/**
* Reports a fatal XML parsing error. The default behaviour is to throw
* the specified exception.
*
* @param e the error information encapsulated in a SAX parse exception.
* @throws org.xml.sax.SAXException any SAX exception.
*/
public void fatalError(SAXParseException e) throws SAXException {
throw e;
}
// Implements ContentHandler
public void setDocumentLocator(Locator locator) {}
// Implements ContentHandler
public void startDocument() throws SAXException {}
// Implements ContentHandler
public void endDocument() throws SAXException {}
// Implements ContentHandler
public void startPrefixMapping(CharArray prefix, CharArray uri)
throws SAXException {}
// Implements ContentHandler
public void endPrefixMapping(CharArray prefix) throws SAXException {}
// Implements ContentHandler
public void startElement(CharArray namespaceURI, CharArray localName,
CharArray qName, Attributes atts) throws SAXException {}
// Implements ContentHandler
public void endElement(CharArray namespaceURI, CharArray localName,
CharArray qName) throws SAXException {}
// Implements ContentHandler
public void characters(char ch[], int start, int length)
throws SAXException {}
// Implements ContentHandler
public void ignorableWhitespace(char ch[], int start, int length)
throws SAXException {}
// Implements ContentHandler
public void processingInstruction(CharArray target, CharArray data)
throws SAXException {}
// Implements ContentHandler
public void skippedEntity(CharArray name) throws SAXException {}
/**
* Generates compile-time error if startElement
is not
* correctly overriden. This method generates a compile-error
* "final method cannot be overridden"
if
* org.xml.sax.Attributes
is used instead of
* javolution.xml.sax.Attributes
(common mistake).
* @param uri the namespace URI, or an empty character sequence if the
* element has no Namespace URI or if namespace processing is not
* being performed.
* @param localName the local name (without prefix), or an empty character
* sequence if namespace processing is not being performed.
* @param qName the qualified name (with prefix), or an empty character
* sequence if qualified names are not available.
* @param atts the attributes attached to the element. If there are no
* attributes, it shall be an empty {@link Attributes} object.
* @throws org.xml.sax.SAXException any SAX exception.
*/
protected final void startElement(CharArray uri, CharArray localName,
CharArray qName, org.xml.sax.Attributes atts) throws SAXException {
throw new UnsupportedOperationException();
}
}