OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sdo message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: AW: [sdo] 2nd try: SDOSource, SDOResult and ContentHandler


Hi Michael,
 
what do you think about this SDOResult implementation?
 
package commonj.sdo.helper.util;
 
import javax.xml.transform.sax.SAXResult;
 
import commonj.sdo.helper.HelperContext;
import commonj.sdo.helper.SDOContentHandler;
import commonj.sdo.helper.XMLDocument;
 
public class SDOResult extends SAXResult {
 
    private XMLDocument document;
 
    public SDOResult(HelperContext helperContext, Object options) {
        SDOContentHandler sdoContentHandler = helperContext.getXMLHelper().createContentHandler(options);
        setHandler(sdoContentHandler);
    }
 
    public void setDocument(XMLDocument document) {
        this.document = document;
    }
 
    public XMLDocument getDocument() {
        if (document == null) {
            SDOContentHandler sdoContentHandler = (SDOContentHandler)getHandler();
            document = sdoContentHandler.getDocument();
        }
        return document;
    }
 
}
I'm wondering if there should be another constructor to avoid the initialization of the SdoContentHandler. This could be useful for users of the setDocument-method. Which use-case do you have in mind for the setDocument-method?
Would you rather prefer an abstract class?
 
Stefan.

Von: Michael Glavassevich [mailto:mrglavas@ca.ibm.com]
Gesendet: Mittwoch, 18. März 2009 18:39
An: sdo@lists.oasis-open.org
Betreff: Re: [sdo] 2nd try: SDOSource, SDOResult and ContentHandler

Hi Stefan,

One comment on SDOResult:

To allow applications to work with SDO directly I would have expected a setDocument() method on SDOResult. This would allow an SDO-aware application to bypass the SAX events like they would be able to with SDOSource.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com

E-mail: mrglavas@apache.org

"Buennig, Stefan" <stefan.buennig@sap.com> wrote on 03/18/2009 11:10:26 AM:

> Hi all,

> this is the new Code for SDOSource, SDOResult and the interfaces for
> SDOContentHandler and XMLHelper.

> As we agreed in the call, SDOSource is an abstract class now.
> Because of the implementation of SDOResult is trivial, I kept the
> concrete implementation.

> XMLHelper has factory methods for both SDOSource and SDOResult to besymmetric.
> XMLHelper has a factory method for the new SDOContentHandler.

> The options-parameters aren't Maps anymore but Objects as in the
> existing methods.

> Stefan.
>
> ---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail.  Follow this link to all your TCs in OASIS at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]