001: /*
002: * Copyright (c) 2001 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE.
010: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011: */
012:
013: package org.apache.xerces.dom3.as;
014:
015: import org.w3c.dom.Node;
016: import org.w3c.dom.NodeList;
017: import org.w3c.dom.Attr;
018:
019: /**
020: * @deprecated
021: * This interface extends the <code>Element</code> interface with additional
022: * methods for guided document editing. An object implementing this
023: * interface must also implement NodeEditAS interface.
024: * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Load
025: and Save Specification</a>.
026: */
027: public interface ElementEditAS extends NodeEditAS {
028: /**
029: * The list of qualified element names defined in the abstract schema.
030: */
031: public NodeList getDefinedElementTypes();
032:
033: /**
034: * Determines element content type.
035: * @return Constant for one of EMPTY_CONTENTTYPE, ANY_CONTENTTYPE,
036: * MIXED_CONTENTTYPE, ELEMENTS_CONTENTTYPE.
037: */
038: public short contentType();
039:
040: /**
041: * Determines if the value for specified attribute can be set.
042: * @param attrname Name of attribute.
043: * @param attrval Value to be assigned to the attribute.
044: * @return <code>true</code> if no reason it can't be done;
045: * <code>false</code> if it can't be done.
046: */
047: public boolean canSetAttribute(String attrname, String attrval);
048:
049: /**
050: * Determines if an attribute node can be added with respect to the
051: * validity check level.This is an attribute node, there is no need for
052: * canSetAttributreNodeNS!
053: * @param attrNode <code>Node</code> in which the attribute can possibly
054: * be set.
055: * @return <code>true</code> if no reason it can't be done;
056: * <code>false</code> if it can't be done.
057: */
058: public boolean canSetAttributeNode(Attr attrNode);
059:
060: /**
061: * Determines if the attribute with given namespace and qualified name can
062: * be created if not already present in the attribute list of the
063: * element. If the attribute with same qualified name and namespaceURI
064: * is already present in the elements attribute list it tests for the
065: * value of the attribute and its prefix to the new value. See DOM core
066: * <code>setAttributeNS</code>.
067: * @param name Qualified name of attribute.
068: * @param attrval Value to be assigned to the attribute.
069: * @param namespaceURI <code>namespaceURI</code> of namespace.
070: * @return <code>true</code> if no reason it can't be done;
071: * <code>false</code> if it can't be done.
072: */
073: public boolean canSetAttributeNS(String name, String attrval,
074: String namespaceURI);
075:
076: /**
077: * Verifies if an attribute by the given name can be removed.
078: * @param attrname Name of attribute.
079: * @return <code>true</code> if no reason it can't be done;
080: * <code>false</code> if it can't be done.
081: */
082: public boolean canRemoveAttribute(String attrname);
083:
084: /**
085: * Verifies if an attribute by the given local name and namespace can be
086: * removed.
087: * @param attrname Local name of the attribute to be removed.
088: * @param namespaceURI The namespace URI of the attribute to remove.
089: * @return <code>true</code> if no reason it can't be done;
090: * <code>false</code> if it can't be done.
091: */
092: public boolean canRemoveAttributeNS(String attrname,
093: String namespaceURI);
094:
095: /**
096: * Determines if an attribute node can be removed.
097: * @param attrNode The <code>Attr</code> node to remove from the
098: * attribute list.
099: * @return <code>true</code> if no reason it can't be done;
100: * <code>false</code> if it can't be done.
101: */
102: public boolean canRemoveAttributeNode(Node attrNode);
103:
104: /**
105: * Returns an <code>NodeList</code> containing the possible
106: * <code>Element</code> names that can appear as children of this type
107: * of element.
108: * @return List of possible children element types of this element.
109: */
110: public NodeList getChildElements();
111:
112: /**
113: * Returns an <code>NodeList</code> containing the possible
114: * <code>Element</code> names that can appear as a parent of this type
115: * of element.
116: * @return List of possible parent element types of this element.
117: */
118: public NodeList getParentElements();
119:
120: /**
121: * Returns an <code>NodeList</code> containing all the possible
122: * <code>Attr</code>s that can appear with this type of element.
123: * @return List of possible attributes of this element.
124: */
125: public NodeList getAttributeList();
126:
127: /**
128: * Determines if this element is defined in the currently active AS.
129: * @param elemTypeName Name of element.
130: * @return A boolean that is <code>true</code> if the element is defined,
131: * <code>false</code> otherwise.
132: */
133: public boolean isElementDefined(String elemTypeName);
134:
135: /**
136: * Determines if this element in this namespace is defined in the
137: * currently active AS.
138: * @param elemTypeName Name of element.
139: * @param namespaceURI <code>namespaceURI</code> of namespace.
140: * @param name Qualified name of namespace. This is for sub-elements.
141: * @return A boolean that is <code>true</code> if the element is defined,
142: * <code>false</code> otherwise.
143: */
144: public boolean isElementDefinedNS(String elemTypeName,
145: String namespaceURI, String name);
146:
147: }
|