/** * Get the nameCode of this name, allocating a new code from the name pool if necessary * * @param namePool the NamePool used to allocate the name * @return a nameCode for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool namePool) { if (nameCode == -1) { return nameCode = namePool.allocateFingerprint("", localName); } else { return nameCode; } }
/** * Get the nameCode of this name, allocating a new code from the name pool if necessary * * @param namePool the NamePool used to allocate the name * @return a nameCode for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool namePool) { if (nameCode == -1) { return nameCode = namePool.allocateFingerprint("", localName); } else { return nameCode; } }
public int getFingerprint(int index) { String local = reader.getAttributeLocalName(index); String uri = reader.getAttributeNamespace(index); if (uri == null) { uri = ""; } return getNamePool().allocateFingerprint(uri, local); }
public int getFingerprint(int index) { String local = reader.getAttributeLocalName(index); String uri = reader.getAttributeNamespace(index); if (uri == null) { uri = ""; } return getNamePool().allocateFingerprint(uri, local); }
public FingerprintedQName(String prefix, String uri, String localName, NamePool pool) { qName = new StructuredQName(prefix, uri, localName); this.fingerprint = pool.allocateFingerprint(uri, localName); }
public FingerprintedQName(String prefix, String uri, String localName, NamePool pool) { qName = new StructuredQName(prefix, uri, localName); this.fingerprint = pool.allocateFingerprint(uri, localName); }
/** * Get the fingerprint of this name, allocating a new code from the namepool if necessary * * @param pool the NamePool used to allocate the name * @return a fingerprint for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool pool) { if (fingerprint == -1) { fingerprint = pool.allocateFingerprint(getURI(), getLocalPart()); } return fingerprint; }
public FingerprintedQName(StructuredQName qName, NamePool pool) { this.qName = qName; this.fingerprint = pool.allocateFingerprint(qName.getURI(), qName.getLocalPart()); }
/** * Get the fingerprint of this name, allocating a new code from the namepool if necessary * * @param pool the NamePool used to allocate the name * @return a fingerprint for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool pool) { if (fingerprint == -1) { fingerprint = pool.allocateFingerprint(getURI(), getLocalPart()); } return fingerprint; }
public FingerprintedQName(StructuredQName qName, NamePool pool) { this.qName = qName; this.fingerprint = pool.allocateFingerprint(qName.getURI(), qName.getLocalPart()); }
/** * Get the nameCode of this name, allocating a new code from the namepool if necessary * * @param namePool the NamePool used to allocate the name * @return a nameCode for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool namePool) { if (node.hasFingerprint()) { return node.getFingerprint(); } else { return namePool.allocateFingerprint(node.getURI(), node.getLocalPart()); } }
/** * Get the nameCode of this name, allocating a new code from the namepool if necessary * * @param namePool the NamePool used to allocate the name * @return a nameCode for this name, newly allocated if necessary */ public int obtainFingerprint(NamePool namePool) { if (node.hasFingerprint()) { return node.getFingerprint(); } else { return namePool.allocateFingerprint(node.getURI(), node.getLocalPart()); } }
/** * Graft an element node from an external tree */ public void graft(NodeInfo externalNode, int nodeNr, int depth, boolean copyNamespaces) { assert externalNode.getNodeKind() == Type.ELEMENT; if (externalNodes == null) { externalNodes = new ArrayList<>(); } int externalNodeNr = externalNodes.size(); int fp = getNamePool().allocateFingerprint(externalNode.getURI(), externalNode.getLocalPart()); int prefixCode = prefixPool.obtainPrefixCode(externalNode.getPrefix()); int nameCode = (prefixCode << 20) | fp; addNode(Type.EXTERNAL_NODE_REFERENCE, depth, externalNodeNr, -1, nameCode); externalNodes.add(new GraftedElement(this, nodeNr, externalNode, copyNamespaces)); }
/** * Graft an element node from an external tree */ public void graft(NodeInfo externalNode, int nodeNr, int depth, boolean copyNamespaces) { assert externalNode.getNodeKind() == Type.ELEMENT; if (externalNodes == null) { externalNodes = new ArrayList<>(); } int externalNodeNr = externalNodes.size(); int fp = getNamePool().allocateFingerprint(externalNode.getURI(), externalNode.getLocalPart()); int prefixCode = prefixPool.obtainPrefixCode(externalNode.getPrefix()); int nameCode = (prefixCode << 20) | fp; addNode(Type.EXTERNAL_NODE_REFERENCE, depth, externalNodeNr, -1, nameCode); externalNodes.add(new GraftedElement(this, nodeNr, externalNode, copyNamespaces)); }
/** * Output element start tag */ public void startElement(NodeName name, SchemaType type, Location location, int properties) throws XPathException { checkType(type); int fp = newPool.allocateFingerprint(name.getURI(), name.getLocalPart()); nextReceiver.startElement(new CodedName(fp, name.getPrefix(), newPool), type, location, properties); }
/** * 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()); } }
/** * Handle an attribute */ public void attribute(NodeName name, SimpleType type, CharSequence value, Location location, int properties) throws XPathException { checkType(type); int fp = newPool.allocateFingerprint(name.getURI(), name.getLocalPart()); nextReceiver.attribute(new CodedName(fp, name.getPrefix(), newPool), type, value, location, properties); }
/** * 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()); } }
/** * Output element start tag */ public void startElement(NodeName name, SchemaType type, Location location, int properties) throws XPathException { checkType(type); int fp = newPool.allocateFingerprint(name.getURI(), name.getLocalPart()); nextReceiver.startElement(new CodedName(fp, name.getPrefix(), newPool), type, location, properties); }
/** * Handle an attribute */ public void attribute(NodeName name, SimpleType type, CharSequence value, Location location, int properties) throws XPathException { checkType(type); int fp = newPool.allocateFingerprint(name.getURI(), name.getLocalPart()); nextReceiver.attribute(new CodedName(fp, name.getPrefix(), newPool), type, value, location, properties); }