public class ImageFromURLPropertyType extends DerivedFromSinglePropertyType<URL,BufferedImage> implements MarkerPathPropertyType
Property<URL> URL_PROPERTY = new Property<File>("url.property", new URLPropertyType()); Property<BufferedImage> IMAGE_PROPERTY new Property<BufferedImage>("app.my.image.stream",new ImageFromURLPropertyType(URL_PROPERTY));
Modifier and Type | Field and Description |
---|---|
static String |
TYPE
The type name string constant of ImageFromUrl implementation.
|
Constructor and Description |
---|
ImageFromURLPropertyType(Property<URL> derivedFromUrl)
Constructor where default value is
null . |
ImageFromURLPropertyType(Property<URL> derivedFromUrl,
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 ImageIO via an URL.
|
getDerivedFromProperty, getDerivedFromPropertyValue
getDerivedFrom, getDerivedFromCount, getDerivedFromProperty, getDerivedFromRestrictions, getMaxDerivedFrom, getMinDerivedFrom, getRestrictions, isMinAndMaxTheSame, isUseMaxDerivedFrom, isUseMinDerivedFrom, validateValue
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateNullType
public static final String TYPE
public ImageFromURLPropertyType(Property<URL> derivedFromUrl)
null
.derivedFromUrl
- the Property which provides the URL path.public ImageFromURLPropertyType(Property<URL> derivedFromUrl, BufferedImage defaultValue)
derivedFromUrl
- the Property which provides the URL path.defaultValue
- the default value of the BufferedImage.public List<String> getDerivedToRestrictions()
DerivedPropertyType
getDerivedToRestrictions
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(URL)
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()