com.icl.saxon.om
public class NamePool extends Object
The equivalence betweem names depends only on the URI and the local name. The prefix is retained for documentary purposes only: it is useful when reconstructing a document to use prefixes that the user is familiar with.
The NamePool eliminates duplicate names if they have the same prefix, uri, and local part. It retains duplicates if they have different prefixes
Field Summary | |
---|---|
NamePool.NameEntry[] | hashslots |
String[] | prefixes |
String[] | prefixesForUri |
short | prefixesUsed |
boolean | sealed |
Vector | signatures |
String[] | uris |
short | urisUsed |
Constructor Summary | |
---|---|
NamePool() |
Method Summary | |
---|---|
int | allocate(String prefix, String uri, String localName)
Allocate a name from the pool, or a new Name if there is not a matching one there |
int | allocate(String prefix, short uriCode, String localName)
Allocate a name from the pool, or a new Name if there is not a matching one there |
short | allocateCodeForPrefix(String prefix)
Allocate the prefix code for a given Prefix; create one if not found |
short | allocateCodeForURI(String uri)
Allocate the uri code for a given URI;
create one if not found, unless the namepool is sealed |
int | allocateNamespaceCode(String prefix, String uri)
Allocate the namespace code for a namespace prefix/URI pair.
|
int | allocateNamespaceCode(int namecode)
Allocate a namespace code for the prefix/URI of a given namecode |
void | diagnosticDump()
Diagnostic print of the namepool contents |
void | generateJavaConstants()
The following code is used to create a list of Java declarations for
the fingerprints of standard names used in a stylesheet. |
short | getCodeForPrefix(String prefix)
Get the prefix code for a given Prefix |
short | getCodeForURI(String uri)
Get the uri code for a given URI |
static NamePool | getDefaultNamePool()
Get the singular default NamePool |
String | getDisplayName(int nameCode)
Get the display form of a name (the QName), given its name code or fingerprint |
int | getFingerprint(int nameCode)
Get a fingerprint for the name with a given name code.
|
int | getFingerprint(String uri, String localName)
Get a fingerprint for the name with a given uri and local name.
|
String | getLocalName(int nameCode)
Get the local part of a name, given its name code or fingerprint |
int | getNamespaceCode(String prefix, String uri)
Get the existing namespace code for a namespace prefix/URI pair. |
int | getNamespaceCode(int namecode)
Get a namespace code for the prefix/URI of a given namecode |
String | getPrefix(int nameCode)
Get the prefix part of a name, given its name code or fingerprint |
String | getPrefixFromNamespaceCode(int code)
Get the namespace prefix from a namespace code |
int | getPrefixIndex(short uriCode, String prefix)
Get the index of a prefix among all the prefixes used with a given URI |
String | getPrefixWithIndex(short uriCode, int index)
Get a prefix among all the prefixes used with a given URI, given its index |
StandardNames | getStandardNames()
Get the standard names |
String | getURI(int nameCode)
Get the namespace-URI of a name, given its name code or fingerprint |
short | getURICode(int nameCode)
Get the URI code of a name, given its name code or fingerprint |
String | getURIFromNamespaceCode(int code)
Get the namespace URI from a namespace code |
String | getURIFromURICode(short code)
Get the namespace URI from a URI code |
boolean | hasSignature(Object sig)
Test whether the namepool contains names defined in a particular
Stylesheet |
void | importPool(NamePool other)
Import the names defined in another namepool (typically the one used
to create the stylesheet: these names are imported into the namepool
used to build the source document).
|
boolean | isSealed()
Determine whether the namepool is sealed |
void | loadStandardNames()
Load the standard names that have a special meaning to XSLT |
void | setStylesheetSignature(Object sig)
Mark the NamePool to indicate that it contains names defined in a
particular stylesheet |
Parameters: prefix uri - the namespace URI localName
Returns: an integer (the "namecode") identifying the name within the namepool. The Name itself may be retrieved using the getName(int) method
Parameters: prefix uriCode - the code of the URI localName
Returns: an integer (the "namecode") identifying the name within the namepool.
Returns: -1 if not found
Returns: -1 if not present in the name pool
Returns: -1 if not found
Returns: -1 if there is none present
Returns: -1 if not found
Returns: null if not found