public class GenericTreeInfo extends Object implements TreeInfo
Constructor and Description |
---|
GenericTreeInfo(Configuration config)
Create the TreeInfo
|
GenericTreeInfo(Configuration config,
NodeInfo root)
Create the TreeInfo
|
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration()
Get the Configuration to which this document belongs
|
long |
getDocumentNumber()
Get the document number, which identifies this document uniquely within a Configuration
|
String |
getPublicId()
Get the Public ID of the entity containing the node.
|
NodeInfo |
getRootNode()
Get the NodeInfo object representing the root of the tree (not necessarily a document node)
|
String |
getSystemId()
Get the systemId of the document node
|
String[] |
getUnparsedEntity(String name)
Get the unparsed entity with a given name
|
Iterator<String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
Object |
getUserData(String key)
Get user data held in the document node.
|
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
NodeInfo |
selectID(String id,
boolean getParent)
Get the element with a given ID, if any
|
void |
setConfiguration(Configuration config)
Set the configuration (containing the name pool used for all names in this document)
|
void |
setDocumentNumber(long documentNumber)
Set the document number, which identifies this document uniquely within a Configuration
|
void |
setRootNode(NodeInfo root)
Set the root node of the tree
|
void |
setSystemId(String systemId)
Set the systemId of the document node (for most implementations, this is likely to be the systemId
of the entire tree
|
void |
setUserData(String key,
Object value)
Set user data on the document node.
|
public GenericTreeInfo(Configuration config)
config
- the Saxon Configurationpublic GenericTreeInfo(Configuration config, NodeInfo root)
config
- the Saxon Configurationroot
- the root nodeIllegalArgumentException
- if the supplied node is not parentlesspublic void setConfiguration(Configuration config)
config
- the configurationpublic Configuration getConfiguration()
getConfiguration
in interface TreeInfo
public void setRootNode(NodeInfo root)
root
- the root node (not necessarily a document nodeIllegalArgumentException
- if the supplied node is not parentlesspublic NodeInfo getRootNode()
getRootNode
in interface TreeInfo
public void setSystemId(String systemId)
setSystemId
in interface Source
systemId
- the system IDpublic String getSystemId()
getSystemId
in interface Source
public String getPublicId()
public long getDocumentNumber()
getDocumentNumber
in interface TreeInfo
public void setDocumentNumber(long documentNumber)
public boolean isTyped()
public NodeInfo selectID(String id, boolean getParent)
selectID
in interface TreeInfo
id
- the required ID valuegetParent
- true if running the element-with-id() function rather than the id()
function; the difference is that in the case of an element of type xs:ID, the parent of
the element should be returned, not the element itself.public Iterator<String> getUnparsedEntityNames()
getUnparsedEntityNames
in interface TreeInfo
public String[] getUnparsedEntity(String name)
getUnparsedEntity
in interface TreeInfo
name
- the name of the entitypublic void setUserData(String key, Object value)
getUserData(java.lang.String)
setUserData
in interface TreeInfo
key
- A string giving the name of the property to be set. Clients are responsible
for choosing a key that is likely to be unique. Must not be null. Keys used internally
by Saxon are prefixed "saxon:".value
- The value to be set for the property. May be null, which effectivelypublic Object getUserData(String key)
setUserData(java.lang.String, java.lang.Object)
getUserData
in interface TreeInfo
key
- A string giving the name of the property to be retrieved.Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.