This appendix contains the complete Java [Java] bindings for the Level 3 Document Object Model Abstract Schemas.
The Java files are also available as http://www.w3.org/TR/2002/WD-DOM-Level-3-AS-20020725/java-binding.zip
package org.w3c.dom.as;
public class ASException extends RuntimeException {
public ASException(short code, String message) {
super(message);
this.code = code;
}
public short code;
// ASExceptionCode
public static final short DUPLICATE_NAME_ERR = 1;
public static final short TYPE_ERR = 2;
public static final short NO_AS_AVAILABLE = 3;
public static final short WRONG_MIME_TYPE_ERR = 4;
public static final short INVALID_CHARACTER_ERR = 5;
public static final short VALIDATION_ERR = 6;
public static final short ACTIVEAS_DELETION_ERR = 7;
}
package org.w3c.dom.as;
public interface ASConstants {
// ASObject Types
public static final short ELEMENT_DECLARATION = 1;
public static final short ATTRIBUTE_DECLARATION = 2;
public static final short NOTATION_DECLARATION = 3;
public static final short ENTITY_DECLARATION = 4;
public static final short CONTENT_MODEL = 5;
public static final short SCHEMA_MODEL = 6;
// Schema Model types
public static final short INTERNAL_SUBSET = 30;
public static final short EXTERNAL_SUBSET = 31;
public static final short NOT_USED = 32;
// Entity Types
public static final short INTERNAL_ENTITY = 33;
public static final short EXTERNAL_ENTITY = 34;
// Content Model Types
public static final short EMPTY_CONTENTTYPE = 40;
public static final short SIMPLE_CONTENTTYPE = 41;
public static final short ELEMENT_CONTENTTYPE = 42;
public static final short MIXED_CONTENTTYPE = 43;
public static final short ANY_CONTENTTYPE = 44;
// Content model compositors
public static final short SEQUENCE_CM = 50;
public static final short CHOICE_CM = 51;
public static final short ALL_CM = 52;
public static final short UNDEFINED_CM = 53;
public static final short ATOMIC_CM = 54;
// Value Constraint
public static final short NONE_VC = 0;
public static final short DEFAULT_VC = 60;
public static final short FIXED_VC = 61;
public static final short REQUIRED_VC = 62;
// Definition of unbounded
public static final int UNBOUNDED = MAX_VALUE;
}
package org.w3c.dom.as;
public interface ASObject {
public short getObjectType();
public ASModel getOwnerModel();
public String getRawname();
public String getName();
public String getNamespace();
public ASObject cloneASObject(boolean deep)
throws ASException;
}
package org.w3c.dom.as;
public interface ASDataType {
public short getDataType();
// DATA_TYPES
public static final short STRING_DATATYPE = 1;
public static final short NOTATION_DATATYPE = 10;
public static final short ID_DATATYPE = 11;
public static final short IDREF_DATATYPE = 12;
public static final short IDREFS_DATATYPE = 13;
public static final short ENTITY_DATATYPE = 14;
public static final short ENTITIES_DATATYPE = 15;
public static final short NMTOKEN_DATATYPE = 16;
public static final short NMTOKENS_DATATYPE = 17;
public static final short BOOLEAN_DATATYPE = 100;
public static final short FLOAT_DATATYPE = 101;
public static final short DOUBLE_DATATYPE = 102;
public static final short DECIMAL_DATATYPE = 103;
public static final short HEXBINARY_DATATYPE = 104;
public static final short BASE64BINARY_DATATYPE = 105;
public static final short ANYURI_DATATYPE = 106;
public static final short QNAME_DATATYPE = 107;
public static final short DURATION_DATATYPE = 108;
public static final short DATETIME_DATATYPE = 109;
public static final short DATE_DATATYPE = 110;
public static final short TIME_DATATYPE = 111;
public static final short GYEARMONTH_DATATYPE = 112;
public static final short GYEAR_DATATYPE = 113;
public static final short GMONTHDAY_DATATYPE = 114;
public static final short GDAY_DATATYPE = 115;
public static final short GMONTH_DATATYPE = 116;
public static final short INTEGER = 117;
public static final short NAME_DATATYPE = 200;
public static final short NCNAME_DATATYPE = 201;
public static final short NORMALIZEDSTRING_DATATYPE = 202;
public static final short TOKEN_DATATYPE = 203;
public static final short LANGUAGE_DATATYPE = 204;
public static final short NONPOSITIVEINTEGER_DATATYPE = 205;
public static final short NEGATIVEINTEGER_DATATYPE = 206;
public static final short LONG_DATATYPE = 207;
public static final short INT_DATATYPE = 208;
public static final short SHORT_DATATYPE = 209;
public static final short BYTE_DATATYPE = 210;
public static final short NONNEGATIVEINTEGER_DATATYPE = 211;
public static final short UNSIGNEDLONG_DATATYPE = 212;
public static final short UNSIGNEDINT_DATATYPE = 213;
public static final short UNSIGNEDSHORT_DATATYPE = 214;
public static final short UNSIGNEDBYTE_DATATYPE = 215;
public static final short POSITIVEINTEGER_DATATYPE = 216;
public static final short ANYSIMPLETYPE_DATATYPE = 216;
public static final short ANYTYPE_DATATYPE = 216;
}
package org.w3c.dom.as;
public interface ASObjectList {
public int getLength();
public ASObject item(int index);
}
package org.w3c.dom.as;
public interface ASNamedObjectMap {
public int getLength();
public ASObject item(int index);
public ASObject getNamedItem(String name);
public ASObject getNamedItemNS(String namespaceURI,
String localName);
}
package org.w3c.dom.as;
public interface ASModel extends ASObject {
public boolean getNamespaceAware();
public short getUsage();
public String getLocation();
public String getHint();
public boolean getContainer();
public ASNamedObjectMap getComponents(short objectType);
// Convenience method to retrive named top-level declarations
public ASElementDecl getElementDecl(String name,
String targetNamespace);
public ASAttributeDecl getAttributeDecl(String name,
String targetNamespace);
public ASEntityDecl getEntityDecl(String name);
public ASNotationDecl getNotationDecl(String name,
String targetNamespace);
}
package org.w3c.dom.as;
public interface ASContentModel extends ASObject {
public short getContentModelType();
public int getMinOccurs();
public int getMaxOccurs();
public ASObjectList getSubModels();
}
package org.w3c.dom.as;
public interface ASElementDecl extends ASObject {
public ASDataType getType();
public short getContentType();
public boolean getStrictMixedContent();
public ASContentModel getContentModel();
public boolean getIsPCDataOnly();
public ASNamedObjectMap getAttributeDecls();
public ASAttributeDecl getAttributeDecl(String name,
String targetNamespace);
}
package org.w3c.dom.as;
public interface ASAttributeDecl extends ASObject {
public ASDataType getType();
public String getEnumAttr();
public ASObjectList getOwnerElementDeclarations();
public short getDefaultType();
public String getValue();
}
package org.w3c.dom.as;
public interface ASEntityDecl extends ASObject {
public short getEntityType();
public String getEntityValue();
public String getSystemId();
public String getPublicId();
}
package org.w3c.dom.as;
public interface ASNotationDecl extends ASObject {
public String getSystemId();
public String getPublicId();
}
package org.w3c.dom.as;
public interface ASWModel extends ASModel {
public void setLocation(String location);
public void setHint(String hint);
public void addComponent(ASObject declaration);
public void removeComponent(ASObject declaration);
public void addASModel(ASModel declaration);
public void removeASModel(ASModel declaration);
public ASObjectList getASModels();
public ASObject importASObject(ASObject asobject);
public void insertASObject(ASObject asobject);
public boolean validate();
public ASWElementDecl createASWElementDecl(String namespaceURI,
String name)
throws ASException;
public ASWAttributeDecl createASWAttributeDecl(String namespaceURI,
String name)
throws ASException;
public ASWNotationDecl createASWNotationDecl(String namespaceURI,
String name,
String systemId,
String publicId)
throws ASException;
public ASWEntityDecl createASWEntityDecl(String name)
throws ASException;
public ASWContentModel createASWContentModel(String name,
String namespaceURI,
int minOccurs,
int maxOccurs,
short operator)
throws ASException;
}
package org.w3c.dom.as;
import org.w3c.dom.DOMException;
public interface ASWNamedObjectMap extends ASNamedObjectMap {
public ASObject removeNamedItem(String name)
throws ASException;
public ASObject setNamedItem(ASObject newASObject)
throws ASException, ASException;
public ASObject setNamedItemNS(ASObject arg)
throws ASException;
public ASObject removeNamedItemNS(String namespaceURI,
String localName)
throws DOMException;
}
package org.w3c.dom.as;
public interface ASWElementDecl extends ASElementDecl {
public void setRawname(String rawname);
public void setName(String name);
public void setNamespace(String namespaceURI);
public void setStrictMixedContent(boolean mixedContent);
public void setType(ASDataType type);
public void setContentType(short contentType);
public void setContentModel(ASWContentModel contentModel);
public void addAttributeDecl(ASWAttributeDecl attributeDecl);
public ASWAttributeDecl removeAttributeDecl(ASWAttributeDecl attributeDecl);
}
package org.w3c.dom.as;
public interface ASWContentModel extends ASContentModel {
public void setName(String name);
public void setNamespaceURI(String namespaceURI);
public void setContentModelType(short operator);
public void setMinOccurs(int minOccurs);
public void setMaxOccurs(int maxOccurs);
public void removeSubModel(ASObject oldObject);
public ASObject insertBeforeSubModel(ASObject newObject,
ASObject refObject)
throws ASException;
public int appendSubModel(ASObject newObject)
throws ASException;
}
package org.w3c.dom.as;
public interface ASWAttributeDecl extends ASAttributeDecl {
public void setRawname(String rawname);
public void setName(String name);
public void setNamespaceURI(String namespaceURI);
public void setType(ASDataType type);
public void setValue(String value);
public void setEnumAttr(String enumeration);
public void setDefaultType(short constraint);
}
package org.w3c.dom.as;
public interface ASWEntityDecl extends ASEntityDecl {
public void setRawname(String rawname);
public void setEntityType(short type);
public void setEntityValue(String value);
public void setSystemId(String systemId);
public void setPublicId(String publicId);
}
package org.w3c.dom.as;
public interface ASWNotationDecl extends ASNotationDecl {
public void setRawname(String rawname);
public void setName(String name);
public void setNamespaceURI(String namespaceURI);
public void setSystemId(String systemId);
public void setPublicId(String publicId);
}
package org.w3c.dom.as;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.DOMException;
import org.w3c.dom.Notation;
import org.w3c.dom.Attr;
import org.w3c.dom.Entity;
public interface DocumentAS extends Document {
public ASModel getActiveASModel();
public void setActiveASModel(ASModel activeASModel);
public ASObjectList getBoundASModels();
public void setBoundASModels(ASObjectList boundASModels);
public ASModel getInternalAS();
public void setInternalAS(ASModel as)
throws DOMException;
public void addAS(ASModel as);
public void removeAS(ASModel as)
throws ASException;
public ASElementDecl getElementDecl(Element node)
throws DOMException;
public ASAttributeDecl getAttributeDecl(Attr node)
throws DOMException;
public ASEntityDecl getEntityDecl(Entity node)
throws DOMException;
public ASNotationDecl getNotationDecl(Notation node)
throws DOMException;
public void validate()
throws ASException;
}
package org.w3c.dom.as;
import org.w3c.dom.DOMImplementation;
public interface DOMImplementationAS extends DOMImplementation {
public ASWModel createASWModel(boolean isNamespaceAware,
boolean container,
String schemaType);
}
package org.w3c.dom.as;
import org.w3c.dom.ls.DOMInputSource;
import org.w3c.dom.ls.DOMBuilder;
public interface ASDOMBuilder extends DOMBuilder {
public ASWModel getAbstractSchema();
public void setAbstractSchema(ASWModel abstractSchema);
public ASWModel parseASURI(String uri,
String schemaType)
throws ASException, Exception;
public ASWModel parseASInputSource(DOMInputSource is,
String schemaType)
throws ASException, Exception;
}
package org.w3c.dom.as;
import org.w3c.dom.ls.DOMWriter;
public interface ASDOMWriter extends DOMWriter {
public void writeASModel(java.io.OutputStream destination,
ASModel model)
throws Exception;
}