File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need a help in writing custom pmd rule using xpath query.

 
sameer kum
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am using PMD code quality tool with eclipse.
I am trying to to write a new rule as per my coding standards.
I need to write a xpath query which matches the following rules.

1.Brackets i.e.{} should begin and end on a new line.
ex:if (foo)
{
// code here
}



2.Include spaces around operators.
value = num + y;
not
value=num+y; -> (missing spaces around = sign and + sign).

I have gone through the basic xpath tutorials.


please Let me know can we achieve the above rules using xpath.If so please give me a example for the above.

Currently I am trying to write the xpath query by using PMD rule Designer.

Regards,
sameer.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic