oracle.ide.model
Interface Document
- All Superinterfaces:
- Data, Dirtyable, Displayable, Element, LazyLoadable, Locatable, Subject
- All Known Subinterfaces:
- Container, JavaNode, Layout, Node, TextDocument, WorkEnvironment
- All Known Implementing Classes:
- DefaultDocument
- public interface Document
- extends Locatable, Element, Subject, Dirtyable, LazyLoadable
The Document
interface is implemented by objects which
have a persistent representation.
Note: each Document must properly implement the Locatable
interface and return a valid URL
Method Summary |
void |
close()
Closes the Document and unloads any associated data. |
java.io.InputStream |
getInputStream()
Gets an InputStream that can be used to read the contents
of this object. |
long |
getTimestamp()
Returns the timestamp associated with the Document ,
which indicates the time at which the document was last modified. |
boolean |
isNew()
Returns true if the document's data has never been
saved. |
boolean |
isReadOnly()
Returns true if the document is read-only. |
void |
open()
Opens the Document and loads any associated data
into the appropriate data structures. |
void |
save(boolean shallow)
Saves the contents of the document. |
Methods inherited from interface oracle.ide.model.Data |
getData |
open
public void open()
throws java.io.IOException
- Opens the
Document
and loads any associated data
into the appropriate data structures. If the implementation
of this method completes successfully, the LazyLoadable.isOpen()
method should then return true
.
close
public void close()
throws java.io.IOException
- Closes the
Document
and unloads any associated data.
When this method returns, the state of the Document
object should be equivalent to when the Document
object has just been instantiated but not yet opened.
save
public void save(boolean shallow)
throws java.io.IOException
- Saves the contents of the document.
- Parameters:
shallow
- The value of this parameter only matters if the
Document
is also a Container
. If
shallow
is true
, children should not
be saved; if shallow
is false
, children
should also be saved.
isNew
public boolean isNew()
- Returns
true
if the document's data has never been
saved.
- Returns:
true
if the document's data has never been
saved.
isReadOnly
public boolean isReadOnly()
- Returns
true
if the document is read-only.
getTimestamp
public long getTimestamp()
- Returns the timestamp associated with the
Document
,
which indicates the time at which the document was last modified.
The returned long
is expressed in milliseconds since
00:00:00 GMT Jan 1, 1970.
- Returns:
- the
Document
's time stamp.
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException
- Gets an
InputStream
that can be used to read the contents
of this object.
- Returns:
- an
InputStream
, or null
if the
document has no contents. - Throws:
java.io.IOException
- if a security manager exists and its
checkRead
method denies read access.