private static boolean meetsValueConstraints(Value value, String[] constraints) { if (constraints == null || constraints.length == 0) { return true; } // Any of the constraints must be met for (String constraint : constraints) { if (Constraints.valueConstraint(value.getType(), constraint).apply(value)) { return true; } } return false; }
private static boolean meetsValueConstraints(Value value, String[] constraints) { if (constraints == null || constraints.length == 0) { return true; } // Any of the constraints must be met for (String constraint : constraints) { if (Constraints.valueConstraint(value.getType(), constraint).apply(value)) { return true; } } return false; }
private static boolean meetsValueConstraints(Value value, String[] constraints) { if (constraints == null || constraints.length == 0) { return true; } // Any of the constraints must be met for (String constraint : constraints) { if (Constraints.valueConstraint(value.getType(), constraint).apply(value)) { return true; } } return false; }
private void checkValueConstraints(NodeState definition, PropertyState property, int requiredType) throws CommitFailedException { if (property.count() == 0) { return; } PropertyState constraints = definition.getProperty(JCR_VALUECONSTRAINTS); if (constraints == null || constraints.count() == 0) { return; } for (String constraint : constraints.getValue(STRINGS)) { Predicate<Value> predicate = valueConstraint(requiredType, constraint); for (Value v : ValueFactoryImpl.createValues(property, NamePathMapper.DEFAULT)) { if (predicate.apply(v)) { return; } } } constraintViolation(5, "Value constraint violation in " + property); }
private void checkValueConstraints(NodeState definition, PropertyState property, int requiredType) throws CommitFailedException { if (property.count() == 0) { return; } PropertyState constraints = definition.getProperty(JCR_VALUECONSTRAINTS); if (constraints == null || constraints.count() == 0) { return; } for (String constraint : constraints.getValue(STRINGS)) { Predicate<Value> predicate = valueConstraint(requiredType, constraint); for (Value v : valueFactory.createValues(property)) { if (predicate.apply(v)) { return; } } } constraintViolation(5, "Value constraint violation in " + property); }
private void checkValueConstraints(NodeState definition, PropertyState property, int requiredType) throws CommitFailedException { if (property.count() == 0) { return; } PropertyState constraints = definition.getProperty(JCR_VALUECONSTRAINTS); if (constraints == null || constraints.count() == 0) { return; } for (String constraint : constraints.getValue(STRINGS)) { Predicate<Value> predicate = valueConstraint(requiredType, constraint); for (Value v : valueFactory.createValues(property)) { if (predicate.apply(v)) { return; } } } constraintViolation(5, "Value constraint violation in " + property); }