This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Need a help in writing custom pmd rule using xpath query. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Need a help in writing custom pmd rule using xpath query." Watch "Need a help in writing custom pmd rule using xpath query." New topic
Author

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

sameer kum
Greenhorn

Joined: Jun 30, 2011
Posts: 8
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.
 
Consider Paul's rocket mass heater.
 
subject: Need a help in writing custom pmd rule using xpath query.
 
Similar Threads
CheckStyle Rule : Making final to the local variables
PMD tool
Adding new rule to Eclipse's code analysis plugin PMD
Java code analysis tools.
Need help in writing regular expression .