public class DocumentValidator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
loggingResults |
static int |
maxNumberOfViolatingElementsToShow |
static boolean |
showElementIds |
Constructor and Description |
---|
DocumentValidator(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element e) |
Modifier and Type | Method and Description |
---|---|
static boolean |
addViolationIfUnique(ValidationRule rule,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element element,
java.lang.String comment,
boolean reported)
Add a violation for the rule only if none of the rules existing
violations have the same element and comment.
|
static java.lang.Object |
evaluate(java.lang.Object expression,
java.lang.Object context,
DocumentValidator validator,
boolean violationIfInconsistent)
Evaluate the expression and, if the violationIfConsistent flag is true
and the validator is not null, add a validation rule violation if the
expression is inconsistent.
|
static java.lang.Object |
evaluate(java.lang.Object expression,
java.lang.Object context,
ValidationRule rule,
boolean violationIfInconsistent)
Evaluate the expression and, if the violationIfConsistent flag is true
and the validator is not null, add a validation rule violation if the
expression is inconsistent.
|
static java.lang.Boolean |
evaluateConstraint(Constraint constraint,
DocumentValidator validator,
boolean violatedIfInconsistent)
Evaluate the constraint and, if the constraint is inconsistent and the
violatedIfConsistent flag is true and the validator is not null, add a
validation rule violation.
|
static java.lang.Boolean |
evaluateConstraint(Constraint constraint,
ValidationRule rule,
boolean violatedIfInconsistent)
Evaluate the constraint and, if the constraint is inconsistent and the
violatedIfConsistent flag is true and the validation rule is not null,
add a rule violation.
|
static java.lang.Boolean |
evaluateConstraints(java.lang.Object constrainedObject,
java.lang.Object actionOutput,
GenerationContext context,
boolean addViolations,
boolean addViolationForInconsistency)
Evaluate all constraints on the execution of the constrainedObject.
|
static java.util.List<Constraint> |
getConstraints(java.lang.Object constrainedObject,
java.lang.Object actionOutput,
GenerationContext context)
Gather all constraints applicable to the output or input of the
constrainedObject or the constrainedObject itself.
|
ValidationRule |
getViewpointConstraintRule() |
boolean |
isFatal() |
void |
printErrors() |
void |
printErrors(boolean showWindow) |
void |
printErrors(java.io.PrintWriter pw) |
void |
validateDocument() |
public static int maxNumberOfViolatingElementsToShow
public static boolean showElementIds
protected static boolean loggingResults
public DocumentValidator(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element e)
public ValidationRule getViewpointConstraintRule()
public boolean isFatal()
public void validateDocument()
public void printErrors()
public void printErrors(boolean showWindow)
public void printErrors(java.io.PrintWriter pw)
public static boolean addViolationIfUnique(ValidationRule rule, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element element, java.lang.String comment, boolean reported)
rule
- element
- comment
- public static java.lang.Object evaluate(java.lang.Object expression, java.lang.Object context, DocumentValidator validator, boolean violationIfInconsistent)
expression
- context
- validator
- violationIfInconsistent
- public static java.lang.Object evaluate(java.lang.Object expression, java.lang.Object context, ValidationRule rule, boolean violationIfInconsistent)
expression
- context
- rule
- violationIfInconsistent
- public static java.lang.Boolean evaluateConstraint(Constraint constraint, DocumentValidator validator, boolean violatedIfInconsistent)
constraint
- validator
- violatedIfInconsistent
- public static java.lang.Boolean evaluateConstraint(Constraint constraint, ValidationRule rule, boolean violatedIfInconsistent)
constraint
- rule
- violatedIfInconsistent
- public static java.lang.Boolean evaluateConstraints(java.lang.Object constrainedObject, java.lang.Object actionOutput, GenerationContext context, boolean addViolations, boolean addViolationForInconsistency)
constrainedObject
- actionOutput
- the result of executing the constrainedObject as an action, to
which the constraints may appliedcontext
- the execution context, providing target elements that passed
through, to which the constraints may be appliedaddViolations
- addViolationForInconsistency
- public static java.util.List<Constraint> getConstraints(java.lang.Object constrainedObject, java.lang.Object actionOutput, GenerationContext context)
constrainedObject
- actionOutput
- the result of executing the constrainedObject as an action, to
which the constraints may appliedcontext
- the execution context, providing target elements that passed
through, to which the constraints may be applied