org.apache.tika.sax
Class TaggedSAXException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.xml.sax.SAXException
              extended by org.apache.tika.sax.TaggedSAXException
All Implemented Interfaces:
java.io.Serializable

public class TaggedSAXException
extends org.xml.sax.SAXException

A SAXException wrapper that tags the wrapped exception with a given object reference. Both the tag and the wrapped original exception can be used to determine further processing when this exception is caught.

See Also:
Serialized Form

Constructor Summary
TaggedSAXException(org.xml.sax.SAXException original, java.lang.Object tag)
          Creates a tagged wrapper for the given exception.
 
Method Summary
 org.xml.sax.SAXException getCause()
          Returns the wrapped exception.
 java.lang.Object getTag()
          Returns the object reference used as the tag this exception.
 
Methods inherited from class org.xml.sax.SAXException
getException, getMessage, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TaggedSAXException

public TaggedSAXException(org.xml.sax.SAXException original,
                          java.lang.Object tag)
Creates a tagged wrapper for the given exception.

Parameters:
original - the exception to be tagged
tag - tag object
Method Detail

getTag

public java.lang.Object getTag()
Returns the object reference used as the tag this exception.

Returns:
tag object

getCause

public org.xml.sax.SAXException getCause()
Returns the wrapped exception. The only difference to the overridden Throwable.getCause() method is the narrower return type.

Overrides:
getCause in class org.xml.sax.SAXException
Returns:
wrapped exception


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.