01 November, 2000

Appendix B: Java Language Binding

This appendix contains the complete Java [Java] bindings for the Level 3 Document Object Model Content Model and Load and Save.

The Java files are also available as http://www.w3.org/TR/2000/WD-DOM-Level-3-Content-Models-and-Load-Save-20001101/java-binding.zip

org/w3c/dom/contentModel/CMObject.java:

package org.w3c.dom.contentModel;

public interface CMObject {
}

org/w3c/dom/contentModel/CMExternalObject.java:

package org.w3c.dom.contentModel;

public interface CMExternalObject {
}

org/w3c/dom/contentModel/CMNode.java:

package org.w3c.dom.contentModel;

public interface CMNode {
}

org/w3c/dom/contentModel/CMNodeList.java:

package org.w3c.dom.contentModel;

public interface CMNodeList {
}

org/w3c/dom/contentModel/NamedCMNodeMap.java:

package org.w3c.dom.contentModel;

public interface NamedCMNodeMap {
}

org/w3c/dom/contentModel/CMDataType.java:

package org.w3c.dom.contentModel;

public interface CMDataType {
}

org/w3c/dom/contentModel/CMType.java:

package org.w3c.dom.contentModel;

public interface CMType {
}

org/w3c/dom/contentModel/ElementDeclaration.java:

package org.w3c.dom.contentModel;

public interface ElementDeclaration {
    public String getElementName();

    public String getContentType();
    public void setContentType(String contentType);

    public NamedCMNodeMap getAttributes();
    public void setAttributes(NamedCMNodeMap attributes);

}

org/w3c/dom/contentModel/CMElement.java:

package org.w3c.dom.contentModel;

public interface CMElement {
    public String getListOperator();
    public void setListOperator(String listOperator);

    public CMDataType getElementType();
    public void setElementType(CMDataType elementType);

    public int getMultiplicity();
    public void setMultiplicity(int multiplicity);

    public int getLowValue();
    public void setLowValue(int lowValue);

    public int getHighValue();
    public void setHighValue(int highValue);

    public NamedCMNodeMap getSubModels();
    public void setSubModels(NamedCMNodeMap subModels);

    public CMNodeList getDefiningElement();
    public void setDefiningElement(CMNodeList definingElement);

}

org/w3c/dom/contentModel/AttributeDeclaration.java:

package org.w3c.dom.contentModel;

public interface AttributeDeclaration {
    public String getAttrName();

    public CMDataType getAttrType();
    public void setAttrType(CMDataType attrType);

    public String getDefaultValue();
    public void setDefaultValue(String defaultValue);

    public String getEnumAttr();
    public void setEnumAttr(String enumAttr);

    public CMNodeList getOwnerElement();
    public void setOwnerElement(CMNodeList ownerElement);

}

org/w3c/dom/contentModel/EntityDeclaration.java:

package org.w3c.dom.contentModel;

public interface EntityDeclaration {
}

org/w3c/dom/contentModel/DocumentCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.Document;

public interface DocumentCM extends Document {
    public boolean isValid();

    public int numCMs();

    public CMObject getInternalCM();

    public CMExternalObject getCMs();

    public CMObject getActiveCM();

    public void addCM(CMObject cm);

    public void removeCM(CMObject cm);

    public boolean activateCM(CMObject cm);

    public void setErrorHandler(ErrorHandler handler);

}

org/w3c/dom/contentModel/DomImplementationCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.DomImplementation;

public interface DomImplementationCM extends DomImplementation {
    public boolean validate();

    public CMObject createCM();

    public CMExternalObject createExternalCM();

    public CMObject cloneCM(CMObject cm);

    public CMExternalObject cloneExternalCM(CMExternalObject cm);

}

org/w3c/dom/contentModel/ErrorHandler.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.DOMException2;

public interface ErrorHandler {
    public void warning(DOMLocator where, 
                        String how, 
                        String why)
                        throws DOMException2;

