Package com.scroogexhtml.converter
Class StructureChecker
java.lang.Object
com.scroogexhtml.converter.StructureChecker
Decides what happens when the converter finds a structural defect in the
RTF input (see
StructuralViolation).
One instance is used per conversion; it is not thread-safe. In strict mode
violation(StructuralViolation) throws; in lenient mode it logs a
warning for the first occurrence of each kind and returns, and the caller
repairs or skips the defect as before.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisStrict()static StructureCheckerorLenient(StructureChecker checker) voidviolation(StructuralViolation violation) Reports a structural defect.
-
Constructor Details
-
StructureChecker
public StructureChecker(boolean strict) - Parameters:
strict- true for strict mode
-
-
Method Details
-
orLenient
- Parameters:
checker- a checker, or null- Returns:
- the checker, or a new lenient one if it is null
-
isStrict
public boolean isStrict()- Returns:
- true in strict mode
-
violation
Reports a structural defect.- Parameters:
violation- the defect- Throws:
StructuralViolationException- in strict mode
-