| java.lang.Object net.sf.saxon.om.NamespaceDeclarationsImpl
NamespaceDeclarationsImpl | public class NamespaceDeclarationsImpl implements NamespaceDeclarations(Code) | | An implementation of the NamespaceDeclarations interface,
based on encapsulating an array of namespace codes.
|
Method Summary | |
public int | getLength() Get the number of declarations (and undeclarations) in this list. | public int | getNamespaceCode(int index) Get the n'th declaration in the list in the form of a namespace code. | public int[] | getNamespaceCodes(int[] buffer) Get all the namespace codes, as an array.
Parameters: buffer - a sacrificial array that the method is free to use to contain the result.May be null. | public String | getPrefix(int index) Get the prefix of the n'th declaration (or undeclaration) in the list,
counting from zero.
Parameters: index - the index identifying which declaration is required. | public String | getURI(int index) Get the namespace URI of the n'th declaration (or undeclaration) in the list,
counting from zero.
Parameters: index - the index identifying which declaration is required. | public void | setNamePool(NamePool pool) | public void | setNamespaceCodes(int[] codes) Set the namespace codes.
Parameters: codes - an integer array holding the namespace codes. |
NamespaceDeclarationsImpl | public NamespaceDeclarationsImpl()(Code) | | |
NamespaceDeclarationsImpl | public NamespaceDeclarationsImpl(NamePool pool, int[] codes)(Code) | | Construct a set of namespace declarations
Parameters: pool - the name pool Parameters: codes - an integer array holding the namespace codes. Thesecodes are allocated by the name pool, and can be used to look upa prefix and uri in the name pool. If the array contains the integer-1, this acts as a terminator for the list. This is the formatreturned by the method NodeInfo.getDeclaredNamespaces(int[]).A value of null is equivalent to supplying an empty array. |
getLength | public int getLength()(Code) | | Get the number of declarations (and undeclarations) in this list.
|
getNamespaceCode | public int getNamespaceCode(int index)(Code) | | Get the n'th declaration in the list in the form of a namespace code. Namespace
codes can be translated into a prefix and URI by means of methods in the
NamePool
Parameters: index - the index identifying which declaration is required. the namespace code. This is an integer whose upper half indicatesthe prefix (0 represents the default namespace), and whose lower half indicatesthe URI (0 represents an undeclaration). throws: IndexOutOfBoundsException - if the index is out of range. See Also: NamePool.getPrefixFromNamespaceCode(int) See Also: NamePool.getURIFromNamespaceCode(int) |
getNamespaceCodes | public int[] getNamespaceCodes(int[] buffer)(Code) | | Get all the namespace codes, as an array.
Parameters: buffer - a sacrificial array that the method is free to use to contain the result.May be null. an integer array containing namespace codes. The array may be filled completelywith namespace codes, or it may be incompletely filled, in which case a -1 integer actsas a terminator. |
getPrefix | public String getPrefix(int index)(Code) | | Get the prefix of the n'th declaration (or undeclaration) in the list,
counting from zero.
Parameters: index - the index identifying which declaration is required. the namespace prefix. For a declaration or undeclaration of thedefault namespace, this is the zero-length string. throws: IndexOutOfBoundsException - if the index is out of range. |
getURI | public String getURI(int index)(Code) | | Get the namespace URI of the n'th declaration (or undeclaration) in the list,
counting from zero.
Parameters: index - the index identifying which declaration is required. the namespace URI. For a namespace undeclaration, this is thezero-length string. throws: IndexOutOfBoundsException - if the index is out of range. |
setNamePool | public void setNamePool(NamePool pool)(Code) | | Set the name pool
|
setNamespaceCodes | public void setNamespaceCodes(int[] codes)(Code) | | Set the namespace codes.
Parameters: codes - an integer array holding the namespace codes. Thesecodes are allocated by the name pool, and can be used to look upa prefix and uri in the name pool. If the array contains the integer-1, this acts as a terminator for the list. This is the formatreturned by the method NodeInfo.getDeclaredNamespaces(int[]).A value of null is equivalent to supplying an empty array. |
|
|