org.enhydra.xml.xmlc.dom.xerces
Class XercesDomFactory

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.dom.xerces.XercesDomFactory
All Implemented Interfaces:
XMLCDomFactory
Direct Known Subclasses:
LazyDomFactory, XercesHTMLDomFactory

public class XercesDomFactory
extends Object
implements XMLCDomFactory

XMLC DOM factory for creating DocumentType and Document objects based on the Xerces DOM.


Nested Class Summary
 class XercesDomFactory.LinkedXercesDocument
          Deprecated. Remains for compaitiblity with objects compiled with XMLC 2.0.1
 
Constructor Summary
XercesDomFactory()
           
 
Method Summary
 AccessorGenerator createAccessorGenerator(Document document)
          Create an AccessorGenerator object for this DOM.
 DocBuilderGenerator createDocBuilderGenerator(Document document)
          Create an DocBuilderGenerator object for this DOM.
 Document createDocument(String namespaceURI, String qualifiedName, DocumentType docType)
          This creates a Document object that extends the Xerces Document class and implements XMLObjectLink.
 DocumentType createDocumentType(String qualifiedName, String publicId, String systemId, String internalSubset)
          Creates an empty DocumentType node.
 String getBaseClassName()
          Get the base class name for generated classes.
 String[] getElementClassNames(Element element)
          Extract the class names for an element.
 String[] getInterfaceNames()
          Get the interface names that will automatically be added to all generated classes and interfaces.
 String getMIMEType()
          Get the MIME type to associated with the document, or null if none should be associated.
 boolean isURLAttribute(Element element, String attrName)
          Determine if an an attribute of an element may contain a URL and should be subject to URL editing at compile time(or rewriting at run time.
 String nodeClassToInterface(Node node)
          Convert an implementation-specific DOM node class name to the external interface or class name that should be used to reference it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XercesDomFactory

public XercesDomFactory()
Method Detail

getMIMEType

public String getMIMEType()
Description copied from interface: XMLCDomFactory
Get the MIME type to associated with the document, or null if none should be associated.

Specified by:
getMIMEType in interface XMLCDomFactory
See Also:
XMLCDomFactory.getMIMEType()

getBaseClassName

public String getBaseClassName()
Description copied from interface: XMLCDomFactory
Get the base class name for generated classes. It must extend XMLObjectImpl. This class maybe overridden for individual documents that are compiled.

Specified by:
getBaseClassName in interface XMLCDomFactory
See Also:
XMLCDomFactory.getBaseClassName()

getInterfaceNames

public String[] getInterfaceNames()
Description copied from interface: XMLCDomFactory
Get the interface names that will automatically be added to all generated classes and interfaces. This class maybe overridden for individual documents that are compiled. It XMLObject is not part of the list, it will be added automatically.

Specified by:
getInterfaceNames in interface XMLCDomFactory
Returns:
An array of fully-qualified interface names, or null if none, other than XMLObject, are to be added.
See Also:
XMLCDomFactory.getInterfaceNames()

getElementClassNames

public String[] getElementClassNames(Element element)
Description copied from interface: XMLCDomFactory
Extract the class names for an element. This is a class for grouping elements, not the Java class. In HTML, the class is specified with the class attribute and with a value of a white-space separated list of class names. Its not specified for XML, however this method can be implemented in DTD-specifc XMLDomFactories to enable this functionality.

Specified by:
getElementClassNames in interface XMLCDomFactory
Returns:
An array of class names or null if the node has no classes. XML returns null.
See Also:
XMLCDomFactory.getElementClassNames(org.w3c.dom.Element)

isURLAttribute

public boolean isURLAttribute(Element element,
                              String attrName)
Description copied from interface: XMLCDomFactory
Determine if an an attribute of an element may contain a URL and should be subject to URL editing at compile time(or rewriting at run time. This method is required, as there is not way to define this in a XML DTD. With HTML, the attributes returned should have values of type %URL, %URI or %Script.

Specified by:
isURLAttribute in interface XMLCDomFactory
Parameters:
element - The element object the attribute is associated with.
attrName - The name of the attribute.
Returns:
True if the attribute may contain a URL (although it could contain JavaScript, etc. False if it can't and shouldn't be edited.
See Also:
XMLCDomFactory.isURLAttribute(org.w3c.dom.Element, java.lang.String)

createDocumentType

public DocumentType createDocumentType(String qualifiedName,
                                       String publicId,
                                       String systemId,
                                       String internalSubset)
Description copied from interface: XMLCDomFactory
Creates an empty DocumentType node.

Specified by:
createDocumentType in interface XMLCDomFactory
Parameters:
qualifiedName - The document type name (same as the root element).
publicId - The document type public identifier.
systemId - The document type system identifier.
internalSubset - The internal subset as a string.
Returns:
A new DocumentType node.
See Also:
XMLCDomFactory.createDocumentType(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

createDocument

public Document createDocument(String namespaceURI,
                               String qualifiedName,
                               DocumentType docType)
This creates a Document object that extends the Xerces Document class and implements XMLObjectLink.

Specified by:
createDocument in interface XMLCDomFactory
Parameters:
namespaceURI - The namespace URI of the document element to create, or null.
qualifiedName - The document type name (same as the root element). Maybe null for HTML documents or documents without DTDs.
docType - The type of document to be created or null. When doctype is not null, its Node.ownerDocument attribute is set to the document being created. Maybe null for for documents without DTDs or HTML documents.
Returns:
A new Document object.
See Also:
XMLCDomFactory.createDocument(java.lang.String, java.lang.String, org.w3c.dom.DocumentType)

nodeClassToInterface

public String nodeClassToInterface(Node node)
Description copied from interface: XMLCDomFactory
Convert an implementation-specific DOM node class name to the external interface or class name that should be used to reference it. This could be a org.w3c.dom interface or other interface or class.

Specified by:
nodeClassToInterface in interface XMLCDomFactory
See Also:
XMLCDomFactory.nodeClassToInterface(org.w3c.dom.Node)

createAccessorGenerator

public AccessorGenerator createAccessorGenerator(Document document)
Description copied from interface: XMLCDomFactory
Create an AccessorGenerator object for this DOM. Normally, this method is inherited from the DOM that the base DOM implementation a.

Specified by:
createAccessorGenerator in interface XMLCDomFactory
See Also:
XMLCDomFactory.createAccessorGenerator(org.w3c.dom.Document)

createDocBuilderGenerator

public DocBuilderGenerator createDocBuilderGenerator(Document document)
Description copied from interface: XMLCDomFactory
Create an DocBuilderGenerator object for this DOM. Normally, this method is inherited from the DOM that the base DOM implementation a.

Specified by:
createDocBuilderGenerator in interface XMLCDomFactory
See Also:
XMLCDomFactory.createDocBuilderGenerator(org.w3c.dom.Document)


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.