On Apr 3, 2005 4:44 PM, Alifiya Hussain <alif
...@cs.toronto.edu> wrote:
> I am playing around with XPath Queries for new metrics and I can't seem to
> figure out how to get a query that works in pmd's Designer to work in your
> code, and vice versa.
> Eg, if I type in "ClassDeclaration:" or "InterfaceDeclaration:" into the
> designer, it doesnt work, while they do in the code. At the same time,
> "//ClassOrInterfaceDeclaration//MethodDeclaration" gives me the methods in
> a class/interface but having this regexp returns a zero in the code.
> Why is this?
PMD parses source code and converts it to a tree of objects. PMD
allows you to search this tree of objects using XPath. JCVSReport does
not.
Instead, JCVSReport takes the tree of objects returned by PMD and
dumps it out to a big string. JCVSReport allows you to search this big
string using a regular expression.
PMD designer shows you the 'big string' representation of any Java
class on screen. This is quite handy when you're writing regular
expressions for JCVSReport.
Cheers,
David
--
http://www.cs.toronto.edu/~james