Code example for SAXParseException

Methods: getException, getMessage

0
            Method method = amfxIn.getClass().getMethod(methodName, attribArr);
            method.invoke(amfxIn, new Object[]{attributes});
        } 
        catch (NoSuchMethodException e)
        { 
            fatalError(new SAXParseException("Unknown type: " + qName, locator));
        } 
        catch (IllegalAccessException e)
        { 
            fatalError(new SAXParseException(e.getMessage(), locator, e));
        } 
        catch (InvocationTargetException e)
        { 
            Throwable t = e.getTargetException();
            if (t instanceof SAXException)
            { 
                throw (SAXException)t;
            } 
            else if (t instanceof Exception)
            { 
                fatalError(new SAXParseException(t.getMessage(), locator, (Exception)t));
            } 
            else 
            { 
                fatalError(new SAXParseException(e.getMessage(), locator, e));
            } 
        } 
    } 
 
    public void endElement(String uri, String localName, String qName) throws SAXException
    { 
        try 
        { 
            String methodName = "end_" + localName;
            Method method = amfxIn.getClass().getMethod(methodName, new Class[]{});
            method.invoke(amfxIn, new Object[]{});
        } 
        catch (NoSuchMethodException e)
        { 
            fatalError(new SAXParseException("Unfinished type: " + qName, locator));
        } 
        catch (IllegalAccessException e)
        { 
            fatalError(new SAXParseException(e.getMessage(), locator, e));
        } 
        catch (InvocationTargetException e)
        { 
            Throwable t = e.getTargetException();
            if (t instanceof SAXException)
            { 
                throw (SAXException)t;
            } 
            else if (t instanceof Error)
            { 
                throw (Error)t;
            } 
            else 
            { 
                fatalError(new SAXParseException(t.getMessage(), locator));
            } 
        } 
    } 
 
    public void characters(char ch[], int start, int length) throws SAXException
    { 
        String chars = new String(ch, start, length);
        if (chars.length() > 0)
        { 
            amfxIn.text(chars);
        } 
    } 
 
    public void setDocumentLocator(Locator l)
    { 
        locator = l;
    } 
 
 
    public void error(SAXParseException exception) throws SAXException
    { 
        throw new MessageException(exception.getMessage());
    } 
 
    public void fatalError(SAXParseException exception) throws SAXException
    { 
        if ((exception.getException() != null) && (exception.getException() instanceof MessageException))
            throw (MessageException)exception.getException();
        throw new MessageException(exception.getMessage());
    } 
 
    public void warning(SAXParseException exception) throws SAXException
    { 
        throw new MessageException(exception.getMessage());