/** * Compares current object with specified for order. * @param nodeInfo another {@code NodeInfo} object * @return number representing order of current object to specified one */ @Override public int compareOrder(NodeInfo nodeInfo) { return getLocalPart().compareTo(nodeInfo.getLocalPart()); }
/** * Get the local part of the QName * * @return the local part of the QName */ public String getLocalPart() { return node.getLocalPart(); }
/** * Get the local name matched by this nametest * * @return the local name */ public String getLocalPart() { return origin.getLocalPart(); }
/** * Get the local part of the name of this node. This is the name after the ":" if any. * * @return the local part of the name. For an unnamed node, returns "". Unlike the DOM * interface, this returns the full name in the case of a non-namespaced name. */ public String getLocalPart() { return original.getLocalPart(); }
/** * Get the local part of the name of this node. This is the name after the ":" if any. * * @return the local part of the name. For an unnamed node, returns "". Unlike the DOM * interface, this returns the full name in the case of a non-namespaced name. */ public String getLocalPart() { return original.getLocalPart(); }
/** * Get the local part of the name of this node. This is the name after the ":" if any. * * @return the local part of the name. For an unnamed node, returns null, except for * un unnamed namespace node, which returns "". */ public String getLocalPart() { return node.getLocalPart(); }
/** * Get the local part of the name of this node. This is the name after the ":" if any. * * @return the local part of the name. For an unnamed node, returns "". Unlike the DOM * interface, this returns the full name in the case of a non-namespaced name. */ public String getLocalPart() { return original.getLocalPart(); }
/** * The target of this processing instruction. XML defines this as being * the first token following the markup that begins the processing * instruction. */ public String getTarget() { return node.getLocalPart(); }
/** * Get the local part of the name of this node. This is the name after the ":" if any. * * @return the local part of the name. For an unnamed node, returns null, except for * un unnamed namespace node, which returns "". */ public String getLocalPart() { return node.getLocalPart(); }
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. * @param node the node to be matched */ public boolean matches(NodeInfo node) { return localName.equals(node.getLocalPart()); }
/** * Test whether this node test is satisfied by a given node. This alternative * method is used in the case of nodes where calculating the fingerprint is expensive, * for example DOM or JDOM nodes. * * @param node the node to be matched */ public boolean matchesNode(NodeInfo node) { return localName.equals(node.getLocalPart()) && nodeKind == node.getNodeKind(); }
public static QNameValue nodeName(NodeInfo node) { if (node.getLocalPart().isEmpty()) { return null; } return new QNameValue(node.getPrefix(), node.getURI(), node.getLocalPart(), BuiltInAtomicType.QNAME); }
/** * Returns a hash code value for the object. */ public int hashCode() { return origin.getNodeKind() << 20 ^ origin.getURI().hashCode() ^ origin.getLocalPart().hashCode(); }
/** * Helper method to get the name of a node as a structuredQName. Used from bytecode * @param node the node * @return the name of the node if it has a name, or null otherwise */ public static StructuredQName getNodeName(NodeInfo node) { if (node.getLocalPart() != null) { return new StructuredQName(node.getPrefix(), node.getURI(), node.getLocalPart()); } else { return null; } }
private static Predicate<? super XdmNode> expandedNamePredicate(String ns, String local) { return item -> { NodeInfo node = item.getUnderlyingNode(); return node.getNodeKind() == Type.ELEMENT && node.getLocalPart().equals(local) && node.getURI().equals(ns); }; }
public QName getAttributeName(int i) { if (currentStaxEvent != START_ELEMENT) { throw new IllegalStateException(""+currentStaxEvent); } NodeInfo att = startElementEvent.getAttribute(i); return new QName(att.getURI(), att.getLocalPart(), att.getPrefix()); }
private static Predicate<? super XdmNode> localNamePredicate(String given) { if ("*".equals(given)) { return isElement(); } else { return item -> { NodeInfo node = item.getUnderlyingNode(); return node.getNodeKind() == Type.ELEMENT && node.getLocalPart().equals(given); }; } }
/** * Generate an equivalent NameTest * @return a NameTest that matches the same node kind and name */ public NameTest getEquivalentNameTest() { return new NameTest(origin.getNodeKind(), origin.getURI(), origin.getLocalPart(), origin.getConfiguration().getNamePool()); }
/** * Get the fingerprint required */ public int getFingerprint() { if (origin.hasFingerprint()) { return origin.getFingerprint(); } else { NamePool pool = origin.getConfiguration().getNamePool(); return pool.allocateFingerprint(origin.getURI(), origin.getLocalPart()); } }
@Override public void markNamespaceNode(NodeInfo origin) { NodeInfo element = builder.getCurrentParentNode(); NamePool pool = builder.getConfiguration().getNamePool(); String prefix = origin.getLocalPart(); markedNode = element.iterateAxis( AxisInfo.NAMESPACE, new NameTest(Type.NAMESPACE, "", prefix, pool)).next(); mark = -1; }