X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FFilterParameter.java;h=6841d36ee0d405bd8b6f6b5b7e0df1fc740cb355;hb=6c92dd9a72ae1fa27dd061c1897531879b8c0ba6;hp=0d540a2a82fc1acc1a897e5fa45ce2915b948e8f;hpb=31a027596723261b413d69c74428b176def3627f;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/FilterParameter.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/FilterParameter.java index 0d540a2..6841d36 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/FilterParameter.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/FilterParameter.java @@ -2,6 +2,14 @@ package com.indexdata.mkjsf.pazpar2.commands; import org.apache.log4j.Logger; +/** + * Represents a filter parameter as it applies to the Pazpar2 search command + * + *
A filter parameter consists of one or more expressions separated by commas.
+ * + * @author Niels Erik + * + */ public class FilterParameter extends CommandParameter { private static final long serialVersionUID = -3697328835895528654L; @@ -28,7 +36,13 @@ public class FilterParameter extends CommandParameter { return completeValue.toString(); } - public String pz2escape (String expressionString) { + /** + * Escapes backslash (\), comma (,) and pipe (|) from an expression string. + * + * @param expressionString + * @return escaped expressionString + */ + private String pz2escape (String expressionString) { String escaped = expressionString.replaceAll("\\\\","\\\\\\\\"); escaped = escaped.replaceAll(",","\\\\,"); escaped = escaped.replaceAll("\\|", "\\\\|");