[Sax-devel] Locator2 is wrong
Brought to you by:
dmegginson
From: Elliotte H. <el...@me...> - 2004-04-25 15:37:59
|
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 |