@Override public void startElement( String namespaceURI, String localName, String qualifiedName, Attributes attributes) throws SAXException { super.startElement(namespaceURI, localName, qualifiedName, attributes); // Parse locations in attributes // TODO: Method configurable. if (addParseLocationAttributes) { AttributeParseLocation pp = // moduleGenerated.newParseLocation(elementIdentifier); new new AttributeParseLocation( currentLine, currentColumn, currentLine = locator.getLineNumber(), currentColumn = locator.getColumnNumber()); ppStack.push(pp); } // parse location in elements ParseLocationElement ple = (ParseLocationElement) currentElement; ple.elementStartTagBeginningLine = currentLine; ple.elementStartTagBeginningColumn = currentColumn; ple.elementStartTagEndLine = (currentLine = locator.getLineNumber()); ple.elementStartTagEndColumn = (currentColumn = locator.getColumnNumber()); }
@Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { if (usingParseLocationElements) { ParseLocationElement ple = (ParseLocationElement) currentElement; ple.elementEndTagEndLine = currentLine = locator.getLineNumber(); ple.elementEndTagEndColumn = currentColumn = locator.getColumnNumber(); } else if (addParseLocationAttributes) { AttributeParseLocation pp = ppStack.pop(); pp.setElementEndTagEndLine(currentLine = locator.getLineNumber()); pp.setElementEndTagEndColumn(currentColumn = locator.getColumnNumber()); currentElement.addAttribute(XMLConstants.PARSELOCATION_DECORATION_QNAME, pp.toString()); } super.endElement(namespaceURI, localName, qName); }
@Override public void endCDATA() throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.endCDATA(); }
@Override public void startPrefixMapping(String prefix, String uri) throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.startPrefixMapping(prefix, uri); }
@Override public void startDocument() throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.startDocument(); }
@Override public void processingInstruction(String target, String data) throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.processingInstruction(target, data); }
@Override public void endPrefixMapping(String prefix) throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.endPrefixMapping(prefix); }
@Override public void comment(char[] ch, int start, int end) throws SAXException { currentLine = locator.getLineNumber(); currentColumn = locator.getColumnNumber(); super.comment(ch, start, end); }