[jdom-interest] Protected methods to make private

Jason Hunter jhunter at servlets.com
Tue Jun 17 12:57:20 PDT 2003


Laurent Bihanic wrote:
> 
>> SAXHandler:
>>   currentElement
>>   getCurrentElement()
>>
>> I see org.jdom.contrib.input.scanner.ElementScanner.ElementBuilder 
>> uses currentElement.  But must they both be exposed?  Should 
>> getCurrentElement() be public perhaps?
> 
> getCurrentElement can be made public.
> Yet ElementScanner.ElementBuilder needs to override it because it builds 
> rootlees subtrees and thus has to remove the consistency checks 
> SAXHandler's getCurrentElement does. If currentElement is made private, 
> ElementScanner.ElementBuilder.getCurrentElement() will look like:
> 
>       public Element getCurrentElement() throws SAXException {
>          try {
>             return super.getCurrentElement();
>          }
>          catch (SAXException e) {
>             return null;
>          }
>       }

So right now we have getCurrentElement() public.  Laurent, could you 
please make the above change to ElementBuilder, test it, and send in a 
patch if everything looks to work?

-jh-




More information about the jdom-interest mailing list