KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > impl > xs > opti > AttrImpl


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

16
17 package org.apache.xerces.impl.xs.opti;
18
19 import org.w3c.dom.TypeInfo JavaDoc;
20 import org.w3c.dom.Attr JavaDoc;
21 import org.w3c.dom.Node JavaDoc;
22 import org.w3c.dom.Element JavaDoc;
23
24 import org.w3c.dom.DOMException JavaDoc;
25
26
27 /**
28  * This class represents a single attribute.
29  *
30  * @xerces.internal
31  *
32  * @author Rahul Srivastava, Sun Microsystems Inc.
33  *
34  * @version $Id: AttrImpl.java,v 1.8 2005/05/02 22:00:52 mrglavas Exp $
35  */

36 public class AttrImpl extends NodeImpl
37                       implements Attr JavaDoc {
38
39     Element JavaDoc element;
40     String JavaDoc value;
41     
42     /** Default Constructor */
43     public AttrImpl() {
44         nodeType = Node.ATTRIBUTE_NODE;
45     }
46     
47     /**
48      * Constructs an attribute.
49      *
50      * @param element Element which owns this attribute
51      * @param prefix The QName prefix.
52      * @param localpart The QName localpart.
53      * @param rawname The QName rawname.
54      * @param uri The uri binding for the associated prefix.
55      * @param value The value of the attribute.
56      */

57     public AttrImpl(Element JavaDoc element, String JavaDoc prefix, String JavaDoc localpart, String JavaDoc rawname, String JavaDoc uri, String JavaDoc value) {
58         super(prefix, localpart, rawname, uri, Node.ATTRIBUTE_NODE);
59         this.element = element;
60         this.value = value;
61     }
62     
63     
64     public String JavaDoc getName() {
65         return rawname;
66     }
67     
68     
69     public boolean getSpecified() {
70         return true;
71     }
72     
73     public String JavaDoc getValue() {
74         return value;
75     }
76     
77     
78     public Element JavaDoc getOwnerElement() {
79         return element;
80     }
81     
82     
83     public void setValue(String JavaDoc value) throws DOMException JavaDoc {
84         this.value = value;
85     }
86     
87     /**
88      * @since DOM Level 3
89      */

90     public boolean isId(){
91         return false;
92     }
93     
94         /**
95      * Method getSchemaTypeInfo.
96      * @return TypeInfo
97      */

98     public TypeInfo JavaDoc getSchemaTypeInfo(){
99       return null;
100     }
101
102 }
Popular Tags