Class JsonContentValidator
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
org.qubership.nifi.service.validation.JsonContentValidator
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.controller.ControllerService,ContentValidator
@CapabilityDescription("Provides validate method to check the JSON against a given schema.")
public class JsonContentValidator
extends org.apache.nifi.controller.AbstractControllerService
implements ContentValidator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.nifi.components.PropertyDescriptor> Gets a list of supported properties.voidonConfigured(org.apache.nifi.controller.ConfigurationContext context) Configures controller service before use.booleanValidates JSON against JSON Schema.Methods inherited from class org.apache.nifi.controller.AbstractControllerService
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful
-
Field Details
-
SCHEMA
public static final org.apache.nifi.components.PropertyDescriptor SCHEMA
-
-
Constructor Details
-
JsonContentValidator
public JsonContentValidator()
-
-
Method Details
-
getSupportedPropertyDescriptors
Gets a list of supported properties.- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent- Returns:
- list of supported property descriptors
-
onConfigured
@OnEnabled public void onConfigured(org.apache.nifi.controller.ConfigurationContext context) throws org.apache.nifi.reporting.InitializationException Configures controller service before use. This method is invoked when the controller service is enabled.- Parameters:
context- configuration context to use- Throws:
org.apache.nifi.reporting.InitializationException
-
validate
Validates JSON against JSON Schema.- Specified by:
validatein interfaceContentValidator- Parameters:
value- input JSONattributes- map with FlowFile attributes- Returns:
- true, if valid. false, otherwise.
- Throws:
IOException
-