01: package com.rimfaxe.xml.xmlreader.xpath;
02:
03: /**
04: * [text()] expression
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/13 22:42:22 $ $Revision: 1.4 $
21: @author Eamonn O'Brien-Strain
22: */
23: public class TextExistsExpr extends BooleanExpr {
24:
25: //only need one of them => much memory sharing
26: private TextExistsExpr() {
27: }
28:
29: static final TextExistsExpr INSTANCE = new TextExistsExpr();
30:
31: /**
32: * @see com.hp.hpl.sparta.xpath.BooleanExpr#accept(BooleanExprVisitor)
33: */
34: public void accept(BooleanExprVisitor visitor)
35: throws XPathException {
36: visitor.visit(this );
37: }
38:
39: public String toString() {
40: return "[text()]";
41: }
42:
43: }
44:
45: //$Log: TextExistsExpr.java,v $
46: //Revision 1.4 2002/12/13 22:42:22 eobrain
47: //Fix javadoc.
48: //
49: //Revision 1.3 2002/12/13 18:08:44 eobrain
50: //Factor Visitor out into separate visitors for node tests and predicates.
51: //
52: //Revision 1.2 2002/12/06 23:41:49 eobrain
53: //Add toString() which returns the original XPath.
54: //
55: //Revision 1.1 2002/10/30 16:25:20 eobrain
56: //Feature request [ 630127 ] Support /a/b[text()='foo']
57: //http://sourceforge.net/projects/sparta-xml/
58: //
|