Interface IParserErrorHandler

All Known Implementing Classes:
ErrorHandlerAdapter, LenientErrorHandler, StrictErrorHandler

public interface IParserErrorHandler
Error handler
  • Method Details

    • containedResourceWithNoId

      Invoked when a contained resource is parsed that has no ID specified (and is therefore invalid)
      Parameters:
      theLocation - The location in the document. WILL ALWAYS BE NULL currently, as this is not yet implemented, but this parameter is included so that locations can be added in the future without changing the API.
      Since:
      2.0
    • incorrectJsonType

      void incorrectJsonType(IParserErrorHandler.IParseLocation theLocation, String theElementName, BaseJsonLikeValue.ValueType theExpectedValueType, BaseJsonLikeValue.ScalarType theExpectedScalarType, BaseJsonLikeValue.ValueType theFoundValueType, BaseJsonLikeValue.ScalarType theFoundScalarType)
      Invoked if the wrong type of element is found while parsing JSON. For example if a given element is expected to be a JSON Object and is a JSON array
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theElementName - The name of the element that was found.
      theExpectedValueType - The datatype that was expected at this location
      theExpectedScalarType - If theExpectedValueType is BaseJsonLikeValue.ValueType.SCALAR, this is the specific scalar type expected. Otherwise this parameter will be null.
      theFoundValueType - The datatype that was found at this location
      theFoundScalarType - If theFoundValueType is BaseJsonLikeValue.ValueType.SCALAR, this is the specific scalar type found. Otherwise this parameter will be null.
      Since:
      2.2
    • invalidValue

      void invalidValue(IParserErrorHandler.IParseLocation theLocation, String theValue, String theError)
      The parser detected an attribute value that was invalid (such as: empty "" values are not permitted)
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theValue - The actual value
      theError - A description of why the value was invalid
      Since:
      2.2
    • missingRequiredElement

      Resource was missing a required element
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theElementName - The missing element name
      Since:
      2.1
    • unexpectedRepeatingElement

      Invoked when an element repetition (e.g. a second repetition of something) is found for a field which is non-repeating.
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theElementName - The name of the element that was found.
      Since:
      1.2
    • unknownAttribute

      void unknownAttribute(IParserErrorHandler.IParseLocation theLocation, String theAttributeName)
      Invoked when an unknown element is found in the document.
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theAttributeName - The name of the attribute that was found.
    • unknownElement

      void unknownElement(IParserErrorHandler.IParseLocation theLocation, String theElementName)
      Invoked when an unknown element is found in the document.
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theElementName - The name of the element that was found.
    • unknownReference

      Resource contained a reference that could not be resolved and needs to be resolvable (e.g. because it is a local reference to an unknown contained resource)
      Parameters:
      theLocation - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.
      theReference - The actual invalid reference (e.g. "#3")
      Since:
      2.0
    • extensionContainsValueAndNestedExtensions

      An extension contains both a value and at least one nested extension
      Parameters:
      theLoc - The location in the document. Note that this may be null as the ParseLocation feature is experimental. Use with caution, as the API may change.