|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.schematic.internal.schema.ValidationResult
@NotThreadSafe public class ValidationResult
Basic implementation of SchemaLibrary.Results to which problems can be added.
| Constructor Summary | |
|---|---|
ValidationResult()
|
|
| Method Summary | |
|---|---|
void |
add(SchemaLibrary.Problem problem)
|
void |
addAll(Iterable<SchemaLibrary.Problem> results)
|
void |
addAll(Iterator<SchemaLibrary.Results> iter)
|
int |
errorCount()
Determine the number of errors within these results. |
boolean |
hasErrors()
Determine if these results contain at least one error. |
boolean |
hasOnlyTypeMismatchErrors()
Determine if these results contain only errors that are mismatched fields, where the
value of a field has a type that does not match but can be converted to the type defined in the schema. |
boolean |
hasProblems()
Determine if these results contain at least one error or warning. |
boolean |
hasWarnings()
Determine if these results contain at least one warning. |
Iterator<SchemaLibrary.Problem> |
iterator()
|
int |
problemCount()
Determine the number of problems (that is, errors and warnings) within these results. |
void |
recordError(Path path,
String reason)
Record an error at the given path in a document. |
void |
recordError(Path path,
String reason,
Throwable cause)
Record an error at the given path in a document. |
void |
recordIn(Problems otherProblems)
|
void |
recordSuccess()
Record a successful validation. |
void |
recordTypeMismatch(Path path,
String reason,
JsonSchema.Type actualType,
Object actualValue,
JsonSchema.Type requiredType,
Object convertedValue)
Record a field value was encountered whose type was not the expected type but could be converted to the expected type. |
void |
recordWarning(Path path,
String reason)
Record a warning at the given path in a document. |
int |
successCount()
|
String |
toString()
|
int |
warningCount()
Determine the number of warnings within these results. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ValidationResult()
| Method Detail |
|---|
public Iterator<SchemaLibrary.Problem> iterator()
iterator in interface Iterable<SchemaLibrary.Problem>public boolean hasProblems()
SchemaLibrary.ResultshasErrors() || hasWarnings()or
problemCount() != 0or
errorCount() != 0 || warningCount() != 0
hasProblems in interface SchemaLibrary.Resultstrue if there is at least one error or warning, or false if there are no errors or
warningspublic boolean hasErrors()
SchemaLibrary.Results
hasErrors in interface SchemaLibrary.Resultstrue if there is at least one error, or false if there are no errorspublic boolean hasWarnings()
SchemaLibrary.Results
hasWarnings in interface SchemaLibrary.Resultstrue if there is at least one warning, or false if there are no errorspublic boolean hasOnlyTypeMismatchErrors()
SchemaLibrary.Resultsmismatched fields, where the
value of a field has a type that does not match but can be converted to the type defined in the schema.
All type mismatch errors are considered errors, but not all errors are type mismatch errors.
If this method return true, then consider calling SchemaLibrary.convertValues(Document, Results) to convert the
mismatched values and then revalidating.
hasOnlyTypeMismatchErrors in interface SchemaLibrary.Resultstrue if there is at least one mismatched type error, or false if there are no errorsSchemaLibrary.convertValues(Document, Results)public int errorCount()
SchemaLibrary.Results
errorCount in interface SchemaLibrary.Resultspublic int warningCount()
SchemaLibrary.Results
warningCount in interface SchemaLibrary.Resultspublic int problemCount()
SchemaLibrary.Results
problemCount in interface SchemaLibrary.Resultspublic int successCount()
public void recordSuccess()
Problems
recordSuccess in interface Problems
public void recordError(Path path,
String reason)
Problems
recordError in interface Problemspath - the path; may not be nullreason - the message describing the error; may not be null
public void recordError(Path path,
String reason,
Throwable cause)
Problems
recordError in interface Problemspath - the path; may not be nullreason - the message describing the error; may not be nullcause - the exception that occurred and that is considered the cause
public void recordWarning(Path path,
String reason)
Problems
recordWarning in interface Problemspath - the path; may not be nullreason - the message describing the warning; may not be null
public void recordTypeMismatch(Path path,
String reason,
JsonSchema.Type actualType,
Object actualValue,
JsonSchema.Type requiredType,
Object convertedValue)
Problems
recordTypeMismatch in interface Problemspath - the path; may not be nullreason - the message describing the warning; may not be nullactualType - the actual type of the field value; may not be nullactualValue - the actual field valuerequiredType - the expected type; may not be nullconvertedValue - the converted valuepublic void recordIn(Problems otherProblems)
public void add(SchemaLibrary.Problem problem)
public void addAll(Iterable<SchemaLibrary.Problem> results)
public void addAll(Iterator<SchemaLibrary.Results> iter)
public String toString()
toString in class Object
|
ModeShape Distribution 3.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||