1 2 12 package com.versant.core.ejb.query; 13 14 17 public class LikeNode extends Node { 18 19 private Node path; 21 private boolean not; 22 private Node pattern; 23 private Node escape; 24 25 public LikeNode(Node path, boolean not, Node pattern, 26 Node escape) { 27 this.path = path; 28 this.not = not; 29 this.pattern = pattern; 30 this.escape = escape; 31 } 32 33 public PathNode getPath() { 34 return (PathNode)path; 35 } 36 37 public boolean isNot() { 38 return not; 39 } 40 41 public Node getPattern() { 42 return pattern; 43 } 44 45 public Node getEscape() { 46 return escape; 47 } 48 49 public Object arrive(NodeVisitor v, Object msg) { 50 return v.arriveLikeNode(this, msg); 51 } 52 53 public String toStringImp() { 54 StringBuffer s = new StringBuffer (); 55 s.append(path); 56 if (not) { 57 s.append(" NOT"); 58 } 59 s.append(" LIKE "); 60 s.append(pattern); 61 if (escape != null) { 62 s.append(" ESCAPE "); 63 s.append(escape); 64 } 65 return s.toString(); 66 } 67 68 public void resolve(ResolveContext rc) { 69 path.resolve(rc); 70 if (escape != null) { 71 escape.resolve(rc); 72 } 73 pattern.resolve(rc); 74 } 75 76 } 77 78 | Popular Tags |