X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLTermNode.java;h=cdb62f75019162af10556e91205d4fcf7ddbef8a;hb=7cff92fa0b727aa844456f130744ec2fe263ba48;hp=1f03a4ed9f426b54f3dc91d244f2835f906148d0;hpb=791833362f2e87616d70ffc3f1ce6b0191ff7a0f;p=cql-java-moved-to-github.git diff --git a/src/main/java/org/z3950/zing/cql/CQLTermNode.java b/src/main/java/org/z3950/zing/cql/CQLTermNode.java index 1f03a4e..cdb62f7 100644 --- a/src/main/java/org/z3950/zing/cql/CQLTermNode.java +++ b/src/main/java/org/z3950/zing/cql/CQLTermNode.java @@ -5,6 +5,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; +import static org.z3950.zing.cql.Utils.*; + /** * Represents a terminal node in a CQL parse-tree. @@ -52,6 +54,7 @@ public class CQLTermNode extends CQLNode { return null; } + @Override public String toXCQL(int level, List prefixes, List sortkeys) { return (indent(level) + "\n" + @@ -63,6 +66,7 @@ public class CQLTermNode extends CQLNode { indent(level) + "\n"); } + @Override public String toCQL() { String quotedIndex = maybeQuote(index); String quotedTerm = maybeQuote(term); @@ -158,6 +162,7 @@ public class CQLTermNode extends CQLNode { return attrs; } + @Override public String toPQF(Properties config) throws PQFTranslationException { if (isResultSetIndex(index)) { // Special case: ignore relation, modifiers, wildcards, etc. @@ -170,7 +175,7 @@ public class CQLTermNode extends CQLNode { String attr, s = ""; for (int i = 0; i < attrs.size(); i++) { attr = (String) attrs.get(i); - s += "@attr " + Utils.replaceString(attr, " ", " @attr ") + " "; + s += "@attr " + attr.replace(" ", " @attr ") + " "; } String text = term; @@ -198,12 +203,13 @@ public class CQLTermNode extends CQLNode { str.indexOf('/') != -1 || str.indexOf('(') != -1 || str.indexOf(')') != -1) { - str = '"' + Utils.replaceString(str, "\"", "\\\"") + '"'; + str = '"' + str.replace("\"", "\\\"") + '"'; } return str; } + @Override public byte[] toType1BER(Properties config) throws PQFTranslationException { if (isResultSetIndex(index)) { // Special case: ignore relation, modifiers, wildcards, etc.