Class ValidationError

java.lang.Object
com.independentsoft.office.ValidationError

public class ValidationError extends Object
One problem found by a document's validate method.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ValidationError​(String message, String location)
    Instantiates a new validation error.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets where the problem is, as a path through the object model - for example Slides[2] or Sheets[0].Name.
    Gets what is wrong, in terms of the object model rather than the XML - the caller fixes this by changing the document, not the file.
    Returns the location and the message, which is what belongs in a log.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ValidationError

      public ValidationError(String message, String location)
      Instantiates a new validation error. Normally these come from a document's validate method rather than from calling this; it is public only because the document classes live in other packages and Java has no way to widen access to just those.
      Parameters:
      message - what is wrong
      location - where it is, as a path through the object model
  • Method Details

    • getMessage

      public String getMessage()
      Gets what is wrong, in terms of the object model rather than the XML - the caller fixes this by changing the document, not the file.
      Returns:
      the message
    • getLocation

      public String getLocation()
      Gets where the problem is, as a path through the object model - for example Slides[2] or Sheets[0].Name. Null when the problem is the document as a whole.
      Returns:
      the location
    • toString

      public String toString()
      Returns the location and the message, which is what belongs in a log.
      Overrides:
      toString in class Object
      Returns:
      the string