|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.dom.NodeImpl
org.exist.dom.DocumentImpl
public class DocumentImpl
Represents a persistent document object in the database; it can be an XML_FILE , a BINARY_FILE, or Xquery source code.
| Field Summary | |
|---|---|
static byte |
BINARY_FILE
|
static int |
LENGTH_DOCUMENT_ID
|
static int |
LENGTH_DOCUMENT_TYPE
|
static int |
UNKNOWN_DOCUMENT_ID
|
static byte |
XML_FILE
|
| Constructor Summary | |
|---|---|
DocumentImpl(DBBroker broker)
Creates a new DocumentImpl instance. |
|
DocumentImpl(DBBroker broker,
Collection collection)
Creates a new DocumentImpl instance. |
|
DocumentImpl(DBBroker broker,
Collection collection,
XmldbURI fileURI)
Creates a new DocumentImpl instance. |
|
DocumentImpl(DBBroker broker,
XmldbURI fileURI)
Creates a new DocumentImpl instance. |
|
| Method Summary | |
|---|---|
Node |
adoptNode(Node node)
The method adoptNode |
void |
appendChild(StoredNode child)
The method appendChild |
short |
compareDocumentPosition(Node other)
? @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node) |
int |
compareTo(Object other)
The method compareTo |
void |
copyChildren(DocumentImpl other)
The method copyChildren |
void |
copyOf(DocumentImpl other)
Copy the relevant internal fields from the specified document object. |
Attr |
createAttribute(String name)
The method createAttribute |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
The method createAttributeNS |
CDATASection |
createCDATASection(String data)
The method createCDATASection |
Comment |
createComment(String data)
The method createComment |
DocumentFragment |
createDocumentFragment()
The method createDocumentFragment |
Element |
createElement(String tagName)
The method createElement |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
The method createElementNS |
EntityReference |
createEntityReference(String name)
The method createEntityReference |
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
The method createProcessingInstruction |
Text |
createTextNode(String data)
The method createTextNode |
String |
getBaseURI()
? @see org.w3c.dom.Node#getBaseURI() |
DBBroker |
getBroker()
The method getBroker |
int |
getChildCount()
The method getChildCount |
NodeList |
getChildNodes()
The method getChildNodes |
Collection |
getCollection()
The method getCollection |
int |
getContentLength()
Returns the estimated size of the data in this document. |
int |
getDocId()
The method getDocId |
DocumentType |
getDoctype()
The method getDoctype |
Element |
getDocumentElement()
The method getDocumentElement |
String |
getDocumentURI()
? @see org.w3c.dom.Document#getDocumentURI() |
DOMConfiguration |
getDomConfig()
? @see org.w3c.dom.Document#getDomConfig() |
Element |
getElementById(String elementId)
The method getElementById |
NodeList |
getElementsByTagName(String tagname)
The method getElementsByTagName |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
The method getElementsByTagNameNS |
String |
getEncoding()
The method getEncoding |
Object |
getFeature(String feature,
String version)
? @see org.w3c.dom.Node#getFeature(java.lang.String, java.lang.String) |
XmldbURI |
getFileURI()
The method getFileURI |
Node |
getFirstChild()
|
long |
getFirstChildAddress()
The method getFirstChildAddress |
DOMImplementation |
getImplementation()
The method getImplementation |
String |
getInputEncoding()
? @see org.w3c.dom.Document#getInputEncoding() |
String |
getLocalName()
The method getLocalName |
DocumentMetadata |
getMetadata()
The method getMetadata |
String |
getNamespaceURI()
The method getNamespaceURI |
Node |
getNextSibling()
The method getNextSibling |
Node |
getNode(NodeId nodeId)
The method getNode |
Node |
getNode(NodeProxy p)
The method getNode |
short |
getNodeType()
The method getNodeType |
Document |
getOwnerDocument()
The method getOwnerDocument |
Node |
getParentNode()
|
Permission |
getPermissions()
The method getPermissions |
Node |
getPreviousSibling()
The method getPreviousSibling |
QName |
getQName()
The method getQName |
byte |
getResourceType()
Returns the type of this resource, either XML_FILE or
BINARY_FILE. |
boolean |
getStandalone()
The method getStandalone |
boolean |
getStrictErrorChecking()
The method getStrictErrorChecking |
SymbolTable |
getSymbols()
The method getSymbols |
String |
getTextContent()
? @see org.w3c.dom.Node#getTextContent() |
Lock |
getUpdateLock()
Returns the update lock associated with this resource. |
XmldbURI |
getURI()
The method getURI |
Object |
getUserData(String key)
? @see org.w3c.dom.Node#getUserData(java.lang.String) |
User |
getUserLock()
The method getUserLock |
String |
getVersion()
The method getVersion |
String |
getXmlEncoding()
? @see org.w3c.dom.Document#getXmlEncoding() |
boolean |
getXmlStandalone()
? @see org.w3c.dom.Document#getXmlStandalone() |
String |
getXmlVersion()
? @see org.w3c.dom.Document#getXmlVersion() |
Node |
importNode(Node importedNode,
boolean deep)
The method importNode |
void |
insertAfter(NodeList nodes,
Node refChild)
|
void |
insertBefore(NodeList nodes,
Node refChild)
|
boolean |
isDefaultNamespace(String namespaceURI)
? @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) |
boolean |
isEqualNode(Node arg)
? @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node) |
boolean |
isLockedForWrite()
Returns true if the document is currently locked for write. |
boolean |
isSameNode(Node other)
? @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node) |
boolean |
isSupported(String type,
String value)
The method isSupported |
String |
lookupNamespaceURI(String prefix)
? @see org.w3c.dom.Node#lookupNamespaceURI(java.lang.String) |
String |
lookupPrefix(String namespaceURI)
? @see org.w3c.dom.Node#lookupPrefix(java.lang.String) |
void |
normalizeDocument()
? @see org.w3c.dom.Document#normalizeDocument() |
void |
read(VariableByteInput istream)
The method read |
void |
readDocumentMeta(VariableByteInput istream)
The method readDocumentMeta |
Node |
renameNode(Node n,
String namespaceURI,
String qualifiedName)
? @see org.w3c.dom.Document#renameNode(org.w3c.dom.Node, java.lang.String, java.lang.String) |
void |
setBroker(DBBroker broker)
The method setBroker |
void |
setChildCount(int count)
The method setChildCount |
void |
setCollection(Collection parent)
The method setCollection |
void |
setDocId(int docId)
The method setDocId |
void |
setDocumentType(DocumentType docType)
The method setDocumentType |
void |
setDocumentURI(String documentURI)
? @see org.w3c.dom.Document#setDocumentURI(java.lang.String) |
void |
setEncoding(String enc)
The method setEncoding |
void |
setFileURI(XmldbURI fileURI)
The method setFileURI |
void |
setMetadata(DocumentMetadata meta)
The method setMetadata |
void |
setOwnerDocument(Document doc)
The method setOwnerDocument |
void |
setPermissions(int mode)
The method setPermissions |
void |
setPermissions(Permission perm)
The method setPermissions |
void |
setPermissions(String mode)
The method setPermissions |
void |
setStandalone(boolean alone)
The method setStandalone |
void |
setStrictErrorChecking(boolean strict)
The method setStrictErrorChecking |
void |
setTextContent(String textContent)
? @see org.w3c.dom.Node#setTextContent(java.lang.String) |
Object |
setUserData(String key,
Object data,
UserDataHandler handler)
? @see org.w3c.dom.Node#setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler) |
void |
setUserLock(User user)
The method setUserLock |
void |
setVersion(String version)
The method setVersion |
void |
setXmlStandalone(boolean xmlStandalone)
? @see org.w3c.dom.Document#setXmlStandalone(boolean) |
void |
setXmlVersion(String xmlVersion)
? @see org.w3c.dom.Document#setXmlVersion(java.lang.String) |
String |
toString()
The method toString |
void |
triggerDefrag()
The method triggerDefrag |
StoredNode |
updateChild(Txn transaction,
Node oldChild,
Node newChild)
Update a child node. |
void |
write(VariableByteOutputStream ostream)
The method write |
| Methods inherited from class org.exist.dom.NodeImpl |
|---|
appendChild, appendChildren, cloneNode, getAttributes, getAttributesCount, getLastChild, getNodeName, getNodeValue, getPrefix, hasAttributes, hasChildNodes, insertAfter, insertAfter, insertBefore, insertBefore, normalize, removeChild, removeChild, replaceChild, replaceChild, setAttributes, setNodeName, setNodeValue, setPrefix, supports, updateChild |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, getAttributes, getLastChild, getNodeName, getNodeValue, getPrefix, hasAttributes, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Field Detail |
|---|
public static final int UNKNOWN_DOCUMENT_ID
public static final byte XML_FILE
public static final byte BINARY_FILE
public static int LENGTH_DOCUMENT_ID
public static int LENGTH_DOCUMENT_TYPE
| Constructor Detail |
|---|
public DocumentImpl(DBBroker broker)
DocumentImpl instance.
broker - a DBBroker value
public DocumentImpl(DBBroker broker,
Collection collection)
DocumentImpl instance.
broker - a DBBroker valuecollection - a Collection value
public DocumentImpl(DBBroker broker,
XmldbURI fileURI)
DocumentImpl instance.
broker - a DBBroker valuefileURI - a XmldbURI value
public DocumentImpl(DBBroker broker,
Collection collection,
XmldbURI fileURI)
DocumentImpl instance.
broker - a DBBroker valuecollection - a Collection valuefileURI - a XmldbURI value| Method Detail |
|---|
public String getLocalName()
getLocalName
getLocalName in interface NodegetLocalName in class NodeImplString valueNode.getLocalName()public String getNamespaceURI()
getNamespaceURI
getNamespaceURI in interface NodegetNamespaceURI in class NodeImplString valueNode.getNamespaceURI()public Collection getCollection()
getCollection
Collection valuepublic void setCollection(Collection parent)
setCollection
parent - a Collection valuepublic int getDocId()
getDocId
int valuepublic void setDocId(int docId)
setDocId
docId - an int valuepublic byte getResourceType()
XML_FILE or
BINARY_FILE.
public XmldbURI getFileURI()
getFileURI
XmldbURI valuepublic void setFileURI(XmldbURI fileURI)
setFileURI
fileURI - a XmldbURI valuepublic XmldbURI getURI()
getURI
XmldbURI valuepublic Permission getPermissions()
getPermissions
Permission valuepublic void setPermissions(int mode)
setPermissions
mode - an int value
public void setPermissions(String mode)
throws SyntaxException
setPermissions
mode - a String value
SyntaxException - if an error occurspublic void setPermissions(Permission perm)
setPermissions
perm - a Permission valuepublic void setMetadata(DocumentMetadata meta)
setMetadata
meta - a DocumentMetadata valuepublic DocumentMetadata getMetadata()
getMetadata
DocumentMetadata valuepublic void copyOf(DocumentImpl other)
Collection when replacing a document.
other - a DocumentImpl valuepublic void copyChildren(DocumentImpl other)
copyChildren
other - a DocumentImpl valuepublic boolean isLockedForWrite()
public final Lock getUpdateLock()
public void setUserLock(User user)
setUserLock
user - an User valuepublic User getUserLock()
getUserLock
User valuepublic int getContentLength()
public void triggerDefrag()
triggerDefrag
public SymbolTable getSymbols()
getSymbols
SymbolTable valuepublic Node getNode(NodeId nodeId)
getNode
nodeId - a NodeId value
Node valuepublic Node getNode(NodeProxy p)
getNode
p - a NodeProxy value
Node value
public void appendChild(StoredNode child)
throws DOMException
appendChild
child - a StoredNode value
DOMException - if an error occurs
public void write(VariableByteOutputStream ostream)
throws IOException
write
ostream - a VariableByteOutputStream value
IOException - if an error occurs
public void read(VariableByteInput istream)
throws IOException,
EOFException
read
istream - a VariableByteInput value
IOException - if an error occurs
EOFException - if an error occurspublic void readDocumentMeta(VariableByteInput istream)
readDocumentMeta
istream - a VariableByteInput valuepublic final int compareTo(Object other)
compareTo
compareTo in interface Comparableother - an Object value
int valuepublic DBBroker getBroker()
getBroker
DBBroker valuepublic void setBroker(DBBroker broker)
setBroker
broker - a DBBroker value
public StoredNode updateChild(Txn transaction,
Node oldChild,
Node newChild)
throws DOMException
NodeImpl
updateChild in class NodeImplDOMException
public void insertBefore(NodeList nodes,
Node refChild)
throws DOMException
DOMException
public void insertAfter(NodeList nodes,
Node refChild)
throws DOMException
DOMExceptionpublic Node getFirstChild()
getFirstChild in interface NodegetFirstChild in class NodeImplNode.getFirstChild()public long getFirstChildAddress()
getFirstChildAddress
long valuepublic NodeList getChildNodes()
getChildNodes
getChildNodes in interface NodegetChildNodes in class NodeImplNodeList valuepublic DocumentType getDoctype()
getDoctype
getDoctype in interface DocumentDocumentType valuepublic void setDocumentType(DocumentType docType)
setDocumentType
docType - a DocumentType valuepublic Document getOwnerDocument()
getOwnerDocument
getOwnerDocument in interface NodeDocument valuepublic void setOwnerDocument(Document doc)
setOwnerDocument
doc - a Document valuepublic QName getQName()
getQName
getQName in interface QNameableQName valuepublic short getNodeType()
getNodeType
getNodeType in interface Nodeshort valuepublic Node getPreviousSibling()
getPreviousSibling
getPreviousSibling in interface NodeNode valuepublic Node getNextSibling()
getNextSibling
getNextSibling in interface NodeNode value
public Attr createAttribute(String name)
throws DOMException
createAttribute
createAttribute in interface Documentname - a String value
Attr value
DOMException - if an error occurs
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
throws DOMException
createAttributeNS
createAttributeNS in interface DocumentnamespaceURI - a String valuequalifiedName - a String value
Attr value
DOMException - if an error occurs
public Element createElement(String tagName)
throws DOMException
createElement
createElement in interface DocumenttagName - a String value
Element value
DOMException - if an error occurs
public Element createElementNS(String namespaceURI,
String qualifiedName)
throws DOMException
createElementNS
createElementNS in interface DocumentnamespaceURI - a String valuequalifiedName - a String value
Element value
DOMException - if an error occurspublic Text createTextNode(String data)
createTextNode
createTextNode in interface Documentdata - a String value
Text valuepublic Element getDocumentElement()
getDocumentElement
getDocumentElement in interface DocumentElement valuepublic NodeList getElementsByTagName(String tagname)
getElementsByTagName
getElementsByTagName in interface Documenttagname - a String value
NodeList value
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
getElementsByTagNameNS
getElementsByTagNameNS in interface DocumentnamespaceURI - a String valuelocalName - a String value
NodeList valuepublic Node getParentNode()
getParentNode in interface Nodepublic int getChildCount()
getChildCount
getChildCount in class NodeImplint valuepublic void setChildCount(int count)
setChildCount
count - an int valuepublic String getEncoding()
getEncoding
String valuepublic void setEncoding(String enc)
setEncoding
enc - a String valuepublic String getVersion()
getVersion
String valuepublic void setVersion(String version)
setVersion
version - a String valuepublic boolean getStandalone()
getStandalone
boolean valuepublic void setStandalone(boolean alone)
setStandalone
alone - a boolean value
public CDATASection createCDATASection(String data)
throws DOMException
createCDATASection
createCDATASection in interface Documentdata - a String value
CDATASection value
DOMException - if an error occurspublic Comment createComment(String data)
createComment
createComment in interface Documentdata - a String value
Comment value
public DocumentFragment createDocumentFragment()
throws DOMException
createDocumentFragment
createDocumentFragment in interface Document