/** * Get the URI part of the name of this node. This is the URI corresponding to the * prefix, or the URI of the default namespace if appropriate. * * @return The URI of the namespace of this node. For an unnamed node, return null. * For a node with an empty prefix, return an empty string. */ public String getURI() { return node.getURI(); }
/** * Get the URI part of the name of this node. This is the URI corresponding to the * prefix, or the URI of the default namespace if appropriate. * * @return The URI of the namespace of this node. For an unnamed node, * or for a node with an empty prefix, return an empty * string. */ public String getURI() { return original.getURI(); }
/** * Get the namespace URI of the QName. * * @return the URI. Returns the empty string to represent the no-namespace */ public String getURI() { return node.getURI(); }
/** * Get the namespace URI matched by this nametest * * @return the namespace URI (using "" for the "null namepace") */ public String getNamespaceURI() { return origin.getURI(); }
/** * Get the URI part of the name of this node. This is the URI corresponding to the * prefix, or the URI of the default namespace if appropriate. * * @return The URI of the namespace of this node. For an unnamed node, * or for a node with an empty prefix, return an empty * string. */ public String getURI() { return original.getURI(); }
/** * Test whether this name is in a given namespace * * @param ns the namespace to be tested against * @return true if the name is in the specified namespace */ public boolean hasURI(String ns) { return node.getURI().equals(ns); }
/** * Test whether this name is in a given namespace * * @param ns the namespace to be tested against * @return true if the name is in the specified namespace */ public boolean hasURI(String ns) { return node.getURI().equals(ns); }
/** * Test whether this name is in the same namespace as another name * * @return true if the two names are in the same namespace */ public boolean isInSameNamespace(/*@NotNull*/ NodeName other) { return node.getURI().equals(other.getURI()); }
/** * 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 node.getNodeKind()==nodeKind && node.getURI().equals(uri); }
/** * 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 node.getNodeKind() == nodeKind && node.getURI().equals(uri); }
/** * 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 node.getNodeKind() == nodeKind && node.getURI().equals(uri); }
@Override public AtomicValue evaluate(Item item, XPathContext context) throws XPathException { String uri = ((NodeInfo) item).getURI(); return new AnyURIValue(uri); }
/** * Returns a hash code value for the object. */ public int hashCode() { return origin.getNodeKind() << 20 ^ origin.getURI().hashCode() ^ origin.getLocalPart().hashCode(); }
/** * Returns a hash code value for the object. */ public int hashCode() { return origin.getNodeKind() << 20 ^ origin.getURI().hashCode() ^ origin.getLocalPart().hashCode(); }
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()); }
public static QNameValue nodeName(NodeInfo node) { if (node.getLocalPart().isEmpty()) { return null; } return new QNameValue(node.getPrefix(), node.getURI(), node.getLocalPart(), BuiltInAtomicType.QNAME); }
/** * 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; } }
/** * 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()); } }