Code example for LocatorImpl

Methods: setColumnNumber, setLineNumber, setPublicId, setSystemId

0
    static void convertToSAXParseException(XMLParseException e) throws SAXException {
        Exception ex = e.getException();
        if (ex == null) {
            // must be a parser exception; mine it for locator info and throw 
            // a SAXParseException 
            LocatorImpl locatorImpl = new LocatorImpl();
            locatorImpl.setPublicId(e.getPublicId());
            locatorImpl.setSystemId(e.getExpandedSystemId());
            locatorImpl.setLineNumber(e.getLineNumber());
            locatorImpl.setColumnNumber(e.getColumnNumber());
            throw new SAXParseException(e.getMessage(), locatorImpl);
        } 
        if (ex instanceof SAXException) {
            // why did we create an XMLParseException? 
            throw (SAXException) ex;
        } 
        throw new SAXException(ex);
    } 
     
    static void convertToSAXException(XNIException e) throws SAXException {
        Exception ex = e.getException();