- All Known Subinterfaces:
IJsonProblemHandler,IXmlProblemHandler
- All Known Implementing Classes:
AbstractProblemHandler,DefaultJsonProblemHandler,DefaultXmlProblemHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Implementations support handling common parsing issues.
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleMissingInstances(IBoundDefinitionModelComplex parentDefinition, IBoundObject targetObject, Collection<? extends IBoundProperty<?>> unhandledInstances) A callback used to handle bound properties for which no data was found when the content was parsed.default voidhandleMissingInstances(IBoundDefinitionModelComplex parentDefinition, IBoundObject targetObject, Collection<? extends IBoundProperty<?>> unhandledInstances, ValidationContext context) A callback used to handle bound properties for which no data was found when the content was parsed, with additional validation context.
-
Method Details
-
handleMissingInstances
void handleMissingInstances(@NonNull IBoundDefinitionModelComplex parentDefinition, @NonNull IBoundObject targetObject, @NonNull Collection<? extends IBoundProperty<?>> unhandledInstances) throws IOException A callback used to handle bound properties for which no data was found when the content was parsed.This can be used to supply default or prescribed values based on application logic.
- Parameters:
parentDefinition- the bound class on which the missing properties are foundtargetObject- the Java object for theparentDefinitionunhandledInstances- the set of instances that had no data to parse- Throws:
IOException- if an error occurred while handling the missing instances
-
handleMissingInstances
default void handleMissingInstances(@NonNull IBoundDefinitionModelComplex parentDefinition, @NonNull IBoundObject targetObject, @NonNull Collection<? extends IBoundProperty<?>> unhandledInstances, @Nullable ValidationContext context) throws IOException A callback used to handle bound properties for which no data was found when the content was parsed, with additional validation context.This method provides richer context information for error messages including source location, document path, and format-specific details.
The default implementation delegates to
handleMissingInstances(IBoundDefinitionModelComplex, IBoundObject, Collection)for backward compatibility.- Parameters:
parentDefinition- the bound class on which the missing properties are foundtargetObject- the Java object for theparentDefinitionunhandledInstances- the set of instances that had no data to parsecontext- the validation context with location and path information, may be null for backward compatibility- Throws:
IOException- if an error occurred while handling the missing instances
-