Class AbstractSimpleTypeWrapper
java.lang.Object
net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
- All Implemented Interfaces:
Serializable,TypeWrapper
- Direct Known Subclasses:
BooleanTypeWrapper,ColorTypeWrapper,EnumTypeWrapper,NumberTypeWrapper,StringTypeWrapper,TLIListTypeWrapper
Basic (and simple) implementation of TypeWrapper. Maintains an instance of
type being wrapped as well as provides reasonable default implementations
for all the operations.
- Version:
- $Revision: 03dc0884e86f $
- See Also:
-
Field Summary
Fields inherited from interface net.sourceforge.jeuclid.context.typewrapper.TypeWrapper
FAILED_TO_CONVERT, TO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromString(String value) Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.Class<?> Attempts to convert a parameter value expressed as an object of the appropriate (for this parameter) type into a string representation.booleanChecks if the object is of a valid type for this type info.
-
Constructor Details
-
AbstractSimpleTypeWrapper
- Parameters:
valType- a Class object
-
-
Method Details
-
getValueType
- Specified by:
getValueTypein interfaceTypeWrapper- Returns:
- the class instance being wrapped
-
valid
Checks if the object is of a valid type for this type info.- Specified by:
validin interfaceTypeWrapper- Parameters:
o- the object to check- Returns:
- true if the parameter can be set.
-
fromString
Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.- Specified by:
fromStringin interfaceTypeWrapper- Parameters:
value- parameter value as string- Returns:
- parameter value as an instance of the proper type
-
toString
Attempts to convert a parameter value expressed as an object of the appropriate (for this parameter) type into a string representation.- Specified by:
toStringin interfaceTypeWrapper- Parameters:
value- parameter value as object- Returns:
- parameter value as string
-