Class DefaultJsonProblemHandler

java.lang.Object
dev.metaschema.databind.io.AbstractProblemHandler
dev.metaschema.databind.io.json.DefaultJsonProblemHandler
All Implemented Interfaces:
IProblemHandler, IJsonProblemHandler

public class DefaultJsonProblemHandler extends AbstractProblemHandler implements IJsonProblemHandler
This problem handler implementation handles common issues when parsing JSON-based Metaschema module instances.
  • Constructor Details

    • DefaultJsonProblemHandler

      public DefaultJsonProblemHandler()
      Construct a new problem handler with required field validation enabled.
    • DefaultJsonProblemHandler

      public DefaultJsonProblemHandler(boolean validateRequiredFields)
      Construct a new problem handler with the specified validation setting.
      Parameters:
      validateRequiredFields - true to validate that required fields are present, false to skip validation
  • Method Details

    • handleUnknownProperty

      public boolean handleUnknownProperty(IBoundDefinitionModelComplex classBinding, IBoundObject targetObject, String fieldName, IJsonParsingContext parsingContext) throws IOException
      Description copied from interface: IJsonProblemHandler
      Callback used to handle a JSON property that is unknown to the model being parsed.
      Specified by:
      handleUnknownProperty in interface IJsonProblemHandler
      Parameters:
      classBinding - the bound class currently describing the data being parsed
      targetObject - the Java object for the parentDefinition
      fieldName - the unknown JSON field name
      parsingContext - the JSON parsing context used for parsing
      Returns:
      true if the attribute was handled by this method, or false otherwise
      Throws:
      IOException - if an error occurred while handling the unrecognized data