public Object nextElement() { Object value = _enumeration.nextElement(); return _handler.convertUponGet(value); }
/** * Sets the value of the field on the object. * * @param object The object. * @param value The new value. * @throws IllegalStateException The Java object has changed and is no longer supported by this * handler, or the handler is not compatiable with the Java object. * @throws IllegalArgumentException The value passed is not of a supported type. */ public final void setValue(Object object, Object value) throws IllegalStateException, IllegalArgumentException { if (_handler == null) { throw new IllegalStateException(NULL_HANDLER_ERR); } _handler.setValue(object, convertUponSet(value)); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @param args the set of constructor arguments * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent, Object[] args) throws IllegalStateException { if (_handler instanceof ExtendedFieldHandler) { return ((ExtendedFieldHandler) _handler).newInstance(parent, args); } // -- backward compatibility: ignore arguments return newInstance(parent); }
GeneralizedFieldHandler gfh = factory.createFieldHandler(type); if (gfh != null) { gfh.setFieldHandler(handler); handler = gfh; customHandler = true; if (gfh.getFieldType() != null) { type = gfh.getFieldType(); GeneralizedFieldHandler gfh = factory.createFieldHandler(type); if (gfh != null) { gfh.setFieldHandler(handler); handler = gfh; customHandler = true; if (gfh.getFieldType() != null) { type = gfh.getFieldType();
/** * Sets the FieldDescriptor that this FieldHander is responsibile for. By setting the * FieldDescriptor, it allows the implementation of the FieldHandler methods to obtain information * about the field itself. This allows a particular implementation to become more generic and * reusable. * * @param fieldDesc the FieldDescriptor to set */ public void setFieldDescriptor(FieldDescriptor fieldDesc) { super.setFieldDescriptor(fieldDesc); if (_handler != null) { if (_handler instanceof GeneralizedFieldHandler) { ((GeneralizedFieldHandler) _handler).setFieldDescriptor(fieldDesc); } } }
GeneralizedFieldHandler gfh = factory.createFieldHandler(type); if (gfh != null) { gfh.setFieldHandler(handler); handler = gfh; customHandler = true; if (gfh.getFieldType() != null) { type = gfh.getFieldType(); GeneralizedFieldHandler gfh = factory.createFieldHandler(type); if (gfh != null) { gfh.setFieldHandler(handler); handler = gfh; customHandler = true; if (gfh.getFieldType() != null) { type = gfh.getFieldType();
/** * Sets the FieldDescriptor that this FieldHander is * responsibile for. By setting the FieldDescriptor, it * allows the implementation of the FieldHandler methods * to obtain information about the field itself. This allows * a particular implementation to become more generic and * reusable. * * @param fieldDesc the FieldDescriptor to set */ public void setFieldDescriptor(FieldDescriptor fieldDesc) { super.setFieldDescriptor(fieldDesc); if (_handler != null) { if (_handler instanceof GeneralizedFieldHandler) { ((GeneralizedFieldHandler) _handler).setFieldDescriptor(fieldDesc); } } }
fieldType = ((GeneralizedFieldHandler) exfHandler).getFieldType(); handler = createFieldHandler(javaClass, fieldType, fieldMap, typeInfoRef); if (custom != null) { ((GeneralizedFieldHandler) exfHandler).setFieldHandler(handler); handler = custom; } else {
public Object nextElement() { Object value = _enumeration.nextElement(); return _handler.convertUponGet(value); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @param args the set of constructor arguments * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and * cannot be instantiated */ public Object newInstance( Object parent, Object[] args ) throws IllegalStateException { if (_handler instanceof ExtendedFieldHandler) { return ((ExtendedFieldHandler)_handler).newInstance(parent, args); } //-- backward compatibility: ignore arguments return newInstance( parent ); }
/** * Sets the value of the field on the object. * * @param object The object. * @param value The new value. * @throws IllegalStateException The Java object has changed and is no longer * supported by this handler, or the handler is not compatiable with the * Java object. * @throws IllegalArgumentException The value passed is not of a supported type. */ public final void setValue(Object object, Object value) throws IllegalStateException, IllegalArgumentException { if (_handler == null) { throw new IllegalStateException(NULL_HANDLER_ERR); } _handler.setValue(object, convertUponSet(value)); }
fieldType = ((GeneralizedFieldHandler)exfHandler).getFieldType(); handler = createFieldHandler(javaClass, fieldType, fieldMap, typeInfoRef); if (custom != null) { ((GeneralizedFieldHandler) exfHandler).setFieldHandler(handler); handler = custom; } else {
/** * Returns the value of the field from the object. * * @param object The object * @return The value of the field * @throws IllegalStateException The Java object has changed and is no longer supported by this * handler, or the handler is not compatiable with the Java object */ public final Object getValue(Object object) throws IllegalStateException { if (_handler == null) { throw new IllegalStateException(NULL_HANDLER_ERR); } Object value = _handler.getValue(object); if ((_autoCollectionIteration) && (value != null)) { if (value instanceof java.util.Enumeration) { return new GFHConverterEnumeration(this, (Enumeration) value); } // -- other collection type? if (CollectionHandlers.hasHandler(value.getClass())) { CollectionHandler colHandler = null; try { colHandler = CollectionHandlers.getHandler(value.getClass()); } catch (MappingException mx) { throw new IllegalStateException(mx.getMessage()); } return new GFHConverterEnumeration(this, colHandler.elements(value)); } } return convertUponGet(value); } // -- getValue
fieldType = ((GeneralizedFieldHandler) exfHandler).getFieldType(); handler = createFieldHandler(javaClass, fieldType, fieldMap, typeInfoRef); if (custom != null) { ((GeneralizedFieldHandler) exfHandler).setFieldHandler(handler); handler = custom; } else {