Class JsonTypeReferenceValidator<T>
java.lang.Object
org.qubership.nifi.processors.validator.AbstractJsonValidator<T>
org.qubership.nifi.processors.validator.JsonTypeReferenceValidator<T>
- Type Parameters:
T- defines type of output value, e.g. JsonNode.
- All Implemented Interfaces:
org.apache.nifi.components.Validator
Component validator for properties containing JSON that uses type references to parse JSON.
-
Field Summary
Fields inherited from interface org.apache.nifi.components.Validator
INVALID, VALID -
Constructor Summary
ConstructorsConstructorDescriptionJsonTypeReferenceValidator(com.fasterxml.jackson.databind.ObjectMapper mapper, boolean allowEmpty, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Create instance of JsonTypeReferenceValidatorJsonTypeReferenceValidator(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Create instance of JsonTypeReferenceValidator -
Method Summary
Methods inherited from class org.qubership.nifi.processors.validator.AbstractJsonValidator
validate, validate
-
Constructor Details
-
JsonTypeReferenceValidator
public JsonTypeReferenceValidator(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Create instance of JsonTypeReferenceValidator- Parameters:
mapper- ObjectMapper to usetypeRef- type reference for JSON parsing
-
JsonTypeReferenceValidator
public JsonTypeReferenceValidator(com.fasterxml.jackson.databind.ObjectMapper mapper, boolean allowEmpty, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Create instance of JsonTypeReferenceValidator- Parameters:
mapper- ObjectMapper to useallowEmpty- if true, treats empty values as validtypeRef- type reference for JSON parsing
-
-
Method Details
-
convert
Description copied from class:AbstractJsonValidatorConverts JSON string into JSON object.- Specified by:
convertin classAbstractJsonValidator<T>- Parameters:
json- JSON string from property- Returns:
- parsed JSON object
- Throws:
IOException
-