public final class FileConverter extends AbstractConverter<File>
Converter
implementation for the
java.io.File
type.ParentDirectory
,
ConverterFactory.forFile(String)
Modifier and Type | Field and Description |
---|---|
static FileConverter |
DEFAULT
FileConverter default instance. |
Modifier and Type | Method and Description |
---|---|
protected <T> File |
doDecode(String value,
ValidationContext<T> context)
Returns
java.io.File object for the specified path. |
protected <T> String |
doEncode(File value,
ValidationContext<T> context)
Returns pathname for the specified
java.io.File object. |
String |
getMessageTemplate(ValidationContext<?> context)
FileConverter has no error message template. |
Class<File> |
getType()
Returns
java.io.File type. |
decode, encode
appendMessageArguments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendMessageArguments
public static final FileConverter DEFAULT
FileConverter
default instance.public String getMessageTemplate(ValidationContext<?> context)
FileConverter
has no error message template.getMessageTemplate
in interface Converter<File>
getMessageTemplate
in interface Validation<File>
getMessageTemplate
in class AbstractValidation<File>
context
- Validation context.null
.protected <T> File doDecode(String value, ValidationContext<T> context)
java.io.File
object for the specified path.
This method simply creates a java.io.File
object and is
not responsible for verifying the existence of a file.
doDecode
in class AbstractConverter<File>
T
- The type of validated entity.value
- File pathname.context
- Validation context.java.io.File
object for the specified path.protected <T> String doEncode(File value, ValidationContext<T> context)
java.io.File
object.doEncode
in class AbstractConverter<File>
T
- The type of validated entity.value
- java.io.File
object to be encoded.context
- Validation context.java.io.File
object.Copyright © 2011–2020 FoxLabs. All rights reserved.