This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to configure custom check Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "How to configure custom check" Watch "How to configure custom check" New topic
Author

How to configure custom check

sahid ul karim
Greenhorn

Joined: Jun 06, 2007
Posts: 20
I have written my own check "MultipleStringLiteralsChecktest" for finding string.There, i have written a method "setAllowedDuplicates" .In xml file i am giving
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- my custom Check -->
<module name="MultipleStringLiteralsChecktest">
<property name="AllowedDuplicates" value="0"/>
</module>
</module>
</module>
But while building its givin this error"-
Unable to create a Checker: cannot initialize module TreeWalker - Property 'AllowedDuplicates'in module MultipleStringLiteralsChecktest does not exist, please check the documentation.
could somebody explain to me why its giving error?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

I don't know what you are using here, but I guess you don't have a public method called setAllowedDuplicates in your MultipleStringLiteralsChecktest class.


[My Blog]
All roads lead to JavaRanch
sahid ul karim
Greenhorn

Joined: Jun 06, 2007
Posts: 20
No ,i have written a public method called setAllowedDuplicates:-
private int mAllowedDuplicates = 1;
public void setAllowedDuplicates(int aAllowedDuplicates)
{
mAllowedDuplicates = aAllowedDuplicates;
}
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Try to change
<property name="AllowedDuplicates" value="0"/>
with
<property name="allowedDuplicates" value="0"/>


And please kindly change your name according to the naming policy : http://www.javaranch.com/name.jsp

Thank you
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. Initials aren't enough. You can change your display name here. Thanks!


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to configure custom check