37.6. TypeAdapterAs we saw in Chapter 25, a TypeAdapter manages conversion between the text in table cells and Java values. More specifically, a TypeAdapter object provides the following methods:
In addition, a TypeAdapter has several public instance variables. For our purposes, only the variable target is relevant to the following chapters of this part. To use a TypeAdapter with a particular object, such as to get() a value from it, we first need to assign that object to the target variable of the TypeAdapter. See the source code for TypeAdapter for further details. Only some classes are managed by TypeAdapter, so a mechanism is provided to manage other classes, including those that are application specific. We saw in Chapter 25 that the conversion and comparison of classes, such as Money, are handled by overriding the parse() method in a fixture. |