public class DerivedFromTypePropertyType<K,T> extends DerivedPropertyType<T>
TypeFromGeneric<K,T>
.TypeFromGeneric
,
Serialized FormConstructor and Description |
---|
DerivedFromTypePropertyType(Property<K> derivedFromType,
TypeFromGeneric<K,T> fromType)
Constructor where defaultValue is
null . |
DerivedFromTypePropertyType(Property<K> derivedFromType,
TypeFromGeneric<K,T> fromType,
T defaultValue)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Property<K> |
getDerivedFromType()
Gets the one Property which this PropertyType is dependent on.
|
K |
getDerivedFromValue()
Gets the value K of the dependent property.
|
List<String> |
getDerivedToRestrictions()
Gets the restrictions from the "FromType", than adds the default value description.
|
TypeFromGeneric<K,T> |
getFromType()
Gets the implementation of TypeFromGeneric.
|
void |
validateConstraints(String propertyName)
Validates the DerivedFromTypePropertyType.
|
T |
validateDerivedValue(String propertyName)
Use the TypeFromGeneric#fromType method to convert the value to type T.
|
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 DerivedFromTypePropertyType(Property<K> derivedFromType, TypeFromGeneric<K,T> fromType) throws NullPointerException
null
.derivedFromType
- the one Property which this type is derived from.fromType
- the implementation of TypeFromGeneric which can convert the one Property to the type T.NullPointerException
- if fromType is null
.public DerivedFromTypePropertyType(Property<K> derivedFromType, TypeFromGeneric<K,T> fromType, T defaultValue) throws NullPointerException
derivedFromType
- the one Property which this type is derived from.fromType
- the implementation of TypeFromGeneric which can convert the one Property to the type T.defaultValue
- a default value of type T.NullPointerException
- if fromType is null
.public final Property<K> getDerivedFromType()
public final K getDerivedFromValue()
public final T validateDerivedValue(String propertyName) throws PropertyException
validateDerivedValue
in class DerivedPropertyType<T>
propertyName
- the name of derived PropertyPropertyException
- if it could not be converted into type T.TypeFromGeneric.fromType(String, Object)
public void validateConstraints(String propertyName) throws PropertyException
validateConstraints
in class DerivedPropertyType<T>
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 List<String> getDerivedToRestrictions()
getDerivedToRestrictions
in class DerivedPropertyType<T>
TypeFromGeneric.getRestrictions()
,
DerivedPropertyType.getDerivedFromRestrictions()
public TypeFromGeneric<K,T> getFromType()