/** * Indicates whether or not the component contains at least one property that supports Expression Language. * * @param component the component to interrogate * @return whether or not the component contains at least one sensitive property. */ private boolean containsExpressionLanguage(final ConfigurableComponent component) { for (PropertyDescriptor descriptor : component.getPropertyDescriptors()) { if (descriptor.isExpressionLanguageSupported()) { return true; } } return false; }
public MockValidationContext(final MockProcessContext processContext, final StateManager stateManager, final VariableRegistry variableRegistry) { this.context = processContext; this.stateManager = stateManager; this.variableRegistry = variableRegistry; final Map<PropertyDescriptor, String> properties = processContext.getProperties(); expressionLanguageSupported = new HashMap<>(properties.size()); for (final PropertyDescriptor descriptor : properties.keySet()) { expressionLanguageSupported.put(descriptor.getName(), descriptor.isExpressionLanguageSupported()); } }
public NotificationValidationContext(final NotificationContext processContext, VariableRegistry variableRegistry) { this.context = processContext; final Map<PropertyDescriptor, String> properties = processContext.getProperties(); expressionLanguageSupported = new HashMap<>(properties.size()); for (final PropertyDescriptor descriptor : properties.keySet()) { expressionLanguageSupported.put(descriptor.getName(), descriptor.isExpressionLanguageSupported()); } this.variableRegistry = variableRegistry; }
private MockPropertyValue(final String rawValue, final ControllerServiceLookup serviceLookup, final PropertyDescriptor propertyDescriptor, final boolean alreadyEvaluated, final VariableRegistry variableRegistry) { this.stdPropValue = new StandardPropertyValue(rawValue, serviceLookup, variableRegistry); this.rawValue = rawValue; this.serviceLookup = (MockControllerServiceLookup) serviceLookup; this.expectExpressions = propertyDescriptor == null ? null : propertyDescriptor.isExpressionLanguageSupported(); this.expressionLanguageScope = propertyDescriptor == null ? null : propertyDescriptor.getExpressionLanguageScope(); this.propertyDescriptor = propertyDescriptor; this.expressionsEvaluated = alreadyEvaluated; this.variableRegistry = variableRegistry; }
@Override public boolean isExpressionLanguagePresent(PropertyDescriptor property) { if (property == null || !property.isExpressionLanguageSupported()) { return false; } final List<Range> elRanges = Query.extractExpressionRanges(getProperty(property).getValue()); return (elRanges != null && !elRanges.isEmpty()); }
@Override public boolean isExpressionLanguagePresent(final PropertyDescriptor property) { if (property == null || !property.isExpressionLanguageSupported()) { return false; } final List<Range> elRanges = Query.extractExpressionRanges(getProperty(property).getValue()); return (elRanges != null && !elRanges.isEmpty()); }
public StandardValidationContext( final ControllerServiceProvider controllerServiceProvider, final Set<String> serviceIdentifiersToNotValidate, final Map<PropertyDescriptor, String> properties, final String annotationData, final String groupId, final String componentId, final VariableRegistry variableRegistry) { this.controllerServiceProvider = controllerServiceProvider; this.properties = new HashMap<>(properties); this.annotationData = annotationData; this.variableRegistry = variableRegistry; this.groupId = groupId; this.componentId = componentId; preparedQueries = new HashMap<>(properties.size()); for (final Map.Entry<PropertyDescriptor, String> entry : properties.entrySet()) { final PropertyDescriptor desc = entry.getKey(); String value = entry.getValue(); if (value == null) { value = desc.getDefaultValue(); } final PreparedQuery pq = Query.prepare(value); preparedQueries.put(desc, pq); } expressionLanguageSupported = new HashMap<>(properties.size()); for (final PropertyDescriptor descriptor : properties.keySet()) { expressionLanguageSupported.put(descriptor.getName(), descriptor.isExpressionLanguageSupported()); } }
@Override public boolean isExpressionLanguagePresent(final PropertyDescriptor property) { verifyTaskActive(); if (property == null || !property.isExpressionLanguageSupported()) { return false; } final List<Range> elRanges = Query.extractExpressionRanges(getProperty(property).getValue()); return (elRanges != null && !elRanges.isEmpty()); }
@OnEnabled public void onConfigured(final ConfigurationContext context) throws InitializationException { final Map<PropertyDescriptor, String> properties = context.getProperties(); properties.keySet().forEach(propertyDescriptor -> { if (propertyDescriptor.isExpressionLanguageSupported()) { properties.put(propertyDescriptor, context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue()); } }); credentialsProvider = credentialsProviderFactory.getCredentialsProvider(properties); getLogger().debug("Using credentials provider: " + credentialsProvider.getClass()); }
@Override protected Collection<ValidationResult> customValidate(ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); Validator validator = new RecordPathValidator(); Map<PropertyDescriptor, String> processorProperties = validationContext.getProperties(); for (final Map.Entry<PropertyDescriptor, String> entry : processorProperties.entrySet()) { PropertyDescriptor property = entry.getKey(); if (property.isDynamic() && property.isExpressionLanguageSupported()) { String dynamicValue = validationContext.getProperty(property).getValue(); if(!validationContext.isExpressionLanguagePresent(dynamicValue)) { results.add(validator.validate(property.getDisplayName(), dynamicValue, validationContext)); } } } return results; }
if (property.isExpressionLanguageSupported()) { xmlStreamWriter.writeEmptyElement("br"); String text = "Supports Expression Language: true";
String propertyValue = propertyDescriptor.isExpressionLanguageSupported() ? context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue() : context.getProperty(propertyDescriptor).getValue();
String propertyValue = propertyDescriptor.isExpressionLanguageSupported() ? context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue() : context.getProperty(propertyDescriptor).getValue();
String propertyValue = propertyDescriptor.isExpressionLanguageSupported() ? context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue() : context.getProperty(propertyDescriptor).getValue();
String propertyValue = propertyDescriptor.isExpressionLanguageSupported() ? context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue() : context.getProperty(propertyDescriptor).getValue();
String propertyValue = propertyDescriptor.isExpressionLanguageSupported() ? context.getProperty(propertyDescriptor).evaluateAttributeExpressions().getValue() : context.getProperty(propertyDescriptor).getValue();
for (final Map.Entry<PropertyDescriptor, String> entry : processorProperties.entrySet()) { PropertyDescriptor property = entry.getKey(); if (property.isDynamic() && property.isExpressionLanguageSupported()) { String dynamicValue = context.getProperty(property).evaluateAttributeExpressions().getValue(); generatedAttributes.put(property.getName(), dynamicValue);
for (final Map.Entry<PropertyDescriptor, String> entry : processorProperties.entrySet()) { PropertyDescriptor property = entry.getKey(); if (property.isDynamic() && property.isExpressionLanguageSupported()) { String path = context.getProperty(property).evaluateAttributeExpressions(flowFile).getValue(); if(StringUtils.isNotBlank(path)) {
dto.setDescription(propertyDescriptor.getDescription()); dto.setDefaultValue(propertyDescriptor.getDefaultValue()); dto.setSupportsEl(propertyDescriptor.isExpressionLanguageSupported()); String description = propertyDescriptor.isExpressionLanguageSupported() && propertyDescriptor.getExpressionLanguageScope().equals(ExpressionLanguageScope.NONE) ? "true (undefined scope)" : propertyDescriptor.getExpressionLanguageScope().getDescription();
private void writeProperty(final PropertyDescriptor property) throws IOException { writeStartElement("property"); writeTextElement("name", property.getName()); writeTextElement("displayName", property.getDisplayName()); writeTextElement("description", property.getDescription()); writeTextElement("defaultValue", property.getDefaultValue()); writeTextElement("controllerServiceDefinition", property.getControllerServiceDefinition() == null ? null : property.getControllerServiceDefinition().getName()); writeTextArray("allowableValues", "allowableValue", property.getAllowableValues(), AllowableValue::getDisplayName); writeBooleanElement("required", property.isRequired()); writeBooleanElement("sensitive", property.isSensitive()); writeBooleanElement("expressionLanguageSupported", property.isExpressionLanguageSupported()); writeTextElement("expressionLanguageScope", property.getExpressionLanguageScope() == null ? null : property.getExpressionLanguageScope().name()); writeBooleanElement("dynamicallyModifiesClasspath", property.isDynamicClasspathModifier()); writeBooleanElement("dynamic", property.isDynamic()); writeEndElement(); }