org.nodal.filesystem
Interface Document

All Known Subinterfaces:
Directory, Directory.Editor, Schema, Schema.Editor

public interface Document

A Document in a Repository.


Method Summary
 Directory asDirectory()
          Treat this Document as a Directory.
 Node docNode()
          The Document node for this document.
 DocumentFormat format()
          The schema for this document type.
 Node nodeNamed(Name name)
          Return the Node with the given Name in this Document.
 Node nodeNamed(java.lang.String name)
          Return the Node with the given Name in this Document.
 Path path()
          A Path to this Document.
 Repository repository()
          The Repository that contains this Document.
 Node root()
          The root Node of this Document's graph.
 void write(java.io.OutputStream s)
          Write the encoding of this Document on the given OutputStream.
 

Method Detail

repository

public Repository repository()
The Repository that contains this Document.


path

public Path path()
A Path to this Document.


format

public DocumentFormat format()
The schema for this document type.


root

public Node root()
The root Node of this Document's graph.


docNode

public Node docNode()
The Document node for this document.

Returns:
the Document Node for this Document

nodeNamed

public Node nodeNamed(Name name)
Return the Node with the given Name in this Document.

Parameters:
name - the Name of the Node
Returns:
the Node so named or null if none

nodeNamed

public Node nodeNamed(java.lang.String name)
Return the Node with the given Name in this Document.

Parameters:
name - a String representing the Node
Returns:
the Node so named or null if none

asDirectory

public Directory asDirectory()
Treat this Document as a Directory. If it is a Directory, then return the Directory interface, otherwise return null. Can be used both as a cast and test.

Returns:
a Directory interface if this Document is one, otherwise null.

write

public void write(java.io.OutputStream s)
           throws java.io.IOException
Write the encoding of this Document on the given OutputStream.

Parameters:
s - the stream to write onto
Throws:
java.io.IOException