    public void fatalError(DOMLocator where, 
                           String how, 
                           String why)
                           throws DOMException2;

    public void error(DOMLocator where, 
                      String how, 
                      String why)
                      throws DOMException2;

}

org/w3c/dom/contentModel/DOMLocator.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.Node;

public interface DOMLocator {
    public int getColumnNumber();

    public int getLineNumber();

    public String getPublicID();

    public String getSystemID();

    public Node getNode();

}

org/w3c/dom/contentModel/CMObject.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.namedCMNodeMap;
import org.w3c.dom.nsElement;

public interface CMObject {
    public boolean getIsNamespaceAware();

    public nsElement getCMNamespace();

    public namedCMNodeMap getCMElements();

    public boolean removeCMNode(CMNode node);

    public boolean insertbeforeCMNode(CMNode newnode, 
                                      CMNode parentnode);

}

org/w3c/dom/contentModel/CMNode.java:

package org.w3c.dom.contentModel;

public interface CMNode {
    public CMType getCMNodeType();

}

org/w3c/dom/contentModel/ElementDeclaration.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.namedCMNodeMap;

public interface ElementDeclaration {
    public int getContentType();

    public CMElement getCMElement();

    public namedCMNodeMap getCMAttributes();

    public namedCMNodeMap getCMElementsChildren();

}

org/w3c/dom/contentModel/CMElement.java:

package org.w3c.dom.contentModel;

public interface CMElement {
    public CMElement setCMElementCardinality(CMNode node, 
                                             int high, 
                                             int low);

    public CMElement getCMElementCardinality(CMNode node, 
                                             int high, 
                                             int low);

}

org/w3c/dom/contentModel/NodeCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.Node;
import org.w3c.dom.DOMException;

public interface NodeCM extends Node {
    public boolean canInsertBefore(Node newChild, 
                                   Node refChild)
                                   throws DOMException;

    public boolean canRemoveChild(Node oldChild)
                                  throws DOMException;

    public boolean canReplaceChild(Node newChild, 
                                   Node oldChild)
                                   throws DOMException;

    public boolean canAppendChild(Node newChild)
                                  throws DOMException;

}

org/w3c/dom/contentModel/ElementCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.Node;
import org.w3c.dom.Element;

public interface ElementCM extends Element {
    public boolean isValid();

    public int contentType();

    public boolean canSetAttribute(String attrname, 
                                   String attrval);

    public boolean canSetAttributeNode(Node node);

    public boolean canSetAttributeNodeNS(Node node, 
                                         String namespaceURI, 
                                         String localName);

    public boolean canSetAttributeNS(String attrname, 
                                     String attrval, 
                                     String namespaceURI, 
                                     String localName);

}

org/w3c/dom/contentModel/CharacterDataCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.Text;
import org.w3c.dom.DOMException;

public interface CharacterDataCM extends Text {
    public boolean isWhitespaceOnly();

    public boolean canSetData(int offset, 
                              String arg)
                              throws DOMException;

    public boolean canAppendData(String arg)
                                 throws DOMException;

    public boolean canReplaceData(int offset, 
                                  int count, 
                                  String arg)
                                  throws DOMException;

    public boolean canInsertData(int offset, 
                                 String arg)
                                 throws DOMException;

    public boolean canDeleteData(int offset, 
                                 String arg)
                                 throws DOMException;

}

org/w3c/dom/contentModel/DocumentTypeCM.java:

package org.w3c.dom.contentModel;

import org.w3c.dom.DocumentType;

public interface DocumentTypeCM extends DocumentType {
    public boolean isElementDefined(String elemTypeName);

    public boolean isElementDefinedNS(String elemTypeName, 
                                      String namespaceURI, 
                                      String localName);

    public boolean isAttributeDefined(String elemTypeName, 
                                      String attrName);

