@EventDriven @SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"xml","schema","validation","xsd"}) @WritesAttributes(value=@WritesAttribute(attribute="validatexml.invalid.error",description="If the flow file is routed to the invalid relationship the attribute will contain the error message resulting from the validation failure.")) @CapabilityDescription(value="Validates the contents of FlowFiles against a user-specified XML Schema file") public class ValidateXml extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_ATTRIBUTE_KEY |
private List<PropertyDescriptor> |
properties |
static Relationship |
REL_INVALID |
static Relationship |
REL_VALID |
private Set<Relationship> |
relationships |
static PropertyDescriptor |
SCHEMA_FILE |
private static String |
SCHEMA_LANGUAGE |
private AtomicReference<Schema> |
schemaRef |
Constructor and Description |
---|
ValidateXml() |
Modifier and Type | Method and Description |
---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
void |
parseSchema(ProcessContext context) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final String ERROR_ATTRIBUTE_KEY
public static final PropertyDescriptor SCHEMA_FILE
public static final Relationship REL_VALID
public static final Relationship REL_INVALID
private static final String SCHEMA_LANGUAGE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
private final AtomicReference<Schema> schemaRef
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void parseSchema(ProcessContext context) throws SAXException
SAXException
public void onTrigger(ProcessContext context, ProcessSession session)
onTrigger
in class AbstractProcessor
Copyright © 2021 Apache NiFi Project. All rights reserved.