Class StructureChecker

java.lang.Object
com.scroogexhtml.converter.StructureChecker

public final class StructureChecker extends Object
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 Details

    • StructureChecker

      public StructureChecker(boolean strict)
      Parameters:
      strict - true for strict mode
  • Method Details

    • orLenient

      public static StructureChecker orLenient(StructureChecker checker)
      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

      public void violation(StructuralViolation violation)
      Reports a structural defect.
      Parameters:
      violation - the defect
      Throws:
      StructuralViolationException - in strict mode