public static final class PropertyDescriptor.Builder extends Object
Modifier and Type | Field and Description |
---|---|
private List<AllowableValue> |
allowableValues |
private Class<? extends ControllerService> |
controllerServiceDefinition |
private String |
defaultValue |
private Set<PropertyDependency> |
dependencies |
private String |
description |
private String |
displayName |
private boolean |
dynamic |
private boolean |
dynamicallyModifiesClasspath |
private ExpressionLanguageScope |
expressionLanguageScope |
private boolean |
expressionLanguageSupported
Deprecated.
|
private String |
name |
private boolean |
required |
private ResourceDefinition |
resourceDefinition |
private boolean |
sensitive |
private List<Validator> |
validators |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
PropertyDescriptor.Builder |
addValidator(Validator validator) |
PropertyDescriptor.Builder |
allowableValues(AllowableValue... values)
Sets the Allowable Values for this Property
|
<E extends Enum<E> & DescribedValue> |
allowableValues(Class<E> enumClass)
Stores allowable values from an enum class.
|
<E extends Enum<E>> |
allowableValues(E[] values) |
PropertyDescriptor.Builder |
allowableValues(Set<String> values) |
PropertyDescriptor.Builder |
allowableValues(String... values) |
PropertyDescriptor |
build() |
PropertyDescriptor.Builder |
defaultValue(String value)
Specifies the initial value and the default value that will be used
if the user does not specify a value.
|
PropertyDescriptor.Builder |
dependsOn(PropertyDescriptor property,
AllowableValue... dependentValues)
Establishes a relationship between this Property and the given property by declaring that this Property is only relevant if the given Property has a non-null value.
|
PropertyDescriptor.Builder |
dependsOn(PropertyDescriptor property,
String firstDependentValue,
String... additionalDependentValues)
Establishes a relationship between this Property and the given property by declaring that this Property is only relevant if the given Property has a value equal to one of the given
String arguments. |
PropertyDescriptor.Builder |
description(String description) |
PropertyDescriptor.Builder |
displayName(String displayName)
Sets a unique id for the property.
|
PropertyDescriptor.Builder |
dynamic(boolean dynamic) |
PropertyDescriptor.Builder |
dynamicallyModifiesClasspath(boolean dynamicallyModifiesClasspath)
Specifies that the value of this property represents one or more resources that the
framework should add to the classpath of as well as consider when looking for native
libraries for the given component.
|
PropertyDescriptor.Builder |
expressionLanguageSupported(boolean supported)
Deprecated.
|
PropertyDescriptor.Builder |
expressionLanguageSupported(ExpressionLanguageScope expressionLanguageScope)
Sets the scope of the expression language evaluation
|
PropertyDescriptor.Builder |
fromPropertyDescriptor(PropertyDescriptor specDescriptor) |
PropertyDescriptor.Builder |
identifiesControllerService(Class<? extends ControllerService> controllerServiceDefinition)
Specifies that this property provides the identifier of a Controller
Service that implements the given interface
|
PropertyDescriptor.Builder |
identifiesExternalResource(ResourceCardinality cardinality,
ResourceType resourceType,
ResourceType... additionalResourceTypes)
Specifies that this property references one or more resources that are external to NiFi that the component is meant to consume.
|
private boolean |
isValueAllowed(String value) |
PropertyDescriptor.Builder |
name(String name)
Sets the property name.
|
PropertyDescriptor.Builder |
required(boolean required) |
PropertyDescriptor.Builder |
sensitive(boolean sensitive) |
private String displayName
private String name
private String description
private String defaultValue
private List<AllowableValue> allowableValues
private Set<PropertyDependency> dependencies
private boolean required
private boolean sensitive
@Deprecated private boolean expressionLanguageSupported
private ExpressionLanguageScope expressionLanguageScope
private boolean dynamic
private boolean dynamicallyModifiesClasspath
private Class<? extends ControllerService> controllerServiceDefinition
private ResourceDefinition resourceDefinition
public PropertyDescriptor.Builder fromPropertyDescriptor(PropertyDescriptor specDescriptor)
public PropertyDescriptor.Builder displayName(String displayName)
displayName
- of the propertypublic PropertyDescriptor.Builder name(String name)
name
- of the property@Deprecated public PropertyDescriptor.Builder expressionLanguageSupported(boolean supported)
supported
- true if yes; false otherwisepublic PropertyDescriptor.Builder expressionLanguageSupported(ExpressionLanguageScope expressionLanguageScope)
expressionLanguageScope
- scope of the expression language evaluationpublic PropertyDescriptor.Builder description(String description)
description
- of the propertypublic PropertyDescriptor.Builder defaultValue(String value)
build()
is
called, if Allowable Values have been set (see
allowableValues(AllowableValue...)
) and this value is not
one of those Allowable Values and Exception will be thrown. If the
Allowable Values have been set using the
allowableValues(AllowableValue...)
method, the default value
should be set to the "Value" of the AllowableValue
object
(see AllowableValue.getValue()
).value
- default valuepublic PropertyDescriptor.Builder dynamic(boolean dynamic)
public PropertyDescriptor.Builder dynamicallyModifiesClasspath(boolean dynamicallyModifiesClasspath)
Class.forName(String, boolean, ClassLoader)
for example).
Any property descriptor that dynamically modifies the classpath should also make use of the identifiesExternalResource(ResourceCardinality, ResourceType, ResourceType...)
method
to indicate that the property descriptor references external resources and optionally restrict which types of resources and how many resources the property allows.dynamicallyModifiesClasspath
- whether or not this property should be used by the framework to modify the classpathpublic PropertyDescriptor.Builder allowableValues(Set<String> values)
values
- contrained set of valuespublic <E extends Enum<E>> PropertyDescriptor.Builder allowableValues(E[] values)
public <E extends Enum<E> & DescribedValue> PropertyDescriptor.Builder allowableValues(Class<E> enumClass)
E
- generic parameter for an enum class that implements the Allowable interfaceenumClass
- an enum class that implements the Allowable interface and contains a set of valuespublic PropertyDescriptor.Builder allowableValues(String... values)
values
- constrained set of valuespublic PropertyDescriptor.Builder allowableValues(AllowableValue... values)
values
- contrained set of valuespublic PropertyDescriptor.Builder required(boolean required)
required
- true if yes; false otherwisepublic PropertyDescriptor.Builder sensitive(boolean sensitive)
sensitive
- true if sensitive; false otherwisepublic PropertyDescriptor.Builder addValidator(Validator validator)
validator
- for the propertypublic PropertyDescriptor.Builder identifiesControllerService(Class<? extends ControllerService> controllerServiceDefinition)
controllerServiceDefinition
- the interface that is implemented
by the Controller Serviceprivate boolean isValueAllowed(String value)
public PropertyDescriptor.Builder identifiesExternalResource(ResourceCardinality cardinality, ResourceType resourceType, ResourceType... additionalResourceTypes)
identifiesExternalResource(ResourceCardinality.SINGLE, ResourceType.FILE)
is used, the input must be a regular file. If identifiesExternalResource(ResourceCardinality.SINGLE, ResourceType.FILE, ResourceType.DIRECTORY)
is used, then the input
must be exactly one file OR directory.
dynamicallyModifiesClasspath(boolean)
method to dynamically update its classpath should also
make use of this method, specifying which types of resources are allowed and how many.cardinality
- specifies how many resources the property should allowresourceType
- the type of resource that is allowedadditionalResourceTypes
- if more than one type of resource is allowed, any resource type in addition to the given resource type may be providedpublic PropertyDescriptor.Builder dependsOn(PropertyDescriptor property, AllowableValue... dependentValues)
property
- the property that must be set in order for this property to become relevantdependentValues
- the possible values for the given property for which this Property is relevantpublic PropertyDescriptor.Builder dependsOn(PropertyDescriptor property, String firstDependentValue, String... additionalDependentValues)
String
arguments.
If this method is called multiple times, each with a different dependency, then a relationship is established such that this Property is relevant only if all dependencies are satisfied.
In the case that this property is NOT considered to be relevant (meaning that it depends on a property whose value is not specified, or whose value does not match one of the given
Allowable Values), the property will not be shown in the component's configuration in the User Interface. Additionally, this property's value will not be considered for
validation. That is, if this property is configured with an invalid value and this property depends on Property Foo, and Property Foo does not have a value set, then the component
will still be valid, because the value of this property is irrelevant.
If the given property is not relevant (because its dependencies are not satisfied), this property is also considered not to be valid.property
- the property that must be set in order for this property to become relevantfirstDependentValue
- the first value for the given property for which this Property is relevantadditionalDependentValues
- any other values for the given property for which this Property is relevantpublic PropertyDescriptor build()
IllegalStateException
- if allowable values are configured but
no default value is set, or the default value is not contained within
the allowable values.Copyright © 2022 Apache NiFi Project. All rights reserved.