|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.om.NamePool
An object representing a collection of XML names, each containing a Namespace URI,
a Namespace prefix, and a local name; plus a collection of namespaces, each
consisting of a prefix/URI pair.
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
Constructor Summary | |
NamePool()
|
Method Summary | |
int |
allocate(java.lang.String prefix,
short uriCode,
java.lang.String localName)
Allocate a name from the pool, or a new Name if there is not a matching one there |
int |
allocate(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName)
Allocate a name from the pool, or a new Name if there is not a matching one there |
short |
allocateCodeForPrefix(java.lang.String prefix)
Allocate the prefix code for a given Prefix; create one if not found |
short |
allocateCodeForURI(java.lang.String uri)
Allocate the uri code for a given URI; create one if not found, unless the namepool is sealed |
int |
allocateNamespaceCode(int namecode)
Allocate a namespace code for the prefix/URI of a given namecode |
int |
allocateNamespaceCode(java.lang.String prefix,
java.lang.String uri)
Allocate the namespace code for a namespace prefix/URI pair. |
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(java.lang.String prefix)
Get the prefix code for a given Prefix |
short |
getCodeForURI(java.lang.String uri)
Get the uri code for a given URI |
static NamePool |
getDefaultNamePool()
Get the singular default NamePool |
java.lang.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(java.lang.String uri,
java.lang.String localName)
Get a fingerprint for the name with a given uri and local name. |
java.lang.String |
getLocalName(int nameCode)
Get the local part of a name, given its name code or fingerprint |
int |
getNamespaceCode(int namecode)
Get a namespace code for the prefix/URI of a given namecode |
int |
getNamespaceCode(java.lang.String prefix,
java.lang.String uri)
Get the existing namespace code for a namespace prefix/URI pair. |
java.lang.String |
getPrefix(int nameCode)
Get the prefix part of a name, given its name code or fingerprint |
java.lang.String |
getPrefixFromNamespaceCode(int code)
Get the namespace prefix from a namespace code |
int |
getPrefixIndex(short uriCode,
java.lang.String prefix)
Get the index of a prefix among all the prefixes used with a given URI |
java.lang.String |
getPrefixWithIndex(short uriCode,
byte index)
Get a prefix among all the prefixes used with a given URI, given its index |
StandardNames |
getStandardNames()
Get the standard names |
java.lang.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 |
java.lang.String |
getURIFromNamespaceCode(int code)
Get the namespace URI from a namespace code |
java.lang.String |
getURIFromURICode(short code)
Get the namespace URI from a URI code |
boolean |
hasSignature(java.lang.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(java.lang.Object sig)
Mark the NamePool to indicate that it contains names defined in a particular stylesheet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamePool()
Method Detail |
public static NamePool getDefaultNamePool()
public void loadStandardNames()
public StandardNames getStandardNames()
public void setStylesheetSignature(java.lang.Object sig)
public boolean hasSignature(java.lang.Object sig)
public void importPool(NamePool other) throws javax.xml.transform.TransformerException
public boolean isSealed()
public int allocateNamespaceCode(java.lang.String prefix, java.lang.String uri)
public int getNamespaceCode(java.lang.String prefix, java.lang.String uri)
public short allocateCodeForURI(java.lang.String uri)
public short getCodeForURI(java.lang.String uri)
public short allocateCodeForPrefix(java.lang.String prefix)
public short getCodeForPrefix(java.lang.String prefix)
public int getPrefixIndex(short uriCode, java.lang.String prefix)
public java.lang.String getPrefixWithIndex(short uriCode, byte index)
public int allocate(java.lang.String prefix, java.lang.String uri, java.lang.String localName)
prefix
- uri
- - the namespace URIlocalName
- public int allocate(java.lang.String prefix, short uriCode, java.lang.String localName)
prefix
- uriCode
- - the code of the URIlocalName
- public int allocateNamespaceCode(int namecode)
public int getNamespaceCode(int namecode)
public java.lang.String getURI(int nameCode)
public short getURICode(int nameCode)
public java.lang.String getLocalName(int nameCode)
public java.lang.String getPrefix(int nameCode)
public java.lang.String getDisplayName(int nameCode)
public int getFingerprint(int nameCode)
public int getFingerprint(java.lang.String uri, java.lang.String localName)
public java.lang.String getURIFromNamespaceCode(int code)
public java.lang.String getURIFromURICode(short code)
public java.lang.String getPrefixFromNamespaceCode(int code)
public void diagnosticDump()
public void generateJavaConstants()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |