Class FileListDescriptor.Builder
java.lang.Object
de.xima.fc.workflow.FileListDescriptor.Builder
- Enclosing class:
FileListDescriptor
Builder for
FileListDescriptor.- Since:
- 8.2.0
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String name, Object value) Adds an attribute to the file list descriptor.addAttributes(Map<String, Object> attributes) Adds all attributes from the given map to the file list descriptor.attributes(Map<String, Object> attributes) Sets (replaces) all attributes of the file list descriptor.build()Builds a newFileListDescriptorwith the data set in this builder.contentTypes(String... contentTypes) Adds content types that are allowed for the files.contentTypes(Set<String> contentTypes) Adds content types that are allowed for the files.description(String description) Deprecated.descriptionHtml(boolean descriptionHtml) Deprecated.UseaddAttribute(String, Object)with the keyVALUE_DESCRIPTOR_ATTR_DESCRIPTION_CONTENTand the valueVALUE_DESCRIPTOR_ATTR_MESSAGE_TYPE_HTMLorVALUE_DESCRIPTOR_ATTR_MESSAGE_TYPE_TEXTdescriptionI18nKey(boolean descriptionI18nKey) Deprecated.extensions(String... extensions) Adds file extensions that are allowed for the files.extensions(Set<String> extensions) Adds file extensions that are allowed for the files.fileCount(int minFileCount, int maxFileCount) maxFileCount(int maxFileCount) Sets the maximum number of files that can be provided.minFileCount(int minFileCount) Sets the minimum number of files that must be provided.
-
Method Details
-
addAttribute
Adds an attribute to the file list descriptor. If value is null, the attribute is removed.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Parameters:
name- The name of the attribute.value- The value of the attribute.- Returns:
- This builder for chaining method calls.
- See Also:
-
addAttributes
Adds all attributes from the given map to the file list descriptor. If attributes is null, nothing is added.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Parameters:
attributes- The attributes to add.- Returns:
- This builder for chaining method calls.
- See Also:
-
attributes
Sets (replaces) all attributes of the file list descriptor. If attributes is null, all attributes are removed.See
StandardValueDescriptorAttributesfor some standard attribute keys and values you can use.- Parameters:
attributes- The new attributes to set.- Returns:
- This builder for chaining method calls.
- See Also:
-
build
Builds a newFileListDescriptorwith the data set in this builder. Any modifications to this builder after calling this method will not affect the returned descriptor.- Returns:
- A new descriptor with the data set in this builder.
-
contentTypes
Adds content types that are allowed for the files. Use a singleton set with "*/*" to allow all content types. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no content types. Defaults to a singleton set with "*/*".- Parameters:
contentTypes- The content types that are allowed for the files.- Returns:
- This builder for chaining method calls.
-
contentTypes
Adds content types that are allowed for the files. Use a singleton set with "*/*" to allow all content types. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no content types. Defaults to a singleton set with "*/*".- Parameters:
contentTypes- The content types that are allowed for the files.- Returns:
- This builder for chaining method calls.
-
description
Deprecated.UseaddAttribute(String, Object)with the keyVALUE_DESCRIPTOR_ATTR_DESCRIPTION.Sets the I18n key pointing to a description for the file.- Parameters:
description- The description for the file. It's interpretation depends onIFileListDescriptor.isDescriptionI18nKey()andIFileListDescriptor.isDescriptionHtml().- Returns:
- This builder for chaining method calls.
-
descriptionHtml
Deprecated.UseaddAttribute(String, Object)with the keyVALUE_DESCRIPTOR_ATTR_DESCRIPTION_CONTENTand the valueVALUE_DESCRIPTOR_ATTR_MESSAGE_TYPE_HTMLorVALUE_DESCRIPTOR_ATTR_MESSAGE_TYPE_TEXTSets whether the description is an HTML string. When false, the description is treated as plain text. Defaults to false.- Parameters:
descriptionHtml- Whether the description is an HTML string.- Returns:
- This builder for chaining method calls.
-
descriptionI18nKey
Deprecated.Sets whether the description is an I18N key that needs to be looked up in a resource bundle. When false, the description is used as-is. Defaults to true.- Parameters:
descriptionI18nKey- Whether the description is an I18N string.- Returns:
- This builder for chaining method calls.
-
extensions
Adds file extensions that are allowed for the files. Use the empty string to allow files without an extension. Use a singleton set with "*" to allow all files. An empty set allows no files. Defaults to a singleton set with "*".- Parameters:
extensions- The file extensions that are allowed for the files, without leading dot.- Returns:
- This builder for chaining method calls.
-
extensions
Adds file extensions that are allowed for the files. Use the empty string to allow files without an extension. Use a singleton set with "*" to allow all files. An empty set allows no files. Defaults to a singleton set with "*".- Parameters:
extensions- The file extensions that are allowed for the files, without leading dot.- Returns:
- This builder for chaining method calls.
-
fileCount
-
maxFileCount
Sets the maximum number of files that can be provided.- Parameters:
maxFileCount- The maximum number of files that can be provided.- Returns:
- This builder for chaining method calls.
-
minFileCount
Sets the minimum number of files that must be provided.- Parameters:
minFileCount- The minimum number of files that must be provided.- Returns:
- This builder for chaining method calls.
-
addAttribute(String, Object)with the keyVALUE_DESCRIPTOR_ATTR_DESCRIPTION.