/** * Creates a constraint for a path to be NOT ONE OF a collection of values. * * @param path the path to apply the constraint to * @param values the Collection of values to constrain to * @return a new PathConstraint object */ public static PathConstraintMultiValue noneOfValues(String path, Collection<String> values) { return new PathConstraintMultiValue(path, ConstraintOp.NONE_OF, values); }
/** * Get the values for a constraint. * @param con The constraint. * @return A collection of values. null if this makes no sense. */ public static Collection<String> getValues(PathConstraint con) { if (con instanceof PathConstraintMultiValue) { return ((PathConstraintMultiValue) con).getValues(); } else { return null; } }
private static String handleConstraint(PathConstraintMultiValue pc, Set<? super String> imports) throws UnhandledFeatureException { imports.add("java.util.Arrays"); final String values = "Arrays.asList(" + formatList(pc.getValues(), 2) + ")"; return format(MULTI_VALUE_FMT, MULTI_METHOD_NAMES.get(pc.getOp()), pc.getPath(), values); }
/** * Get the values for a constraint. * @param con The constraint. * @return A collection of values. null if this makes no sense. */ public static Collection<String> getValues(PathConstraint con) { if (con instanceof PathConstraintMultiValue) { return ((PathConstraintMultiValue) con).getValues(); } else { return null; } }
/** * Creates a constraint for a path to be ONE OF a collection of values. * * @param path the path to apply the constraint to * @param values the Collection of values to constrain to * @return a new PathConstraint object */ public static PathConstraintMultiValue oneOfValues(String path, Collection<String> values) { return new PathConstraintMultiValue(path, ConstraintOp.ONE_OF, values); }
private static String handleConstraint(PathConstraintMultiValue pc, Set<? super String> imports) throws UnhandledFeatureException { imports.add("java.util.Arrays"); final String values = "Arrays.asList(" + formatList(pc.getValues(), 2) + ")"; return format(MULTI_VALUE_FMT, MULTI_METHOD_NAMES.get(pc.getOp()), pc.getPath(), values); }
for (String value : ((PathConstraintMultiValue) constraint.getKey()).getValues()) { if (value == null) { writer.writeStartElement("nullValue");
/** * Creates a constraint for a path to be NOT ONE OF a collection of values. * * @param path the path to apply the constraint to * @param values the Collection of values to constrain to * @return a new PathConstraint object */ public static PathConstraintMultiValue noneOfValues(String path, Collection<String> values) { return new PathConstraintMultiValue(path, ConstraintOp.NONE_OF, values); }
sb.append("\"" + op.toString() + "\""); sb.append(", ["); Collection<String> values = ((PathConstraintMultiValue) pc).getValues(); listFormatUtil(sb, values); sb.append("]");
/** * Creates a constraint for a path to be ONE OF a collection of values. * * @param path the path to apply the constraint to * @param values the Collection of values to constrain to * @return a new PathConstraint object */ public static PathConstraintMultiValue oneOfValues(String path, Collection<String> values) { return new PathConstraintMultiValue(path, ConstraintOp.ONE_OF, values); }
for (String value : ((PathConstraintMultiValue) constraint.getKey()).getValues()) { if (value == null) { writer.writeStartElement("nullValue");
oneOfValues.add(values.get(j).toString()); constraint = new PathConstraintMultiValue(path, constraintOp, oneOfValues); } else if ("IS NULL".equals(op) || "IS NOT NULL".equals(op)) { constraint = new PathConstraintNull(path, constraintOp);
sb.append("\"" + op.toString() + "\""); sb.append(", ["); Collection<String> values = ((PathConstraintMultiValue) pc).getValues(); listFormatUtil(sb, values); sb.append("]");
oneOfValues.add(values.get(j).toString()); constraint = new PathConstraintMultiValue(path, constraintOp, oneOfValues); } else if ("IS NULL".equals(op) || "IS NOT NULL".equals(op)) { constraint = new PathConstraintNull(path, constraintOp);
for (String aValue : ((PathConstraintMultiValue) pc).getValues()) { values.append(INDENT + INDENT + "'" + aValue + "'," + endl);
valuesCollection.add(value == null ? value : value.trim()); return new PathConstraintMultiValue(path, constraintOp, valuesCollection); } else if (ConstraintOp.LOOKUP.equals(constraintOp)) {
for (String aValue : ((PathConstraintMultiValue) pc).getValues()) { values.append(INDENT + INDENT + "'" + aValue + "'," + endl);
valuesCollection.add(value == null ? value : value.trim()); return new PathConstraintMultiValue(path, constraintOp, valuesCollection); } else if (ConstraintOp.LOOKUP.equals(constraintOp)) {
StringBuffer sb = new StringBuffer(); sb.append("["); Collection<String> values = ((PathConstraintMultiValue) pc).getValues(); listFormatUtil(sb, values); sb.append("]");
newConstraint = new PathConstraintMultiValue(pathString, templateValue.getOperation(), templateValue.getValues()); } else { templateValue.getOperation(), templateValue.getValue()); } else { newConstraint = new PathConstraintMultiValue(pathString, templateValue.getOperation(), templateValue.getValues());