KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > GenericAttrNS


1 /*
2
3    Copyright 2000 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.dom;
19
20 import org.w3c.dom.DOMException JavaDoc;
21 import org.w3c.dom.Node JavaDoc;
22
23 /**
24  * This class implements the {@link org.w3c.dom.Attr} interface with
25  * support for namespaces.
26  *
27  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
28  * @version $Id: GenericAttrNS.java,v 1.4 2004/08/18 07:13:07 vhardy Exp $
29  */

30 public class GenericAttrNS extends AbstractAttrNS {
31     /**
32      * Is this attribute immutable?
33      */

34     protected boolean readonly;
35
36     /**
37      * Creates a new Attr object.
38      */

39     protected GenericAttrNS() {
40     }
41
42     /**
43      * Creates a new Attr object.
44      * @param nsURI The element namespace URI.
45      * @param qname The attribute qualified name for validation purposes.
46      * @param owner The owner document.
47      * @exception DOMException
48      * INVALID_CHARACTER_ERR: Raised if the specified qualified name
49      * contains an illegal character.
50      * <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
51      * malformed, if the <code>qualifiedName</code> has a prefix and the
52      * <code>namespaceURI</code> is <code>null</code> or an empty string,
53      * if the <code>qualifiedName</code> has a prefix that is "xml" and the
54      * <code>namespaceURI</code> is different from
55      * "http://www.w3.org/XML/1998/namespace", if the
56      * <code>qualifiedName</code> has a prefix that is "xmlns" and the
57      * <code>namespaceURI</code> is different from
58      * "http://www.w3.org/2000/xmlns/", or if the <code>qualifiedName</code>
59      * is "xmlns" and the <code>namespaceURI</code> is different from
60      * "http://www.w3.org/2000/xmlns/".
61      */

62     public GenericAttrNS(String JavaDoc nsURI, String JavaDoc qname, AbstractDocument owner)
63     throws DOMException JavaDoc {
64     super(nsURI, qname, owner);
65     setNodeName(qname);
66     }
67
68     /**
69      * Tests whether this node is readonly.
70      */

71     public boolean isReadonly() {
72     return readonly;
73     }
74
75     /**
76      * Sets this node readonly attribute.
77      */

78     public void setReadonly(boolean v) {
79     readonly = v;
80     }
81
82     /**
83      * Returns a new uninitialized instance of this object's class.
84      */

85     protected Node JavaDoc newNode() {
86         return new GenericAttrNS();
87     }
88 }
89
Popular Tags