Why would you not simply return a strongly typed data item (ignoring the
names)
public abstract DataInfo getDataInfo(int index);
public interface EntityInfo {
public String getName();
public String getPublicID();
Public String getSystemID();
}
As far as reuse of values is concerned however, I think this is a very
bad idea: startElement defines a new context, so reusing the parameters
to that call is workable, however reusing the result from the
getDataInfo call is a different kettle of fish. It would be better (if
you are so concerned) to keep a pool that you return so that they are
not reused within the context of a startElement call. This may seem like
more work on the part of the parser implementor, but you shouldn't push
this complexity onto the users of the parser when you can safely hide it
within the parser. The parser writer can make the effort for
efficiencies sake.
+----------------------------------+
| Antony Blakey |
| N-Space Pty Ltd |
| Java - CORBA - SGML - XML |
| mailto:antony@n-space.com.au |
| http://www.n-space.com.au |
+----------------------------------+