/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(final Object parent) throws IllegalStateException { Object obj = _handler.newInstance(parent); if (obj == null) { obj = new Date(); } return obj; } // -- newInstance
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @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) throws IllegalStateException { if (_handler == null) { throw new IllegalStateException(NULL_HANDLER_ERR); } return _handler.newInstance(parent); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be * instantiated */ public Object newInstance(final Object parent) throws IllegalStateException { Object obj = _handler.newInstance(parent); if (obj == null) { obj = new Date(); } return obj; } // -- newInstance
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @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 ) throws IllegalStateException { if (_handler == null) { throw new IllegalStateException(NULL_HANDLER_ERR); } return _handler.newInstance(parent); }
/** * Creates a new instance of the object described by this field. Of the object provided is a * ContainerElement, then a new isntance of the parent object is returned. Otherwise a new * ContainerElement is created and returned, with the parent set to the provided object. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(final Object parent) throws IllegalStateException { // -- MODE_CHILD_LINK and MODE_AUTO if (parent instanceof ContainerElement) { return _handler.newInstance(((ContainerElement) parent).getParent()); } // MODE_PARENT_LINK ContainerElement container = new ContainerElement(); container.setParent(parent); return container; } // -- newInstance
/** * Creates a new instance of the object described by this field. Of the * object provided is a ContainerElement, then a new isntance of the parent * object is returned. Otherwise a new ContainerElement is created and * returned, with the parent set to the provided object. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be * instantiated */ public Object newInstance(final Object parent) throws IllegalStateException { //-- MODE_CHILD_LINK and MODE_AUTO if (parent instanceof ContainerElement) { return _handler.newInstance(((ContainerElement) parent).getParent()); } // MODE_PARENT_LINK ContainerElement container = new ContainerElement(); container.setParent(parent); return container; } //-- newInstance
if (_handler instanceof ExtendedFieldHandler) return ((ExtendedFieldHandler)_handler).newInstance( parent, args ); return _handler.newInstance( parent );
if (_handler instanceof ExtendedFieldHandler) return (T) ((ExtendedFieldHandler<T>) _handler).newInstance(parent, args); return _handler.newInstance(parent);
containerObject = handler.newInstance(parent); handler.setValue(parent, containerObject);
containerObject = handler.newInstance(parent); handler.setValue(parent, containerObject);
containerObject = handler.newInstance(object); state.object = handler.newInstance(parentState.object);
containerObject = handler.newInstance(object); state.setObject(handler.newInstance(parentState.getObject()));