Methods Summary |
---|
public void | attribute(java.lang.String elemName, java.lang.String attrName, java.lang.String type, java.lang.String value)Add or replace a default attribute for an element type in this schema.
ElementType e = getElementType(elemName);
if (e == null) {
throw new Error("Attribute " + attrName +
" specified for unknown element type " +
elemName);
}
e.setAttribute(attrName, type, value);
|
public void | elementType(java.lang.String name, int model, int memberOf, int flags)Add or replace an element type for this schema.
ElementType e = new ElementType(name, model, memberOf, flags, this);
theElementTypes.put(name.toLowerCase(), e);
if (memberOf == M_ROOT) theRoot = e;
|
public void | entity(java.lang.String name, int value)Add to or replace a character entity in this schema.
theEntities.put(name, new Integer(value));
|
public ElementType | getElementType(java.lang.String name)Get an ElementType by name.
return (ElementType)(theElementTypes.get(name.toLowerCase()));
|
public int | getEntity(java.lang.String name)Get an entity value by name.
// System.err.println("%% Looking up entity " + name);
Integer ch = (Integer)theEntities.get(name);
if (ch == null) return 0;
return ch.intValue();
|
public java.lang.String | getPrefix()Return the prefix of this schema.
return thePrefix;
|
public java.lang.String | getURI()Return the URI (namespace name) of this schema.
return theURI;
|
public void | parent(java.lang.String name, java.lang.String parentName)Specify natural parent of an element in this schema.
ElementType child = getElementType(name);
ElementType parent = getElementType(parentName);
if (child == null) {
throw new Error("No child " + name + " for parent " + parentName);
}
if (parent == null) {
throw new Error("No parent " + parentName + " for child " + name);
}
child.setParent(parent);
|
public ElementType | rootElementType()Get the root element of this schema
return theRoot;
|
public void | setPrefix(java.lang.String prefix)Change the prefix of this schema.
thePrefix = prefix;
|
public void | setURI(java.lang.String uri)Change the URI (namespace name) of this schema.
theURI = uri;
|