public class BytesFromFilePropertyType extends DerivedFromSinglePropertyType<File,byte[]> implements MarkerPathPropertyType
Property<File> FILE_PROPERTY = new Property<File>("app.my.byte.file",new FilePropertyType()); Property<byte[]> BYTE_PROPERTY new Property<byte[]>("app.my.byte.stream",new BytesFromFilePropertyType(FILE_PROPERTY));
Modifier and Type | Field and Description |
---|---|
static String |
TYPE
The type name string constant of ByteFromFile implementation.
|
Constructor and Description |
---|
BytesFromFilePropertyType(Property<File> derivedFromFile)
Loads a property value into a byte array, derived from a File.
|
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
|
byte[] |
validateDerivedValue(String propertyName)
Using the FileUtils.loadAsBytes(String,File) to load bytes.
|
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 List<String> getDerivedToRestrictions()
DerivedPropertyType
getDerivedToRestrictions
in class DerivedPropertyType<byte[]>
public void validateConstraints(String propertyName) throws PropertyException
validateConstraints
in class DerivedPropertyType<byte[]>
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()
public byte[] validateDerivedValue(String propertyName) throws PropertyException
validateDerivedValue
in class DerivedPropertyType<byte[]>
propertyName
- the name of derived PropertyPropertyException
- if it could not be converted into type T.FileUtils.loadAsBytes(String, File)