01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.xerces.impl.xs.opti;
19:
20: import org.w3c.dom.TypeInfo;
21: import org.w3c.dom.Attr;
22: import org.w3c.dom.Node;
23: import org.w3c.dom.Element;
24:
25: import org.w3c.dom.DOMException;
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 446728 2006-09-15 20:43:46Z mrglavas $
35: */
36: public class AttrImpl extends NodeImpl implements Attr {
37:
38: Element element;
39: String value;
40:
41: /** Default Constructor */
42: public AttrImpl() {
43: nodeType = Node.ATTRIBUTE_NODE;
44: }
45:
46: /**
47: * Constructs an attribute.
48: *
49: * @param element Element which owns this attribute
50: * @param prefix The QName prefix.
51: * @param localpart The QName localpart.
52: * @param rawname The QName rawname.
53: * @param uri The uri binding for the associated prefix.
54: * @param value The value of the attribute.
55: */
56: public AttrImpl(Element element, String prefix, String localpart,
57: String rawname, String uri, String value) {
58: super (prefix, localpart, rawname, uri, Node.ATTRIBUTE_NODE);
59: this .element = element;
60: this .value = value;
61: }
62:
63: public String getName() {
64: return rawname;
65: }
66:
67: public boolean getSpecified() {
68: return true;
69: }
70:
71: public String getValue() {
72: return value;
73: }
74:
75: public Element getOwnerElement() {
76: return element;
77: }
78:
79: public void setValue(String value) throws DOMException {
80: this .value = value;
81: }
82:
83: /**
84: * @since DOM Level 3
85: */
86: public boolean isId() {
87: return false;
88: }
89:
90: /**
91: * Method getSchemaTypeInfo.
92: * @return TypeInfo
93: */
94: public TypeInfo getSchemaTypeInfo() {
95: return null;
96: }
97:
98: }
|