|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openxml.source.Holder
Interface describing a document holder. Holder classes are used to provide access to documents through various protocols and storages locations (network, file system, JAR, etc) and to support document caching.
The holder implements methods for determining whether the source document
can be cached (canCache()
) and whether the cached image is up to
date (hasModified()
). It also provides access to the document source
through getReader()
. It is up to the particular holder to determine
how to implement these features.
The document is obtained using two methods. getReadOnly()
returns
a read-only instance of the document that should not be modified by the
application. If the document supports caching, newInstance()
returns
a new modifiable instance of the document each time. The application may
modify a given instance without affecting other instances. If the document
does not support caching, then both methods return the same single instance,
but calling HolderFactory.newHolder(org.openxml.source.Source)
will return a different holder
each time.
HolderFactory
Constructor Summary | |
Holder()
|
Method Summary | |
abstract boolean |
canCache()
Returns true if document can be cached. |
abstract java.lang.String |
getEncoding()
Returns the encoding for reading the source. |
abstract SAXException |
getLastException()
Returns the last exception generated when parsing the document. |
abstract java.io.Reader |
getReader()
Returns a reader for the source. |
abstract Document |
getReadOnly()
Returns a read-only instance of the document. |
abstract java.lang.String |
getURI()
Returns the source URI. |
abstract boolean |
hasModified()
Returns true if the source has been modified since it was created. |
abstract Document |
newInstance()
Returns a new modifiable instance of the document. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Holder()
Method Detail |
public abstract boolean canCache()
public abstract boolean hasModified()
public abstract java.lang.String getURI()
public abstract java.io.Reader getReader() throws java.io.IOException
public abstract java.lang.String getEncoding()
public abstract Document getReadOnly()
A default implementation would call getReader()
to obtain a reader
to the source, parse the document using the selected document class, and
returns that document. The document is rendered read-only only if this
holder can be cached.
public abstract Document newInstance()
getReadOnly()
.
A default implementation would obtain the instance from getReadOnly()
;
if caching is supported, a new modifiable instance woudld be created and
returned, otherwise, the same instance would be returned.
public abstract SAXException getLastException()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |