Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.xml.xmlc.dom
Interface XMLCDomFactory  view XMLCDomFactory download XMLCDomFactory.java


public interface XMLCDomFactory

Interface for a factory class that can create DocumentType and Document objects. It also provides document-type specific functions. This is used in implementing subclassed DOMs.

Classes implementing this must:

When a DTD-specific DOM is created, an class implementing this interface must be supplied to XMLC. This would normally be created by extending the XMLCDomDefaultFactory class.

This class is designed to be build using a DOMImplementation object. However, since the DOM doesn't specify how DOMImplementation objects are obtained, we hide that detail. The methods are somewhat different for historic reasons.


Method Summary
 AccessorGenerator createAccessorGenerator(org.w3c.dom.Document document)
          Create an AccessorGenerator object for this DOM.
 DocBuilderGenerator createDocBuilderGenerator(org.w3c.dom.Document document)
          Create an DocBuilderGenerator object for this DOM.
 org.w3c.dom.Document createDocument(java.lang.String namespaceURI, java.lang.String qualifiedName, org.w3c.dom.DocumentType doctype)
          Creates an XML Document object of the specified type.
 org.w3c.dom.DocumentType createDocumentType(java.lang.String qualifiedName, java.lang.String publicID, java.lang.String systemID, java.lang.String internalSubset)
          Creates an empty DocumentType node.
 java.lang.String getBaseClassName()
          Get the base class name for generated classes.
 java.lang.String[] getElementClassNames(org.w3c.dom.Element element)
          Extract the class names for an element.
 java.lang.String[] getInterfaceNames()
          Get the interface names that will automatically be added to all generated classes and interfaces.
 java.lang.String getMIMEType()
          Get the MIME type to associated with the document, or null if none should be associated.
 boolean isURLAttribute(org.w3c.dom.Element element, java.lang.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.
 java.lang.String nodeClassToInterface(org.w3c.dom.Node node)
          Convert an implementation-specific DOM node class name to the external interface or class name that should be used to reference it.
 

Method Detail

createDocumentType

public org.w3c.dom.DocumentType createDocumentType(java.lang.String qualifiedName,
                                                   java.lang.String publicID,
                                                   java.lang.String systemID,
                                                   java.lang.String internalSubset)
Creates an empty DocumentType node.


createDocument

public org.w3c.dom.Document createDocument(java.lang.String namespaceURI,
                                           java.lang.String qualifiedName,
                                           org.w3c.dom.DocumentType doctype)
Creates an XML Document object of the specified type. The document element should be created. A HTML document should only have the document element, which differs from the DOMImplementation specification, however it makes code generation easier and its not expected that there will be many custom HTML DOM factories.


getMIMEType

public java.lang.String getMIMEType()
Get the MIME type to associated with the document, or null if none should be associated.


getBaseClassName

public java.lang.String getBaseClassName()
Get the base class name for generated classes. It must extend XMLObjectImpl. This class maybe overridden for individual documents that are compiled.


getInterfaceNames

public java.lang.String[] getInterfaceNames()
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.


nodeClassToInterface

public java.lang.String nodeClassToInterface(org.w3c.dom.Node node)
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.


getElementClassNames

public java.lang.String[] getElementClassNames(org.w3c.dom.Element element)
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.


isURLAttribute

public boolean isURLAttribute(org.w3c.dom.Element element,
                              java.lang.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. 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.


createAccessorGenerator

public AccessorGenerator createAccessorGenerator(org.w3c.dom.Document document)
Create an AccessorGenerator object for this DOM. Normally, this method is inherited from the DOM that the base DOM implementation a.


createDocBuilderGenerator

public DocBuilderGenerator createDocBuilderGenerator(org.w3c.dom.Document document)
Create an DocBuilderGenerator object for this DOM. Normally, this method is inherited from the DOM that the base DOM implementation a.