Hi,

Here's the StAXElementLoader definition in the sandbox code.

public interface StAXElementLoader<T extends ModelObject> {
    /**
     * Create the model object for an element in an XML stream. When this 
method returns the stream will be
     * positioned on the corresponding END_ELEMENT.
     *
     * @param reader            the XML stream reader positioned on the 
applicable START_ELEMENT
     * @param deploymentContext the context for the load operation
     * @return the model object for that element
     */
    T load(XMLStreamReader reader, DeploymentContext deploymentContext) throws 
XMLStreamException, LoaderException;
}

Please note the return type is required to extend from ModelObject. Can it be 
relaxed to java.lang.Object so that loader implementations can return their own 
types directly? 

I'm trying to add some generic loaders backed by XML databinding frameworks 
such as SDO. These frameworks usually have their own model objects, for 
example, SDO uses commonj.sdo.DataObject. It's not very nice that we have to 
wrap a native model object into our ModelObject.

Thanks,
Raymond

Reply via email to