/** * Returns the user data associated with the node. * If the node has no user data, a new empty map is created. * @param node the node to query. * @return the user data associated with the node. */ public static Map<Object, Object> getUserData(Node node) { return getLocationMap(node); }
/** * Returns the column at which the given node starts. * @param node the node to query. * @return the column at which the given node starts. */ public static int getStartColumn(Node node) { int result = getLocationMap(node).getStartColumn(); return result == LocationMap.UNSET ? 1 : result; }
/** * Sets the column at which the given node ends. * @param node the node to set. * @param value the column at which the given node ends. */ public static void setEndColumn(Node node, int value) { getLocationMap(node).setEndColumn(value); }
/** * Returns the line at which the given node starts. * @param node the node to query. * @return the line at which the given node starts. */ public static int getStartLine(Node node) { int result = getLocationMap(node).getStartLine(); return result == LocationMap.UNSET ? 1 : result; }
/** * Sets the line at which the given node starts. * @param node the node to set. * @param value the line at which the given node starts. */ public static void setStartLine(Node node, int value) { getLocationMap(node).setStartLine(value); }
/** * Returns the line at which the given node ends. * @param node the node to query. * @return the line at which the given node ends. */ public static int getEndLine(Node node) { int result = getLocationMap(node).getEndLine(); return result == LocationMap.UNSET ? 1 : result; }
/** * Sets the line at which the given node ends. * @param node the node to set. * @param value the line at which the given node ends. */ public static void setEndLine(Node node, int value) { getLocationMap(node).setEndLine(value); }
/** * Sets the column at which the given node starts. * @param node the node to set. * @param value the column at which the given node starts. */ public static void setStartColumn(Node node, int value) { getLocationMap(node).setStartColumn(value); }
/** * Returns the column at which the given node ends. * @param node the node to query. * @return the column at which the given node ends. */ public static int getEndColumn(Node node) { int result = getLocationMap(node).getEndColumn(); return result == LocationMap.UNSET ? 1 : result; }
public void startCDATA() { cdata = new StringBuilder(); cdataSection = document.createCDATASection(""); LocationMap extendedAttributes = getLocationMap(cdataSection); extendedAttributes.setStartLine(line); extendedAttributes.setStartColumn(column); }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { saveLocation(); LocationMap extendedAttributes = getLocationMap(element); extendedAttributes.setEndLine(line); extendedAttributes.setEndColumn(column); element = stack.pop(); }
public void endCDATA() { cdataSection.setData(cdata.toString()); element.appendChild(cdataSection); LocationMap extendedAttributes = getLocationMap(cdataSection); cdata = null; saveLocation(); extendedAttributes.setEndLine(line); extendedAttributes.setEndColumn(column); }
element = newElement; LocationMap extendedAttributes = getLocationMap(element); extendedAttributes.setStartLine(line); extendedAttributes.setStartColumn(column);
Text textNode = document.createTextNode(new String(characters, start + i, length - i)); element.appendChild(textNode); LocationMap extendedAttributes = getLocationMap(textNode); extendedAttributes.setStartLine(line); extendedAttributes.setStartColumn(column);