Class InputDescriptor.UrlInputBuilder
java.lang.Object
se.conciliate.extensions.documents.InputDescriptor.UrlInputBuilder
- Enclosing class:
- InputDescriptor<T extends MetaData>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddSupportedSchema
(String schema) build()
connectTo
(MetaDataType<?> t, BiFunction<MetaData<?>, MetaData<?>, MetaData<?>> onChange) “Connects the InputDescriptor built by this builder to the given MetaDataType so that when metadata for the InputDescriptor built by this builder is changed, the given BiFunction is applied (called) with both the changed metadata and the connected metadata.setPrefixes
(List<InputDescriptor.UrlPrefix> prefixes) setSupportedSchemas
(List<String> schemas) validator
(Validator<MetaData.UrlValue> validator) Puts a validator on the descriptor.
-
Field Details
-
descriptor
-
-
Method Details
-
addSupportedSchema
-
setSupportedSchemas
-
addUrlPrefix
-
setPrefixes
-
connectTo
public InputDescriptor.UrlInputBuilder connectTo(MetaDataType<?> t, BiFunction<MetaData<?>, MetaData<?>, MetaData<?>> onChange) “Connects the InputDescriptor built by this builder to the given MetaDataType so that when metadata for the InputDescriptor built by this builder is changed, the given BiFunction is applied (called) with both the changed metadata and the connected metadata. The connected metadata is then updated with the result of the BiFunction. This means that one metadata can change as a result of another metadata changing. For example, one can connect the URL metadata to an Image metadata so that when the URL of a document changes from “http://example.com/mydoc.pdf” to “http://example.com/mydoc.docx” the icon of the document changes from a pdf-icon to a docx-icon.”- Parameters:
t
- The connected MetaDataType.onChange
- The two metadata that will be connected and changed as a result of the other metadata changing.- Returns:
- Returns this UrlInputBuilder
-
validator
Puts a validator on the descriptor. The validator will be called on some arbitrary non-ui thread and must therefore be thread safe. The validator takes a string to validate. The validator returns:-
ValidationResult.success()
if validation succeeds -
ValidationResult.error(String)
if validation fails and is binding (data cannot be saved) -
ValidationResult.success()
if validation fails and is non-binding (data can be saved)
- Parameters:
validator
- A validator or null to use no validator.- Returns:
- This builder for chaining.
-
-
build
-