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/2001/WD-DOM-Level-3-CMLS-20010209/java-binding.zip
package org.w3c.dom.contentModel;
import org.w3c.dom.nsElement;
public interface CMModel extends CMNode {
public boolean getIsNamespaceAware();
public ElementDeclaration getRootElementDecl();
public String getLocation();
public nsElement getCMNamespace();
public CMNamedNodeMap getCMNodes();
public boolean removeNode(CMNode node);
public boolean insertBefore(CMNode newNode,
CMNode refNode);
public boolean validate();
}
package org.w3c.dom.contentModel;
public interface CMExternalModel extends CMModel {
}
package org.w3c.dom.contentModel;
public interface CMNode {
public static final short ELEMENT_DECLARATION = 1;
public static final short ATTRIBUTE_DECLARATION = 2;
public static final short CM_NOTATION_DECLARATION = 3;
public static final short ENTITY_DECLARATION = 4;
public static final short CM_CHILDREN = 5;
public static final short CM_MODEL = 6;
public static final short CM_EXTERNALMODEL = 7;
public short getCmNodeType();
public CMNode cloneCM();
public CMNode cloneExternalCM();
}
package org.w3c.dom.contentModel;
public interface CMNodeList {
}
package org.w3c.dom.contentModel;
public interface CMNamedNodeMap {
}
package org.w3c.dom.contentModel;
public interface CMDataType {
public static final short STRING_DATATYPE = 1;
public static final short BOOLEAN_DATATYPE = 2;
public static final short FLOAT_DATATYPE = 3;
public static final short DOUBLE_DATATYPE = 4;
public static final short LONG_DATATYPE = 5;
public static final short INT_DATATYPE = 6;
public static final short SHORT_DATATYPE = 7;
public static final short BYTE_DATATYPE = 8;
public int getLowValue();
public void setLowValue(int lowValue);
public int getHighValue();
public void setHighValue(int highValue);
public short getPrimitiveType();
}
package org.w3c.dom.contentModel;
public interface ElementDeclaration {
public int getContentType();
public CMChildren getCMChildren();
public CMNamedNodeMap getCMAttributes();
public CMNamedNodeMap getCMGrandChildren();
}
package org.w3c.dom.contentModel;
public interface CMChildren {
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 CMNamedNodeMap getSubModels();
public void setSubModels(CMNamedNodeMap subModels);
public boolean getIsPCDataOnly();
}
package org.w3c.dom.contentModel;
public interface AttributeDeclaration {
public static final short NO_VALUE_CONSTRAINT = 0;
public static final short DEFAULT_VALUE_CONSTRAINT = 1;
public static final short FIXED_VALUE_CONSTRAINT = 2;
public String getAttrName();
public CMDataType getAttrType();
public void setAttrType(CMDataType attrType);
public String getAttributeValue();
public void setAttributeValue(String attributeValue);
public String getEnumAttr();
public void setEnumAttr(String enumAttr);
public CMNodeList getOwnerElement();
public void setOwnerElement(CMNodeList ownerElement);
public short getConstraintType();
public void setConstraintType(short constraintType);
}
package org.w3c.dom.contentModel;
public interface EntityDeclaration {
}
package org.w3c.dom.contentModel;
public interface CMNotationDeclaration {
public String getStrSystemIdentifier();
public void setStrSystemIdentifier(String strSystemIdentifier);
public String getStrPublicIdentifier();
public void setStrPublicIdentifier(String strPublicIdentifier);
}
package org.w3c.dom.contentModel;
public interface Document {
public void setErrorHandler(DOMErrorHandler handler);
}
package org.w3c.dom.contentModel;
import org.w3c.dom.CMExternalModel *;
public interface DocumentCM extends Document {
public int numCMs();
public CMModel getInternalCM();
public CMExternalModel * getCMs();
public CMModel getActiveCM();
public void addCM(CMModel cm);
public void removeCM(CMModel cm);
public boolean activateCM(CMModel cm);
}
package org.w3c.dom.contentModel;
import org.w3c.dom.DOMImplementation;
public interface DOMImplementationCM extends DOMImplementation {
public CMModel createCM();
public CMExternalModel createExternalCM();
}
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;
public boolean isValid();
}
package org.w3c.dom.contentModel;
import org.w3c.dom.Node;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
public interface ElementCM extends Element {
public int contentType();
public ElementDeclaration getElementDeclaration()
throws DOMException;
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);
}
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;
}
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);
}
package org.w3c.dom.contentModel;
import org.w3c.dom.DOMException;
public interface AttributeCM {
public AttributeDeclaration getAttributeDeclaration();
public CMNotationDeclaration getNotation()
throws DOMException;
}
package org.w3c.dom.contentModel;
import org.w3c.dom.DOMSystemException;
public interface DOMErrorHandler {
public void warning(DOMLocator where,
String how,
String why)
throws DOMSystemException;
public void fatalError(DOMLocator where,
String how,
String why)
throws DOMSystemException;
public void error(DOMLocator where,
String how,
String why)
throws DOMSystemException;
}
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();
}
package org.w3c.dom.loadSave;
public interface DOMImplementationLS {
public DOMBuilder createDOMBuilder();
public DOMWriter createDOMWriter();
}
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;
}
package org.w3c.dom.loadSave;
public interface DOMInputSource {
public java.io.InputStream getByteStream();
public void setByteStream(java.io.InputStream byteStream);
public java.io.Reader getCharacterStream();
public void setCharacterStream(java.io.Reader characterStream);
public String getEncoding();
public void setEncoding(String encoding);
public String getPublicId();
public void setPublicId(String publicId);
public String getSystemId();
public void setSystemId(String systemId);
}
package org.w3c.dom.loadSave;
import org.w3c.dom.DOMSystemException;
public interface DOMEntityResolver {
public DOMInputSource resolveEntity(String publicId,
String systemId )
throws DOMSystemException;
}
package org.w3c.dom.loadSave;
import org.w3c.dom.Element;
public interface DOMBuilderFilter {
public boolean endElement(Element element);
}
package org.w3c.dom.loadSave;
import org.w3c.dom.Node;
import org.w3c.dom.DOMSystemException;
public interface DOMWriter {
public String getEncoding();
public void setEncoding(String encoding);
public String getLastEncoding();
public short getFormat();
public void setFormat(short format);
public String getNewLine();
public void setNewLine(String newLine);
public void writeNode(java.io.OutputStream destination,
Node node)
throws DOMSystemException;
}