Locator2 is wrong

Elliotte Harold <[email protected]> Sun, 25 Apr 2004 11:25:20 -0400
Newsgroups gmane.text.xml.sax.devel
Message-ID <[email protected]>
The Locator2 interface has two methods:

getXMLVersion()
getEncoding()

Neither of these provides location information or has any relation to 
the functionality of the superinterface Locator. There is no logical 
reason for there to be an inheritance hierarchy between Locator and 
Locator2. That they are designed this way is due to implementation. It 
is not good object oriented practice.

There are a couple of possible fixes:

1. Rename Locator2 something like EntityInfo and make it not a 
subinterface of Locator. However, because these are interfaces, not 
classes, one object could still implement both.

2. Define a new LexicalHandler2 interface, designed much like 
EntityResolver2, which provides this extra info either thorugh extra 
callback methods or by extra arguments to overloaded startEntity and 
startDTD methods:

public void startEntity(String name, String encoding, String version)

--
Elliotte Rusty Harold



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
List: sax-devel, [email protected]
See:  http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel