Class ValidateXml
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.ValidateXml
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"xml","schema","validation","xsd"})
@WritesAttributes(@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("Validates XML contained in a FlowFile. By default, the XML is contained in the FlowFile content. If the \'XML Source Attribute\' property is set, the XML to be validated is contained in the specified attribute. It is not recommended to use attributes to hold large XML documents; doing so could adversely affect system performance. Full schema validation is performed if the processor is configured with the XSD schema details. Otherwise, the only validation performed is to ensure the XML syntax is correct and well-formed, e.g. all opening tags are properly closed.")
@SystemResourceConsideration(resource=MEMORY,
description="While this processor supports processing XML within attributes, it is strongly discouraged to hold large amounts of data in attributes. In general, attribute values should be as small as possible and hold no more than a couple hundred characters.")
@Restricted(restrictions=@Restriction(requiredPermission=REFERENCE_REMOTE_RESOURCES,explanation="Schema configuration can reference resources over HTTP"))
public class ValidateXml
extends org.apache.nifi.processor.AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate static final List<org.apache.nifi.components.PropertyDescriptor> private static final XMLStreamReaderProviderstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorprivate static final Stringprivate static final SchemaValidatorprivate final AtomicReference<Schema> static final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) voidparseSchema(org.apache.nifi.processor.ProcessContext context) private voidvalidate(InputStream in) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
ERROR_ATTRIBUTE_KEY
- See Also:
-
SCHEMA_FILE
public static final org.apache.nifi.components.PropertyDescriptor SCHEMA_FILE -
XML_SOURCE_ATTRIBUTE
public static final org.apache.nifi.components.PropertyDescriptor XML_SOURCE_ATTRIBUTE -
PROPERTY_DESCRIPTORS
-
REL_VALID
public static final org.apache.nifi.processor.Relationship REL_VALID -
REL_INVALID
public static final org.apache.nifi.processor.Relationship REL_INVALID -
RELATIONSHIPS
-
SCHEMA_LANGUAGE
- See Also:
-
SCHEMA_VALIDATOR
-
READER_PROVIDER
-
schemaRef
-
-
Constructor Details
-
ValidateXml
public ValidateXml()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
parseSchema
@OnScheduled public void parseSchema(org.apache.nifi.processor.ProcessContext context) throws SAXException - Throws:
SAXException
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor
-
validate
-