Location-based parsing

Rolf Lear <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi all.

I have moved the 'Line-Number' based SAXParser code to core. It is not a 
straight move, but rather, a rewrite to be more general, and to fit in 
to the JDOM2 way of doing things in the SAX parsing area.

A big side-effect of this move is that I have Extended the JDOMFactory 
interface. The changes are all 'extending' the interface, and the 
changes are fully compatible with JDOM 1.x ... unless you have created 
your own custom JDOMFactory.

If you have your own factory then you will need to implement a number of 
new methods. If you extend the DefaultJDOMFactory (like most people will 
have, I imagine) then you will find that you are overriding final 
methods (which fails to compile), but the fix is easy... for example if 
you overrode the 'text(String)' method (which returns a Text instance), 
you will have (for example):

public Text text(String text) {
   return new Text(text);
}

You will need to change this to:

public Text text(int line, int col, String text) {
   return new Text(text);
}

and you will again have your full functionality.

Rolf
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.