org.jscience.ml.cml.cmlimpl
Class DocumentFactoryImpl

java.lang.Object
  extended by org.jscience.ml.cml.cmlimpl.DocumentFactoryImpl
All Implemented Interfaces:
CMLDocumentFactory

public class DocumentFactoryImpl
extends java.lang.Object
implements CMLDocumentFactory

manufactures CMLDocuments


Field Summary
static java.lang.String ABSTRACT_CMLDOCUMENT
          DOCUMENT ME!
static java.lang.String DEFAULT_CMLDOCUMENT
          DOCUMENT ME!
protected  java.lang.String documentClassName
          Description of the Field
 
Constructor Summary
protected DocumentFactoryImpl()
          Creates a new DocumentFactoryImpl object with default documentClassName
 
Method Summary
 AbstractCMLDocument createDocument()
          create a CMLDocument class of document can be set through setDocumentClassName, default is DEFAULT_CMLDOCUMENT, at present org.jscience.ml.cml.cmlimpl.AbstractCMLDocumentImpl
 AbstractCMLDocument createDocument(java.lang.String documentClassName)
          create a CMLDocument class of document can be set through setDocumentClassName, default is DEFAULT_CMLDOCUMENT, at present org.jscience.ml.cml.cmlimpl.AbstractCMLDocumentImpl
static AbstractCMLDocument createNewDocument()
          Creates a new CMLDocument this creates Documents of the subclassed documentClassName NOTE: The default class will create Elements of type CMLBaseImpl, subclassed to fit the schema.
static CMLDocumentFactory newAbstractInstance()
          Creates a new DocumentFactory this creates Documents and elements of the abstract documentClassName NOTE: The default class will create Elements of type PMRElement, not subclassed to fit the schema.
static CMLDocumentFactory newInstance()
          Creates a new DocumentFactory this creates Documents of the subclassed documentClassName NOTE: The default class will create Elements of type CMLBaseImpl, subclassed to fit the schema.
static CMLDocumentFactory newInstance(java.lang.String documentClassName)
          Creates a new DocumentFactory this creates Documents and elements determined by the CMLDocumentImpl If elements of type PMRELementImpl are required use newAbstractInstance();
 AbstractCMLDocument parseSAX(org.xml.sax.InputSource is)
          Description of the Method whitespace is ignored
 org.w3c.dom.Element parseSAX(org.xml.sax.InputSource is, AbstractCMLDocument doc)
          Description of the Method whitespace is ignored
 org.w3c.dom.Element parseSAX(org.xml.sax.InputSource is, AbstractCMLDocument doc, boolean debug)
          Description of the Method whitespace is ignored
 AbstractCMLDocument parseSAX(org.xml.sax.InputSource is, boolean debug)
          Description of the Method whitespace is ignored
 AbstractCMLDocument parseString(java.lang.String xmlString)
          Convenience method to parseSAX an XML document into a CMLDocument all classes are CML Objects where possible.
 void setDocumentClassName(java.lang.String documentClassName)
          set the document class name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABSTRACT_CMLDOCUMENT

public static final java.lang.String ABSTRACT_CMLDOCUMENT
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULT_CMLDOCUMENT

public static final java.lang.String DEFAULT_CMLDOCUMENT
DOCUMENT ME!

See Also:
Constant Field Values

documentClassName

protected java.lang.String documentClassName
Description of the Field

Constructor Detail

DocumentFactoryImpl

protected DocumentFactoryImpl()
Creates a new DocumentFactoryImpl object with default documentClassName

Method Detail

setDocumentClassName

public void setDocumentClassName(java.lang.String documentClassName)
set the document class name

Specified by:
setDocumentClassName in interface CMLDocumentFactory
Parameters:
documentClassName - the classname with which to create new Documents

createDocument

public AbstractCMLDocument createDocument()
create a CMLDocument class of document can be set through setDocumentClassName, default is DEFAULT_CMLDOCUMENT, at present org.jscience.ml.cml.cmlimpl.AbstractCMLDocumentImpl

Specified by:
createDocument in interface CMLDocumentFactory
Returns:
Description of the Return Value

createDocument

public AbstractCMLDocument createDocument(java.lang.String documentClassName)
create a CMLDocument class of document can be set through setDocumentClassName, default is DEFAULT_CMLDOCUMENT, at present org.jscience.ml.cml.cmlimpl.AbstractCMLDocumentImpl

Parameters:
documentClassName - Description of the Parameter
Returns:
Description of the Return Value

newAbstractInstance

public static CMLDocumentFactory newAbstractInstance()
Creates a new DocumentFactory this creates Documents and elements of the abstract documentClassName NOTE: The default class will create Elements of type PMRElement, not subclassed to fit the schema. For that use newInstance(String documentClassName);

Returns:
the CMLDocumentFactory

newInstance

public static CMLDocumentFactory newInstance()
Creates a new DocumentFactory this creates Documents of the subclassed documentClassName NOTE: The default class will create Elements of type CMLBaseImpl, subclassed to fit the schema. If elements of type PMRElementImpl are required use newAbstractInstance();

Returns:
the CMLDocumentFactory

createNewDocument

public static AbstractCMLDocument createNewDocument()
Creates a new CMLDocument this creates Documents of the subclassed documentClassName NOTE: The default class will create Elements of type CMLBaseImpl, subclassed to fit the schema. If elements of type PMRElementImpl are required use newAbstractInstance();

Returns:
the CMLDocumentFactory

newInstance

public static CMLDocumentFactory newInstance(java.lang.String documentClassName)
Creates a new DocumentFactory this creates Documents and elements determined by the CMLDocumentImpl If elements of type PMRELementImpl are required use newAbstractInstance();

Parameters:
documentClassName - Description of the Parameter
Returns:
Description of the Return Value

parseString

public AbstractCMLDocument parseString(java.lang.String xmlString)
                                throws CMLException
Convenience method to parseSAX an XML document into a CMLDocument all classes are CML Objects where possible.

Specified by:
parseString in interface CMLDocumentFactory
Parameters:
xmlString - represents a well-formed XML document
Returns:
CMLDocument corresponding to String
Throws:
CMLException - Description of the Exception

parseSAX

public AbstractCMLDocument parseSAX(org.xml.sax.InputSource is)
                             throws CMLException,
                                    java.io.IOException
Description of the Method whitespace is ignored

Specified by:
parseSAX in interface CMLDocumentFactory
Parameters:
is - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception
CMLException

parseSAX

public org.w3c.dom.Element parseSAX(org.xml.sax.InputSource is,
                                    AbstractCMLDocument doc)
                             throws CMLException,
                                    java.io.IOException
Description of the Method whitespace is ignored

Specified by:
parseSAX in interface CMLDocumentFactory
Parameters:
is - Description of the Parameter
doc - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception
CMLException

parseSAX

public AbstractCMLDocument parseSAX(org.xml.sax.InputSource is,
                                    boolean debug)
                             throws CMLException,
                                    java.io.IOException
Description of the Method whitespace is ignored

Specified by:
parseSAX in interface CMLDocumentFactory
Parameters:
is - Description of the Parameter
debug - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception
. - Description of the Exception
CMLException

parseSAX

public org.w3c.dom.Element parseSAX(org.xml.sax.InputSource is,
                                    AbstractCMLDocument doc,
                                    boolean debug)
                             throws CMLException,
                                    java.io.IOException
Description of the Method whitespace is ignored

Specified by:
parseSAX in interface CMLDocumentFactory
Parameters:
is - input
doc - document to which element will belong
debug - if true, debug
Returns:
the new root element
Throws:
java.io.IOException
. - any bad CML or XML
CMLException