UIComponent component,
String componentType,
String value, String valueType) {
Application application = context.getApplication();
Converter converter = null;
UISelectItems items = null;
// if we need a converter, and can have a converter
if (!valueType.equals("java.lang.String") &&
component instanceof ValueHolder) {
// if so create it,
try {
converter =
application.createConverter(CarStore.loadClass(valueType,
this));
} catch (ClassNotFoundException cne) {
FacesMessage errMsg = MessageFactory.getMessage(
CONVERTER_ERROR_MESSAGE_ID,
(new Object[]{valueType}));
throw new IllegalStateException(errMsg.getSummary());
}
// add it to our component,
((ValueHolder) component).setConverter(converter);
}
// if this component is a SelectOne or SelectMany, take special action
if (isMultiValue(componentType)) {
// create a UISelectItems instance
items = new UISelectItems();
items.setValue(parseStringIntoArrayList(context, component,
value, valueType,
converter));
// add it to the component
component.getChildren().add(items);
} else {