|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.util.validation.ValidationPattern
public class ValidationPattern
Validates a pattern of rules against a dom4j node, patterned off of Schematron
| Nested Class Summary | |
|---|---|
static class |
ValidationPattern.Rule
The rule as a series of tests |
static class |
ValidationPattern.RuleTest
A test within a rule |
| Method Summary | |
|---|---|
static ValidationPattern |
createPattern()
|
void |
evaluate(org.dom4j.Node node)
Evaluates the rules against the provided node |
ValidationPattern |
rule(java.lang.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(java.lang.String xpath)
Creates a test using the passed xpath expression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ValidationPattern createPattern()
public ValidationPattern rule(java.lang.String context,
ValidationPattern.RuleTest... tests)
context - The xpath expression to determine one or more nodes to evaluate the rules againsttests - A series of tests
public ValidationPattern rule(ValidationPattern.RuleTest... tests)
tests - A series of tests
public void evaluate(org.dom4j.Node node)
throws ValidationException
node - The node to evaluate
ValidationException - 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(java.lang.String xpath)
xpath - The test expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||