|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A TypeGenerator can generate values for properties of a certain type. It also corrects facets that don't fit with the type and values that don't fit with the type or with the constraints imposed by the facets. Those last abilities are especially used when parsing properties from external files.
Field Summary | |
static int |
FACET_DEFAULT_IS_GREATER_THAN_MAX
RC: the default value for the property was higher than the maximum allowed value. |
static int |
FACET_DEFAULT_IS_LOWER_THAN_MIN
RC: the default value for the property was lower than the minimum allowed value. |
static int |
FACET_DEFAULT_NOT_ALLOWED
RC: the default value for the property was not allowed. |
static int |
FACET_MIN_IS_GREATER_THAN_MAX
RC: the minimum allowed value was higher than the maximum allowed value. |
static int |
FACET_OF_WRONG_TYPE
RC: a facet value is of the wrong type. |
static int |
VALUE_SET_TO_CLASS_DEFAULT
RC: the value was wrong. |
static int |
VALUE_SET_TO_MAX
RC: the value was too high. |
static int |
VALUE_SET_TO_MIN
RC: the value was too low. |
static int |
VALUE_SET_TO_USER_DEFAULT
RC: the value was wrong. |
static int |
WELL_DONE
Return Code: No corrections were necessary |
static int |
WRONG_CLASS_OBJECT
RC: The Object was of the wrong type. |
Method Summary | |
Object |
cloneValue(Object valueObject)
Returns a 'deep' copy of a value. |
int |
correctFacets(Property property)
Checks whether the facets of a property fit to the type and corrects them, if necessary. |
Object |
correctValue(Object inValue,
Property property)
Corrects a value of a property so that it fits to the type and facets. |
String |
describeAction(int actionCode)
Returns a String describing a correcting action, user-friendly |
int |
getlastCorrectAction()
Returns the last action made by correctValue |
Object |
parseString(String string)
Returns a value parsed from a String representation. |
Field Detail |
public static final int WELL_DONE
public static final int WRONG_CLASS_OBJECT
public static final int VALUE_SET_TO_MAX
public static final int VALUE_SET_TO_MIN
public static final int VALUE_SET_TO_CLASS_DEFAULT
public static final int VALUE_SET_TO_USER_DEFAULT
public static final int FACET_MIN_IS_GREATER_THAN_MAX
public static final int FACET_DEFAULT_IS_GREATER_THAN_MAX
public static final int FACET_DEFAULT_IS_LOWER_THAN_MIN
public static final int FACET_OF_WRONG_TYPE
public static final int FACET_DEFAULT_NOT_ALLOWED
Method Detail |
public Object cloneValue(Object valueObject)
valueObject
- the value
public Object parseString(String string) throws ParseException
string
- the representation of the value
ParseException
- if the String doesn't represent a value of the typepublic int getlastCorrectAction()
correctValue(Object, Property)
public String describeAction(int actionCode)
actionCode
- the code of the action
public Object correctValue(Object inValue, Property property) throws WrongFacetException
inValue
- the valueproperty
- the property (to get the facets)
WrongFacetException
- if the facets of the property are erroneous.public int correctFacets(Property property)
property
- the property that holds the facets
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |