KickJava   Java API By Example, From Geeks To Geeks.

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


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.
25  *
26  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
27  * @version $Id: GenericAttr.java,v 1.4 2004/08/18 07:13:07 vhardy Exp $
28  */

29 public class GenericAttr extends AbstractAttr {
30     /**
31      * Is this attribute immutable?
32      */

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

38     protected GenericAttr() {
39     }
40
41     /**
42      * Creates a new Attr object.
43      * @param name The attribute name for validation purposes.
44      * @param owner The owner document.
45      * @exception DOMException
46      * INVALID_CHARACTER_ERR: if name contains invalid characters,
47      */

48     public GenericAttr(String JavaDoc name, AbstractDocument owner)
49         throws DOMException JavaDoc {
50     super(name, owner);
51     setNodeName(name);
52     }
53
54     /**
55      * Tests whether this node is readonly.
56      */

57     public boolean isReadonly() {
58     return readonly;
59     }
60
61     /**
62      * Sets this node readonly attribute.
63      */

64     public void setReadonly(boolean v) {
65     readonly = v;
66     }
67
68     /**
69      * Returns a new uninitialized instance of this object's class.
70      */

71     protected Node JavaDoc newNode() {
72         return new GenericAttr();
73     }
74 }
75
Popular Tags