Code example for Locator

Methods: getColumnNumbergetLineNumbergetPublicIdgetSystemId

0
     * @throws org.xml.sax.SAXException 
     */ 
    protected void startNode(Node node) throws org.xml.sax.SAXException {
        if (node instanceof Locator) {
            Locator loc = (Locator) node;
            fLocator.setColumnNumber(loc.getColumnNumber());
            fLocator.setLineNumber(loc.getLineNumber());
            fLocator.setPublicId(loc.getPublicId());
            fLocator.setSystemId(loc.getSystemId());
        } else { 
            fLocator.setColumnNumber(0);
            fLocator.setLineNumber(0);
        } 
 
        switch (node.getNodeType()) {
            case Node.DOCUMENT_TYPE_NODE :
                serializeDocType((DocumentType) node, true);
                break; 
            case Node.COMMENT_NODE :
                serializeComment((Comment) node);
Experience pair programming with AI  Get Codota for Java