org.modeldriven.fuml.xmi.validation
Class ValidationErrorCollector
java.lang.Object
org.modeldriven.fuml.xmi.AbstractXmiNodeVisitor
org.modeldriven.fuml.xmi.validation.ValidationErrorCollector
- All Implemented Interfaces:
- XmiNodeVisitor
public class ValidationErrorCollector
- extends AbstractXmiNodeVisitor
- implements XmiNodeVisitor
A visitor pattern implementation class that walks a given XmiNode hierarchy checking for
various error conditions, creating and gathering ValidationError instances into a collection
helpful for user feedback. This class can be initialized with an initial list of errors gathered
from another context, and errors may be added to it's collection ad-hoc. This class heavily
leverages the fuml.model package. For more information on runtime metadata, see the fuml.model
package documentation.
- Author:
- Scott Cinnamond
ValidationErrorCollector
public ValidationErrorCollector(XmiNode root)
validate
public void validate()
- Traverses the entire given graph ala. the visitor pattern, gathering any validation
errors, other than reference errors. References are added to
a collection to be validated subsequently, outside of the
visitor.
addEventListener
public void addEventListener(ValidationEventListener eventListener)
removeEventListener
public void removeEventListener(ValidationEventListener eventListener)
visit
public void visit(XmiNode target,
XmiNode sourceXmiNode,
String sourceKey,
XmiNodeVisitorStatus status,
int level)
- Specified by:
visit in interface XmiNodeVisitor
getErrors
public List<ValidationError> getErrors()
getErrorCount
public int getErrorCount()
getErrors
public List<ValidationError> getErrors(ErrorCode code)
getErrorCount
public int getErrorCount(ErrorCode code)
getErrors
public List<ValidationError> getErrors(ErrorCategory category)
getErrorCount
public int getErrorCount(ErrorCategory category)
getErrors
public List<ValidationError> getErrors(ErrorSeverity severity)
getErrorCount
public int getErrorCount(ErrorSeverity severity)
isValidateExternalReferences
public boolean isValidateExternalReferences()
setValidateExternalReferences
public void setValidateExternalReferences(boolean validateExternalReferences)
Copyright © 2012. All Rights Reserved.