    public boolean isAttributeDefinedNS(String elemTypeName, 
                                        String attrName, 
                                        String namespaceURI, 
                                        String localName);

    public boolean isEntityDefined(String entName);

}

org/w3c/dom/loadSave/DOMImplementationLS.java:

package org.w3c.dom.loadSave;

public interface DOMImplementationLS {
    public DOMBuilder createDOMBuilder();

    public DOMWriter createDOMWriter();

}

org/w3c/dom/loadSave/DOMBuilder.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.DOMErrorHandler;
import org.w3c.dom.Document;
import org.w3c.dom.DOMSystemException;
import org.w3c.dom.DOMException;

public interface DOMBuilder {
    public DOMEntityResolver getEntityResolver();
    public void setEntityResolver(DOMEntityResolver entityResolver);

    public DOMErrorHandler getErrorHandler();
    public void setErrorHandler(DOMErrorHandler errorHandler);

    public DOMBuilderFilter getFilter();
    public void setFilter(DOMBuilderFilter filter);

    public void setFeature(String name, 
                           boolean state)
                           throws DOMException;

    public boolean supportsFeature(String name);

    public boolean canSetFeature(String name, 
                                 boolean state);

    public boolean getFeature(String name)
                              throws DOMException;

    public Document parseURI(String uri)
                             throws DOMException, DOMSystemException;

    public Document parseDOMInputSource(DOMInputSource is)
                                        throws DOMException, DOMSystemException;

}

org/w3c/dom/loadSave/DOMInputSource.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.DOMString ;
import org.w3c.dom.DOMReader;
import org.w3c.dom.DOMInputStream;

public interface DOMInputSource {
    public DOMInputStream getByteStream();
    public void setByteStream(DOMInputStream byteStream);

    public DOMReader getCharacterStream();
    public void setCharacterStream(DOMReader characterStream);

    public DOMString  getEncoding();
    public void setEncoding(DOMString  encoding);

    public DOMString  getPublicId();
    public void setPublicId(DOMString  publicId);

    public DOMString  getSystemId();
    public void setSystemId(DOMString  systemId);

}

org/w3c/dom/loadSave/DOMEntityResolver.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.DOMSystemException;

public interface DOMEntityResolver {
    public DOMInputSource resolveEntity(String publicId, 
                                        String systemId )
                                        throws DOMSystemException;

}

org/w3c/dom/loadSave/DOMBuilderFilter.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.Element;

public interface DOMBuilderFilter {
    public boolean endElement(Element element);

}

org/w3c/dom/loadSave/DOMWriter.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.DOMOutputStream;
import org.w3c.dom.Node;
import org.w3c.dom.TreeWalker;
import org.w3c.dom.DOMSystemException;

public interface DOMWriter {
    public DOMFormatter getFormatter();
    public void setFormatter(DOMFormatter formatter);

    public void writeNode(DOMOutputStream destination, 
                          Node node)
                          throws DOMSystemException;

    public void writeTreeWalker(DOMOutputStream destination, 
                                TreeWalker tree)
                                throws DOMSystemException;

    public void writeString(DOMOutputStream destination, 
                            String aString)
                            throws DOMSystemException;

}

org/w3c/dom/loadSave/DOMFormatter.java:

package org.w3c.dom.loadSave;

import org.w3c.dom.DOMOutputStream;
import org.w3c.dom.Node;
import org.w3c.dom.TreeWalker;
import org.w3c.dom.DOMSystemException;

public interface DOMFormatter {
    public String getEncoding();
    public void setEncoding(String encoding);

    public String getLastEncoding();

    public String getSubstituteChars();
    public void setSubstituteChars(String substituteChars);

    public short getFormat();
    public void setFormat(short format);

    public void formatNode(Node rootNode, 
                           DOMOutputStream destination)
                           throws DOMSystemException;

    public void formatTreeWalker(TreeWalker tree, 
                                 DOMOutputStream destination)
                                 throws DOMSystemException;

}