Package de.xima.fc.workflow
Class FileListDescriptor
- java.lang.Object
-
- de.xima.fc.workflow.FileListDescriptor
-
- All Implemented Interfaces:
IFileListDescriptor,Serializable
public final class FileListDescriptor extends Object implements IFileListDescriptor
Basic POJO implementation ofIFileListDescriptorwith a builder.- Since:
- 8.2.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileListDescriptor.BuilderBuilder forFileListDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IFileListDescriptorany()Returns anIFileListDescriptorthat allows any file type and any number of files.IFileListBuilderbuilder()Creates a new builder for configuring a file list conforming to this descriptor.static IFileListDescriptorempty()Returns an emptyIFileListDescriptorthat does not allow any files.static FileListDescriptor.BuilderfileListDescriptorBuilder()Creates a new builder forFileListDescriptor.Set<String>getContentTypes()The content types of the files that might be contained in the list of files.StringgetDescription()Gets the description for the file.intgetMaxFileCount()The maximum number of files that will be contained in the list of files.intgetMinFileCount()The minimum number of files that are contained in the list of files.IFileListDescriptorintersect(IFileListDescriptor other)Intersects this file list descriptor with another file list descriptor.booleanisDescriptionHtml()Whether theIFileListDescriptor.getDescription()is an HTML string (make sure it's valid and properly escaped!).booleanisDescriptionI18nKey()Whether theIFileListDescriptor.getDescription()is an I18N key that needs to be looked up in a resource bundle.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IFileListDescriptor
allowsAnyFiles
-
-
-
-
Method Detail
-
builder
public IFileListBuilder builder()
Description copied from interface:IFileListDescriptorCreates a new builder for configuring a file list conforming to this descriptor.- Specified by:
builderin interfaceIFileListDescriptor- Returns:
- A new builder for configuring a file list conforming to this descriptor.
-
getContentTypes
public Set<String> getContentTypes()
Description copied from interface:IFileListDescriptorThe content types of the files that might be contained in the list of files. Each content type is a MIME type. Use "*/*" when the content type is unknown or any type of file might be contained in the list. An empty set allows no files.null is treated as if the empty set had been returned.
- Specified by:
getContentTypesin interfaceIFileListDescriptor- Returns:
- The content types of the files that might be contained in the list of files.
-
getDescription
public String getDescription()
Description copied from interface:IFileListDescriptorGets the description for the file. Can be either a localized message or an I18N key.- Specified by:
getDescriptionin interfaceIFileListDescriptor- Returns:
- I18n key pointing to a description for the file.
-
getMaxFileCount
public int getMaxFileCount()
Description copied from interface:IFileListDescriptorThe maximum number of files that will be contained in the list of files.MAX_VALUEwhen there is no limit.- Specified by:
getMaxFileCountin interfaceIFileListDescriptor- Returns:
- The maximum number of files that will be contained in the list of files.
-
getMinFileCount
public int getMinFileCount()
Description copied from interface:IFileListDescriptorThe minimum number of files that are contained in the list of files. 0 when the list might be empty, 1 if the list will contain at least one file.- Specified by:
getMinFileCountin interfaceIFileListDescriptor- Returns:
- The minimum number of files that are contained in the list of files.
-
intersect
public IFileListDescriptor intersect(IFileListDescriptor other)
Description copied from interface:IFileListDescriptorIntersects this file list descriptor with another file list descriptor. The intersection of two file list descriptors is a new file list descriptor that only allows files that are allowed by both file list descriptors. When the two file list descriptors are incompatible, returns anemptydescriptor.- Specified by:
intersectin interfaceIFileListDescriptor- Parameters:
other- The other file list descriptor to intersect with.- Returns:
- The intersection of this file list descriptor with the other file list descriptor.
-
isDescriptionHtml
public boolean isDescriptionHtml()
Description copied from interface:IFileListDescriptorWhether theIFileListDescriptor.getDescription()is an HTML string (make sure it's valid and properly escaped!). When false, the description is treated as plain text.- Specified by:
isDescriptionHtmlin interfaceIFileListDescriptor- Returns:
- Whether the description is an HTML string.
-
isDescriptionI18nKey
public boolean isDescriptionI18nKey()
Description copied from interface:IFileListDescriptorWhether theIFileListDescriptor.getDescription()is an I18N key that needs to be looked up in a resource bundle. When false, the description value is used as-is.- Specified by:
isDescriptionI18nKeyin interfaceIFileListDescriptor- Returns:
- Whether the description is an I18N key (true) or a plain text description (false).
-
any
public static IFileListDescriptor any()
Returns anIFileListDescriptorthat allows any file type and any number of files.- Returns:
- A descriptor that allows any file type and any number of files.
-
empty
public static IFileListDescriptor empty()
Returns an emptyIFileListDescriptorthat does not allow any files.- Returns:
- An empty descriptor that does not allow any files.
-
fileListDescriptorBuilder
public static FileListDescriptor.Builder fileListDescriptorBuilder()
Creates a new builder forFileListDescriptor.- Returns:
- A new builder for a file list descriptor.
-
-