01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.xml.client.impl;
17:
18: import com.google.gwt.core.client.JavaScriptObject;
19: import com.google.gwt.xml.client.Attr;
20:
21: /**
22: * This class implements the XML Attr interface.
23: */
24: class AttrImpl extends NodeImpl implements Attr {
25: protected AttrImpl(JavaScriptObject o) {
26: super (o);
27: }
28:
29: /**
30: * This function delegates to the native method <code>getName</code> in
31: * XMLParserImpl.
32: */
33: public String getName() {
34: return XMLParserImpl.getName(this .getJsObject());
35: }
36:
37: /**
38: * This function delegates to the native method <code>getSpecified</code> in
39: * XMLParserImpl.
40: */
41: public boolean getSpecified() {
42: return XMLParserImpl.getSpecified(this .getJsObject());
43: }
44:
45: /**
46: * This function delegates to the native method <code>getValue</code> in
47: * XMLParserImpl.
48: */
49: public String getValue() {
50: return XMLParserImpl.getValue(this .getJsObject());
51: }
52:
53: /**
54: * This method returns the string representation of this <code>Attr</code>.
55: * @return the string representation of this <code>Attr</code>.
56: * @see java.lang.Object#toString()
57: */
58: @Override
59: public String toString() {
60: final StringBuffer b = new StringBuffer();
61: b.append(" " + getName());
62: b.append("=\"");
63: b.append(getValue());
64: b.append("\"");
65: return b.toString();
66: }
67: }
|