public interface DocumentContainer
Modifier and Type | Method and Description |
---|---|
Document |
addChild(String name,
String typeName)
Creates a new child document given its typename.
|
Document |
getChild(String name)
Gets a child document given its name.
|
Iterator<Document> |
getChildren()
Gets an iterator over the children of the document.
|
DocumentIterator |
getChildren(int start) |
List<String> |
getChildrenIds()
Gets a list of the children ids.
|
boolean |
hasChild(String name)
Tests if the document has the named child.
|
boolean |
hasChildren()
Tests if the document has any children.
|
void |
orderBefore(String src,
String dest)
Orders the given source child before the destination child.
|
void |
removeChild(String name)
Removes the child having the given name
|
Document |
resolvePath(String relPath)
Resolves a document given its relative path to the current document.
|
Document resolvePath(String relPath) throws DocumentException
If the path is absolute then it will be transformed in a relative path (i.e. the leading '/' removed).
relPath
- the path relative to this documentDocumentException
Document getChild(String name) throws DocumentException
Throws an exception if the document could not be found.
If the supplied name is null, returns the default child of the document if any, otherwise raises an exception.
name
- the name of the child to retrieveUnsupportedOperationException
- if this is not a folder documentDocumentException
Iterator<Document> getChildren() throws DocumentException
This operation silently ignores non-folder documents: if the document is not a folder then it returns an empty iterator.
DocumentException
DocumentIterator getChildren(int start) throws DocumentException
DocumentException
List<String> getChildrenIds() throws DocumentException
DocumentException
boolean hasChild(String name) throws DocumentException
This operation silently ignores non-folder documents: If the document is not a folder then return false.
name
- the name of the child to testDocumentException
boolean hasChildren() throws DocumentException
This operation silently ignores non-folder documents: If the document is not a folder then returns false.
DocumentException
Document addChild(String name, String typeName) throws DocumentException
This operation throws an error if the current document is not a folder.
name
- the name of the new child to createtypeName
- the type of the child to createDocumentException
void removeChild(String name) throws DocumentException
If this is not a folder does nothing.
If this is a folder and no child exists with the given name then throws an exception
name
- the child nameDocumentException
void orderBefore(String src, String dest) throws DocumentException
src
- the document to movedest
- the document before which to place the source documentDocumentException
- if this document is not an orderable folder or any other exception occursCopyright © 2011 Nuxeo SA. All Rights Reserved.