01: package com.rimfaxe.xml.xmlreader.xpath;
02:
03: /**
04: * A "text()" node test in a Xpath step.
05: * This is part of the GoF Flyweight(195) pattern -- Only one object of
06: * this class ever exists, shared amongst all clients.
07: * You use INSTANCE instead of the constructor to get
08: * that object.
09:
10: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
11: This file is part of Sparta, an XML Parser, DOM, and XPath library.
12: This library is free software; you can redistribute it and/or
13: modify it under the terms of the <a href="doc-files/LGPL.txt">GNU
14: Lesser General Public License</a> as published by the Free Software
15: Foundation; either version 2.1 of the License, or (at your option)
16: any later version. This library is distributed in the hope that it
17: will be useful, but WITHOUT ANY WARRANTY; without even the implied
18: warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19: PURPOSE. </small></blockquote>
20: @version $Date: 2002/12/06 23:39:35 $ $Revision: 1.2 $
21: @author Eamonn O'Brien-Strain
22: */
23:
24: public class TextTest extends NodeTest {
25:
26: //only need one of them => GoF Flyweight Pattern(195)
27: private TextTest() {
28: }
29:
30: static final TextTest INSTANCE = new TextTest();
31:
32: public void accept(Visitor visitor) throws XPathException {
33: visitor.visit(this );
34: }
35:
36: /** Return true*/
37: public boolean isStringValue() {
38: return true;
39: }
40:
41: public String toString() {
42: return "text()";
43: }
44: }
45:
46: // $Log: TextTest.java,v $
47: // Revision 1.2 2002/12/06 23:39:35 eobrain
48: // Make objects that are always the same follow the Flyweight Pattern.
49: //
50: // Revision 1.1.1.1 2002/08/19 05:04:03 eobrain
51: // import from HP Labs internal CVS
52: //
53: // Revision 1.2 2002/08/18 23:39:05 eob
54: // Add copyright and other formatting and commenting in preparation for
55: // release to SourceForge.
56: //
57: // Revision 1.1 2002/06/14 19:33:21 eob
58: // initial
|