|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
javax.ide.Service
javax.ide.model.DocumentFactory
public abstract class DocumentFactory
The DocumentFactory
interface is responsible for creating intances of Document
s.
The type of Document
that gets created depends on the URI
that is passed into the findOrCreate(URI)
method. The DocumentFactory
makes use of registered Recognizer
instances to determine what Document
class corresponds to a particular URI
.
JSR-198 specifies a number of ways to recognize documents:
URI
,For case 1. extension writers need only map a file extension or some part of the URI
to a document interface.
For case 2. extension writers can map the XML namespace, doctype, or root element to a document interface.
For case3. extension writers can introduce their own custom Recognizer
.
Every Document
instance created by the DocumentFactory
is cached. An instance of an already created Document
can be retrieved from the cache by calling the find(URI)
method.
Document
Constructor Summary | |
---|---|
DocumentFactory() |
Method Summary | |
---|---|
abstract Document |
find(java.net.URI uri) Find the Document associated with the URI . |
abstract Document |
findOrCreate(java.net.URI uri) Returns the Document associated with the URI . |
abstract java.util.Collection |
getCachedDocuments() Returns a Collection of the Document instances that are currently cached. |
static DocumentFactory |
getDocumentFactory() Get the DocumentFactory implementation for this IDE. |
abstract Document |
recache(java.net.URI oldURI, java.net.URI newURI) Removes the oldURI from the cache and puts the newURI in the cache so that it is associated with the original Document oldURI pointed at. |
abstract Document |
uncache(java.net.URI uri) Remove the specified URI from the cache. |
Methods inherited from class javax.ide.Service |
---|
getService, initialize, resetAllServices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentFactory()
Method Detail |
---|
public abstract Document findOrCreate(java.net.URI uri) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.ClassNotFoundException
Document
associated with the URI
. If the Document
does not exist and the URI corresponds to a resource that does exists, a new Document
of the correct type is created.uri
- unique URI
identifying the document. Must not be null.java.lang.IllegalAccessException
- When the Document
interface or its initializer is not accessible.java.lang.InstantiationException
- When the document is an abstract class, an interface, an array class, a primitive type, or void; or if the instantiation fails for some other reason.java.lang.ClassNotFoundException
- When the Class
is not found.public abstract Document find(java.net.URI uri)
Document
associated with the URI
. If the Document
does not exist, null
is returned.uri
- URI
identifying the Document
. Must not be null.Document
, or null
if none exists.public abstract Document recache(java.net.URI oldURI, java.net.URI newURI)
oldURI
from the cache and puts the newURI
in the cache so that it is associated with the original Document
oldURI
pointed at.oldURI
- the old URI of the document. Must not be null.newURI
- the new URI of the document. Must not be null.public abstract Document uncache(java.net.URI uri)
uri
- the uri to remove from the cache. Must not be null.public abstract java.util.Collection getCachedDocuments()
Collection
of the Document
instances that are currently cached. The iteration order of the returned collection is not guaranteed.Document
s. Never returns null, may return an empty collection. The collection is immutable.public static DocumentFactory getDocumentFactory()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |