public class ImageFromFilePropertyType extends DerivedFromSinglePropertyType<File,BufferedImage> implements MarkerPathPropertyType
Property<File> FILE_PROPERTY = new Property<File>("app.my.byte.file",new FilePropertyType());
Property<BufferedImage> IMAGE_PROPERTY new Property<BufferedImage>("app.my.image.stream",new ImageFromFilePropertyType(FILE_PROPERTY));
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The type name string constant of ImageFromFile implementation.
|
| Constructor and Description |
|---|
ImageFromFilePropertyType(Property<File> derivedFromFile)
Constructor where default value is
null. |
ImageFromFilePropertyType(Property<File> derivedFromFile,
BufferedImage defaultValue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getDerivedToRestrictions()
Gets a detailed description of the "Derived->TO->PropertyType" with any constraints that might influence the validation.
Without any futher description of of the properties it is derived from, this is taken care of in the method "getDerivedFromRestrictions". |
void |
validateConstraints(String propertyName)
No constraints.
|
BufferedImage |
validateDerivedValue(String propertyName)
Loads a BufferedImage from a file
|
getDerivedFromProperty, getDerivedFromPropertyValuegetDerivedFrom, getDerivedFromCount, getDerivedFromProperty, getDerivedFromRestrictions, getMaxDerivedFrom, getMinDerivedFrom, getRestrictions, isMinAndMaxTheSame, isUseMaxDerivedFrom, isUseMinDerivedFrom, validateValueequals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateNullTypepublic static final String TYPE
public ImageFromFilePropertyType(Property<File> derivedFromFile)
null.derivedFromFile - the Property which provides the file path.public ImageFromFilePropertyType(Property<File> derivedFromFile, BufferedImage defaultValue)
derivedFromFile - the Property which provides the file path.defaultValue - the default value of the BufferedImage.public List<String> getDerivedToRestrictions()
DerivedPropertyTypegetDerivedToRestrictions in class DerivedPropertyType<BufferedImage>public BufferedImage validateDerivedValue(String propertyName) throws PropertyException
validateDerivedValue in class DerivedPropertyType<BufferedImage>propertyName - the name of derived PropertyPropertyException - if it could not be converted into type T.ImageIO.read(File)public void validateConstraints(String propertyName) throws PropertyException
validateConstraints in class DerivedPropertyType<BufferedImage>propertyName - the name of the property used for logging purposes, to
identify the unique property which PropertyType has constraint
issues.PropertyException - if the constraints have invalid/conflicting values.Property.validate()