01: /* Generated by Together */
02:
03: package com.rimfaxe.xml.xmlreader.xpath;
04:
05: /** A node test for an element with a particular tagname.
06:
07: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
08: This file is part of Sparta, an XML Parser, DOM, and XPath library.
09: This library is free software; you can redistribute it and/or
10: modify it under the terms of the <a href="doc-files/LGPL.txt">GNU
11: Lesser General Public License</a> as published by the Free Software
12: Foundation; either version 2.1 of the License, or (at your option)
13: any later version. This library is distributed in the hope that it
14: will be useful, but WITHOUT ANY WARRANTY; without even the implied
15: warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16: PURPOSE. </small></blockquote>
17: @version $Date: 2002/12/06 23:41:49 $ $Revision: 1.2 $
18: @author Eamonn O'Brien-Strain
19: */
20: public class AttrTest extends NodeTest {
21:
22: AttrTest(String attrName) {
23: attrName_ = attrName;
24: }
25:
26: public void accept(Visitor visitor) {
27: visitor.visit(this );
28: }
29:
30: /** Return true*/
31: public boolean isStringValue() {
32: return true;
33: }
34:
35: public String getAttrName() {
36: return attrName_;
37: }
38:
39: public String toString() {
40: return "@" + attrName_;
41: }
42:
43: private final String attrName_;
44: }
45:
46: // $Log: AttrTest.java,v $
47: // Revision 1.2 2002/12/06 23:41:49 eobrain
48: // Add toString() which returns the original XPath.
49: //
50: // Revision 1.1.1.1 2002/08/19 05:04:05 eobrain
51: // import from HP Labs internal CVS
52: //
53: // Revision 1.3 2002/08/18 23:38:24 eob
54: // Add copyright and other formatting and commenting in preparation for
55: // release to SourceForge.
56: //
57: // Revision 1.2 2002/06/14 19:39:17 eob
58: // Make test for isStringValue more object-oriented. Avoid "instanceof".
59: //
60: // Revision 1.1 2002/02/04 21:35:35 eob
61: // initial
|