|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.util.ClassFactory | +--net.jxta.document.StructuredDocumentFactory
This class provides a static method for constructing instances of
various sub-classes of StructuredDocument
. Behind the
scene, it also provides for the registration of the mime-types and
constructors needed to accomplish the construction.All supported
mime-types will need to register their implementation in this factory.
The configuration is done via the property "StructuredDocumentInstanceTypes"
FIXME bondolo@jxta.org 20010223 This implementation needs a way to return the list of mime media types supported
Document
,
StructuredTextDocument
,
StructuredDocument
,
MimeMediaType
Constructor Summary | |
StructuredDocumentFactory()
|
Method Summary | |
protected java.util.Hashtable |
getAssocTable()
Used by ClassFactory methods to get the mapping of Mime Types to constructors. |
protected java.lang.Class |
getBaseClassForFactory()
Used by ClassFactory methods to ensure that all of the instance classes which register with this factory have the correct base class |
protected java.lang.Class |
getClassForKey()
Used by ClassFactory methods to ensure that all keys used with the mapping are of the correct type. |
protected java.lang.Class[][] |
getRequiredConstructors()
Used by ClassFactory methods to determine the required set of constructors needed by the instance classes generated by this factory. |
protected java.lang.Object[][] |
getRequiredStaticMethods()
Used by ClassFactory methods to determine the required set of static methods needed by classes registering with this factory. |
static StructuredDocument |
newStructuredDocument(MimeMediaType mimetype,
java.io.InputStream stream)
Constructs an instance of StructuredDocument matching
the mime-type specified by the mimetype parameter. |
static StructuredDocument |
newStructuredDocument(MimeMediaType mimetype,
java.lang.String doctype)
Constructs an instance of StructuredDocument matching
the mime-type specified by the mimetype parameter. |
protected boolean |
registerAssoc(java.lang.String className)
Register a class with the factory from its class name. |
static boolean |
registerEncoding(MimeMediaType cleanMime,
java.lang.Class instanceClass)
Register an array of constructor for a mime-type to enable that mime-type of documents to be constructed. |
Methods inherited from class net.jxta.util.ClassFactory |
callStaticMethod,
newInstance,
registerAssoc,
registerFromResources,
registerFromString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public StructuredDocumentFactory()
Method Detail |
protected java.util.Hashtable getAssocTable()
protected java.lang.Class getClassForKey()
protected java.lang.Class getBaseClassForFactory()
protected java.lang.Class[][] getRequiredConstructors()
protected java.lang.Object[][] getRequiredStaticMethods()
protected boolean registerAssoc(java.lang.String className)
className
- The class name which will be regiestered.public static boolean registerEncoding(MimeMediaType cleanMime, java.lang.Class instanceClass) throws java.lang.NoSuchMethodException, java.lang.SecurityException
cleanMime
- the mime-type associatedinstanceClass
- the instance class that wants to be registered..public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, java.lang.String doctype) throws java.lang.reflect.InvocationTargetException
StructuredDocument
matching
the mime-type specified by the mimetype
parameter. The
doctype
parameter identifies the base type of the
StructuredDocument
.mimetype
- Specifies the mime media type to be associated with
the StructuredDocument
to be created.doctype
- Specifies the root type of the
StructuredDocument
to be created.StructuredDocument
or null if it could not be created.public static StructuredDocument newStructuredDocument(MimeMediaType mimetype, java.io.InputStream stream) throws java.lang.reflect.InvocationTargetException
StructuredDocument
matching
the mime-type specified by the mimetype
parameter. The
doctype
parameter identifies the base type of the
StructuredDocument
.mimetype
- Specifies the mime media type to be associated with the
StructuredDocument
to be created.stream
- Contains an InputStream from which the document will be constructed.StructuredDocument
or null if it could not be created.
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |