Class AbstractProblemHandler
java.lang.Object
gov.nist.secauto.metaschema.databind.io.AbstractProblemHandler
- All Implemented Interfaces:
IProblemHandler
- Direct Known Subclasses:
DefaultJsonProblemHandler,DefaultXmlProblemHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidapplyDefaults(Object targetObject, Collection<? extends IBoundProperty<?>> unhandledInstances) A utility method for applying default values for the providedunhandledInstances.voidhandleMissingInstances(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.
-
Constructor Details
-
AbstractProblemHandler
public AbstractProblemHandler()
-
-
Method Details
-
handleMissingInstances
public void handleMissingInstances(IBoundDefinitionModelComplex parentDefinition, IBoundObject targetObject, Collection<? extends IBoundProperty<?>> unhandledInstances) throws IOException Description copied from interface:IProblemHandlerA 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.
- Specified by:
handleMissingInstancesin interfaceIProblemHandler- 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
-
applyDefaults
protected static void applyDefaults(@NonNull Object targetObject, @NonNull Collection<? extends IBoundProperty<?>> unhandledInstances) throws IOException A utility method for applying default values for the providedunhandledInstances.- Parameters:
targetObject- the Java object to apply default values tounhandledInstances- the collection of unhandled instances to assign default values for- Throws:
IOException- if an error occurred while determining the default value for an instance
-