public class ValidationPattern extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ValidationPattern.Rule
The rule as a series of tests
|
static class |
ValidationPattern.RuleTest
A test within a rule
|
| Modifier and Type | Method and Description |
|---|---|
static ValidationPattern |
createPattern() |
void |
evaluate(org.dom4j.Node node)
Evaluates the rules against the provided node
|
ValidationPattern |
rule(String context,
ValidationPattern.RuleTest... tests)
Adds a rule to the current pattern
|
ValidationPattern |
rule(ValidationPattern.RuleTest... tests)
Adds a rule to the current pattern, assuming the current context is "."
|
static ValidationPattern.RuleTest |
test(String xpath)
Creates a test using the passed xpath expression
|
public static ValidationPattern createPattern()
public ValidationPattern rule(String context, ValidationPattern.RuleTest... tests)
context - The xpath expression to determine one or more nodes to evaluate the rules againsttests - A series of testspublic ValidationPattern rule(ValidationPattern.RuleTest... tests)
tests - A series of testspublic void evaluate(org.dom4j.Node node)
throws ValidationException
node - The node to evaluateValidationException - If a validation error occurs. If wanting to resolve i18n keys
to messages, you can access the list of errors from the exception.public static ValidationPattern.RuleTest test(String xpath)
xpath - The test expressionCopyright © 2014 Atlassian. All rights reserved.