Import statics directly, bump version
[cql-java-moved-to-github.git] / src / main / java / org / z3950 / zing / cql / CQLTermNode.java
index 1f03a4e..cdb62f7 100644 (file)
@@ -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<CQLPrefix> prefixes,
                         List<ModifierSet> sortkeys) {
        return (indent(level) + "<searchClause>\n" +
@@ -63,6 +66,7 @@ public class CQLTermNode extends CQLNode {
                indent(level) + "</searchClause>\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.