diff --git a/nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java b/nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java
index 7b382f6eb4..532a0344d5 100644
--- a/nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java
+++ b/nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java
@@ -26,7 +26,7 @@ import java.util.Set;
import org.apache.nifi.controller.ControllerService;
/**
- * An immutable object for holding information about a type of processor
+ * An immutable object for holding information about a type of component
* property.
*
*/
diff --git a/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java b/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
index edaddd7d55..666ada5539 100644
--- a/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
+++ b/nifi-api/src/main/java/org/apache/nifi/components/PropertyValue.java
@@ -24,6 +24,7 @@ import org.apache.nifi.expression.AttributeValueDecorator;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.processor.DataUnit;
import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.registry.VariableRegistry;
/**
*
@@ -121,144 +122,183 @@ public interface PropertyValue {
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language; a PropertyValue with the new value is then returned, supporting
- * call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language;
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
* @return a PropertyValue with the new value is returned, supporting call
* chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions() throws ProcessException;
/**
*
* Replaces values in the Property Value using the NiFi Expression Language;
- * a PropertyValue with the new value is then returned, supporting call chaining.
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param attributes a Map of attributes that the Expression can reference, in addition
- * to JVM System Properties and Environmental Properties.
+ * @param attributes a Map of attributes that the Expression can reference.
+ * These will take precedence over any underlying variable registry values.
*
* @return a PropertyValue with the new value
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating the Expression against
- * the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(Map attributes) throws ProcessException;
/**
*
* Replaces values in the Property Value using the NiFi Expression Language.
- * The supplied decorator is then given a chance to decorate the
- * value, and a PropertyValue with the new value is then returned,
- * supporting call chaining.
+ * The supplied decorator is then given a chance to decorate the value, and
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param attributes a Map of attributes that the Expression can reference, in addition
- * to JVM System Properties and Environmental Properties.
- * @param decorator the decorator to use in order to update the values returned by the Expression Language
+ * @param attributes a Map of attributes that the Expression can reference.
+ * These will take precedence over any variables in any underlying variable
+ * registry.
+ * @param decorator the decorator to use in order to update the values
+ * returned after variable substitution and expression language evaluation.
*
* @return a PropertyValue with the new value
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating the Expression against
- * the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(Map attributes, AttributeValueDecorator decorator) throws ProcessException;
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language; a PropertyValue with the new value is then returned, supporting
- * call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language;
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param flowFile to evaluate attributes of
+ * @param flowFile to evaluate attributes of. It's flow file properties and
+ * then flow file attributes will take precedence over any underlying
+ * variable registry.
* @return a PropertyValue with the new value is returned, supporting call
* chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(FlowFile flowFile) throws ProcessException;
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language; a PropertyValue with the new value is then returned, supporting
- * call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language;
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param flowFile to evaluate attributes of
- * @param additionalAttributes a Map of additional attributes that the Expression can reference. If entries in
- * this Map conflict with entries in the FlowFile's attributes, the entries in this Map are given a higher priority.
+ * @param flowFile to evaluate attributes of. It's flow file properties and
+ * then flow file attributes will take precedence over any underlying
+ * variable registry.
+ * @param additionalAttributes a Map of additional attributes that the
+ * Expression can reference. These attributes will take precedence over any
+ * conflicting attributes in the provided flowfile or any underlying
+ * variable registry.
*
* @return a PropertyValue with the new value is returned, supporting call
* chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map additionalAttributes) throws ProcessException;
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language; a PropertyValue with the new value is then returned, supporting
- * call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language;
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param flowFile to evaluate attributes of
- * @param additionalAttributes a Map of additional attributes that the Expression can reference. If entries in
- * this Map conflict with entries in the FlowFile's attributes, the entries in this Map are given a higher priority.
- * @param decorator the decorator to use in order to update the values returned by the Expression Language
+ * @param flowFile to evaluate attributes of. It's flow file properties and
+ * then flow file attributes will take precedence over any underlying
+ * variable registry.
+ * @param additionalAttributes a Map of additional attributes that the
+ * Expression can reference. These attributes will take precedence over any
+ * conflicting attributes in the provided flowfile or any underlying
+ * variable registry.
+ * @param decorator the decorator to use in order to update the values
+ * returned after variable substitution and expression language evaluation.
*
* @return a PropertyValue with the new value is returned, supporting call
* chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(FlowFile flowFile, Map additionalAttributes, AttributeValueDecorator decorator) throws ProcessException;
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language. The supplied decorator is then given a chance to decorate the
- * value, and a PropertyValue with the new value is then returned,
- * supporting call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language.
+ * The supplied decorator is then given a chance to decorate the value, and
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
- * @param decorator The supplied decorator is then given a chance to
- * decorate the value
+ * @param decorator the decorator to use in order to update the values
+ * returned after variable substitution and expression language evaluation.
* @return a PropertyValue with the new value is then returned, supporting
* call chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(AttributeValueDecorator decorator) throws ProcessException;
/**
*
- * Replaces values in the Property Value using the NiFi Expression
- * Language. The supplied decorator is then given a chance to decorate the
- * value, and a PropertyValue with the new value is then returned,
- * supporting call chaining.
+ * Replaces values in the Property Value using the NiFi Expression Language.
+ * The supplied decorator is then given a chance to decorate the value, and
+ * a PropertyValue with the new value is then returned, supporting call
+ * chaining. Before executing the expression language statement any
+ * variables names found within any underlying {@link VariableRegistry} will
+ * be substituted with their values.
*
*
* @param flowFile to evaluate expressions against
- * @param decorator The supplied decorator is then given a chance to
- * decorate the value
+ * @param decorator the decorator to use in order to update the values
+ * returned after variable substitution and expression language evaluation.
+ *
*
* @return a PropertyValue with the new value is then returned, supporting
* call chaining
*
- * @throws ProcessException if the Expression cannot be compiled or evaluating
- * the Expression against the given attributes causes an Exception to be thrown
+ * @throws ProcessException if the Expression cannot be compiled or
+ * evaluating the Expression against the given attributes causes an
+ * Exception to be thrown
*/
PropertyValue evaluateAttributeExpressions(FlowFile flowFile, AttributeValueDecorator decorator) throws ProcessException;
}
diff --git a/nifi-api/src/main/java/org/apache/nifi/expression/AttributeExpression.java b/nifi-api/src/main/java/org/apache/nifi/expression/AttributeExpression.java
index ed409ea2ad..1cd3d5ce4f 100644
--- a/nifi-api/src/main/java/org/apache/nifi/expression/AttributeExpression.java
+++ b/nifi-api/src/main/java/org/apache/nifi/expression/AttributeExpression.java
@@ -18,32 +18,37 @@ package org.apache.nifi.expression;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.registry.VariableRegistry;
+/**
+ * Defines a type of expression language statement that can be applied
+ * parameterized by various attributes and properties as specified in each of
+ * the method calls. AttributeExpression evaluations may be also backed by a
+ * {@link VariableRegistry} used to substitute attributes and variables found in
+ * the expression for which the registry has a value.
+ */
public interface AttributeExpression {
/**
- * @return Evaluates the expression without providing any FlowFile Attributes. This
- * will evaluate the expression based only on System Properties and JVM
- * Environment properties
+ * @return Evaluates the expression without any additional attributes.
* @throws ProcessException if unable to evaluate
*/
String evaluate() throws ProcessException;
/**
- * Evaluates the expression without providing any FlowFile Attributes. This
- * will evaluate the expression based only on System Properties and JVM
- * Environment properties but allows the values to be decorated
+ * Evaluates the expression without additional attributes but enables the
+ * expression result to be decorated before returning.
*
- * @param decorator for attribute value
+ * @param decorator to execute on the resulting expression value
* @return evaluated value
* @throws ProcessException if failure in evaluation
*/
String evaluate(AttributeValueDecorator decorator) throws ProcessException;
/**
- * Evaluates the expression, providing access to the attributes, file size,
- * id, etc. of the given FlowFile, as well as System Properties and JVM
- * Environment properties
+ * Evaluates the expression providing access to additional variables
+ * including the flow file properties such as file size, identifier, etc..
+ * and also all of the flow file attributes.
*
* @param flowFile to evaluate
* @return evaluated value
@@ -52,9 +57,11 @@ public interface AttributeExpression {
String evaluate(FlowFile flowFile) throws ProcessException;
/**
- * Evaluates the expression, providing access to the attributes, file size,
- * id, etc. of the given FlowFile, as well as System Properties and JVM
- * Environment properties and allows the values to be decorated
+ * Evaluates the expression providing access to additional variables
+ * including the flow file properties such as file size, identifier, etc..
+ * and also all of the flow file attributes. The resulting value after
+ * executing any variable substitution and expression evaluation is run
+ * through the given decorator and returned.
*
* @param flowFile to evaluate
* @param decorator for evaluation
diff --git a/nifi-api/src/main/java/org/apache/nifi/expression/AttributeValueDecorator.java b/nifi-api/src/main/java/org/apache/nifi/expression/AttributeValueDecorator.java
index 4cea248961..b2500dd99a 100644
--- a/nifi-api/src/main/java/org/apache/nifi/expression/AttributeValueDecorator.java
+++ b/nifi-api/src/main/java/org/apache/nifi/expression/AttributeValueDecorator.java
@@ -16,12 +16,11 @@
*/
package org.apache.nifi.expression;
+@FunctionalInterface
public interface AttributeValueDecorator {
/**
- * Decorates the value of a FlowFile Attribute or System/JVM property in
- * some way
- *
+ * Decorates the given value
* @param attributeValue to decorate
* @return decorated value
*/
diff --git a/nifi-api/src/main/java/org/apache/nifi/registry/FileVariableRegistry.java b/nifi-api/src/main/java/org/apache/nifi/registry/FileVariableRegistry.java
deleted file mode 100644
index 9d77d6c027..0000000000
--- a/nifi-api/src/main/java/org/apache/nifi/registry/FileVariableRegistry.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Map;
-
-
-abstract class FileVariableRegistry extends MultiMapVariableRegistry {
-
- FileVariableRegistry() {
- super();
- }
-
- FileVariableRegistry(File... files) throws IOException{
- super();
- addVariables(files);
- }
-
- FileVariableRegistry(Path... paths) throws IOException{
- super();
- addVariables(paths);
- }
-
- private void addVariables(File ...files) throws IOException{
- if(files != null) {
- for (final File file : files) {
- Map map = convertFile(file);
- if(map != null) {
- registry.addMap(convertFile(file));
- }
- }
-
- }
- }
-
- private void addVariables(Path ...paths) throws IOException{
- if(paths != null) {
- for (final Path path : paths) {
- Map map = convertFile(path.toFile());
- if(map != null) {
- registry.addMap(map);
- }
- }
- }
- }
-
- protected abstract Map convertFile(File file) throws IOException;
-
-}
diff --git a/nifi-api/src/main/java/org/apache/nifi/registry/ImmutableMultiMap.java b/nifi-api/src/main/java/org/apache/nifi/registry/ImmutableMultiMap.java
deleted file mode 100644
index 2fba560397..0000000000
--- a/nifi-api/src/main/java/org/apache/nifi/registry/ImmutableMultiMap.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class ImmutableMultiMap implements Map {
-
- private final List