KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > dom3 > as > ElementEditAS


1 /*
2  * Copyright (c) 2001 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  */

12
13 package com.sun.org.apache.xerces.internal.dom3.as;
14
15 import org.w3c.dom.Node JavaDoc;
16 import org.w3c.dom.NodeList JavaDoc;
17 import org.w3c.dom.Attr JavaDoc;
18
19 /**
20  * @deprecated
21  * This interface extends the <code>Element</code> interface with additional
22  * methods for guided document editing. An object implementing this
23  * interface must also implement NodeEditAS interface.
24  * <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
25 and Save Specification</a>.
26  */

27 public interface ElementEditAS extends NodeEditAS {
28     /**
29      * The list of qualified element names defined in the abstract schema.
30      */

31     public NodeList JavaDoc getDefinedElementTypes();
32
33     /**
34      * Determines element content type.
35      * @return Constant for one of EMPTY_CONTENTTYPE, ANY_CONTENTTYPE,
36      * MIXED_CONTENTTYPE, ELEMENTS_CONTENTTYPE.
37      */

38     public short contentType();
39
40     /**
41      * Determines if the value for specified attribute can be set.
42      * @param attrname Name of attribute.
43      * @param attrval Value to be assigned to the attribute.
44      * @return <code>true</code> if no reason it can't be done;
45      * <code>false</code> if it can't be done.
46      */

47     public boolean canSetAttribute(String JavaDoc attrname,
48                                    String JavaDoc attrval);
49
50     /**
51      * Determines if an attribute node can be added with respect to the
52      * validity check level.This is an attribute node, there is no need for
53      * canSetAttributreNodeNS!
54      * @param attrNode <code>Node</code> in which the attribute can possibly
55      * be set.
56      * @return <code>true</code> if no reason it can't be done;
57      * <code>false</code> if it can't be done.
58      */

59     public boolean canSetAttributeNode(Attr JavaDoc attrNode);
60
61     /**
62      * Determines if the attribute with given namespace and qualified name can
63      * be created if not already present in the attribute list of the
64      * element. If the attribute with same qualified name and namespaceURI
65      * is already present in the elements attribute list it tests for the
66      * value of the attribute and its prefix to the new value. See DOM core
67      * <code>setAttributeNS</code>.
68      * @param name Qualified name of attribute.
69      * @param attrval Value to be assigned to the attribute.
70      * @param namespaceURI <code>namespaceURI</code> of namespace.
71      * @return <code>true</code> if no reason it can't be done;
72      * <code>false</code> if it can't be done.
73      */

74     public boolean canSetAttributeNS(String JavaDoc name,
75                                      String JavaDoc attrval,
76                                      String JavaDoc namespaceURI);
77
78     /**
79      * Verifies if an attribute by the given name can be removed.
80      * @param attrname Name of attribute.
81      * @return <code>true</code> if no reason it can't be done;
82      * <code>false</code> if it can't be done.
83      */

84     public boolean canRemoveAttribute(String JavaDoc attrname);
85
86     /**
87      * Verifies if an attribute by the given local name and namespace can be
88      * removed.
89      * @param attrname Local name of the attribute to be removed.
90      * @param namespaceURI The namespace URI of the attribute to remove.
91      * @return <code>true</code> if no reason it can't be done;
92      * <code>false</code> if it can't be done.
93      */

94     public boolean canRemoveAttributeNS(String JavaDoc attrname,
95                                         String JavaDoc namespaceURI);
96
97     /**
98      * Determines if an attribute node can be removed.
99      * @param attrNode The <code>Attr</code> node to remove from the
100      * attribute list.
101      * @return <code>true</code> if no reason it can't be done;
102      * <code>false</code> if it can't be done.
103      */

104     public boolean canRemoveAttributeNode(Node JavaDoc attrNode);
105
106     /**
107      * Returns an <code>NodeList</code> containing the possible
108      * <code>Element</code> names that can appear as children of this type
109      * of element.
110      * @return List of possible children element types of this element.
111      */

112     public NodeList JavaDoc getChildElements();
113
114     /**
115      * Returns an <code>NodeList</code> containing the possible
116      * <code>Element</code> names that can appear as a parent of this type
117      * of element.
118      * @return List of possible parent element types of this element.
119      */

120     public NodeList JavaDoc getParentElements();
121
122     /**
123      * Returns an <code>NodeList</code> containing all the possible
124      * <code>Attr</code>s that can appear with this type of element.
125      * @return List of possible attributes of this element.
126      */

127     public NodeList JavaDoc getAttributeList();
128
129     /**
130      * Determines if this element is defined in the currently active AS.
131      * @param elemTypeName Name of element.
132      * @return A boolean that is <code>true</code> if the element is defined,
133      * <code>false</code> otherwise.
134      */

135     public boolean isElementDefined(String JavaDoc elemTypeName);
136
137     /**
138      * Determines if this element in this namespace is defined in the
139      * currently active AS.
140      * @param elemTypeName Name of element.
141      * @param namespaceURI <code>namespaceURI</code> of namespace.
142      * @param name Qualified name of namespace. This is for sub-elements.
143      * @return A boolean that is <code>true</code> if the element is defined,
144      * <code>false</code> otherwise.
145      */

146     public boolean isElementDefinedNS(String JavaDoc elemTypeName,
147                                       String JavaDoc namespaceURI,
148                                       String JavaDoc name);
149
150 }
151
Popular Tags