[jdom-interest] Protected methods to make private

Laurent Bihanic laurent.bihanic at atosorigin.com
Fri Jul 4 08:46:50 PDT 2003


Bradley S. Huffman wrote:
> So what should SAXHandler do? The following

Yes, maybe with one minor adjustment :

>     public Document getDocument() {
>         // Try creating a new document with the content in result list.
>         Document document = null;
>         try {
>             document = factory.document(new Element("bogus"));
>             document.setContent(result);

Wouldn't
               document.setContent(getResult());
be better to ensure flushCharacters() is being called ?

>             if (locator != null) {
>                 document.setBaseURI(locator.getSystemId());
>             }
>         }
>         catch(RuntimeException exception) { 
>             // Ignore
>         }
>         return document;
>     }
> 
>     public List getResult() {
>         flushCharacters();
>         return result;
>     }

Laurent




More information about the jdom-interest mailing list