private InputRequirement.Requirement getInputRequirement(final ConfigurableComponent component) { final InputRequirement annotation = component.getClass().getAnnotation(InputRequirement.class); return annotation == null ? null : annotation.value(); }
public ProcessorDetails(final LoggableComponent<Processor> processor) { this.processor = processor.getComponent(); this.componentLog = processor.getLogger(); this.bundleCoordinate = processor.getBundleCoordinate(); this.procClass = this.processor.getClass(); this.triggerWhenEmpty = procClass.isAnnotationPresent(TriggerWhenEmpty.class); this.sideEffectFree = procClass.isAnnotationPresent(SideEffectFree.class); this.batchSupported = procClass.isAnnotationPresent(SupportsBatching.class); this.triggeredSerially = procClass.isAnnotationPresent(TriggerSerially.class); this.triggerWhenAnyDestinationAvailable = procClass.isAnnotationPresent(TriggerWhenAnyDestinationAvailable.class); this.eventDrivenSupported = procClass.isAnnotationPresent(EventDriven.class) && !triggeredSerially && !triggerWhenEmpty; this.executionNodeRestricted = procClass.isAnnotationPresent(PrimaryNodeOnly.class); final boolean inputRequirementPresent = procClass.isAnnotationPresent(InputRequirement.class); if (inputRequirementPresent) { this.inputRequirement = procClass.getAnnotation(InputRequirement.class).value(); } else { this.inputRequirement = InputRequirement.Requirement.INPUT_ALLOWED; } }
/** * Add in the documentation information regarding the component whether it accepts an * incoming relationship or not. * * @param configurableComponent the component to describe * @param xmlStreamWriter the stream writer to use * @throws XMLStreamException thrown if there was a problem writing the XML */ private void writeInputRequirementInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException { final InputRequirement inputRequirement = configurableComponent.getClass().getAnnotation(InputRequirement.class); if(inputRequirement != null) { writeSimpleElement(xmlStreamWriter, "h3", "Input requirement: "); switch (inputRequirement.value()) { case INPUT_FORBIDDEN: xmlStreamWriter.writeCharacters("This component does not allow an incoming relationship."); break; case INPUT_ALLOWED: xmlStreamWriter.writeCharacters("This component allows an incoming relationship."); break; case INPUT_REQUIRED: xmlStreamWriter.writeCharacters("This component requires an incoming relationship."); break; default: xmlStreamWriter.writeCharacters("This component does not have input requirement."); break; } } }
if(inputRequirement != null && inputRequirement.value().equals(Requirement.INPUT_FORBIDDEN)) { text += registry; } else {
&& ExpressionLanguageScope.FLOWFILE_ATTRIBUTES.equals(expressionLanguageScope) && (this.serviceLookup.getInputRequirement() == null || this.serviceLookup.getInputRequirement().value().equals(InputRequirement.Requirement.INPUT_FORBIDDEN))) { return;
&& ExpressionLanguageScope.FLOWFILE_ATTRIBUTES.equals(expressionLanguageScope) && (this.serviceLookup.getInputRequirement() == null || this.serviceLookup.getInputRequirement().value().equals(InputRequirement.Requirement.INPUT_FORBIDDEN))) { return;