nrs.util
Class PropertiesValidator

java.lang.Object
  extended bynrs.util.PropertiesValidator

public class PropertiesValidator
extends java.lang.Object

Checks that source files' references to properties actually exist. This is a command line utility that can be run as

java -cp nrsutils.jar nrs.util.PropertiesValidator

Mandatory arguments

Optional arguments

An example useage might be:

java -cp nrsutils.jar nrs.util.PropertiesValidator -p messages -d src -prefix getMessage(

which would check all Java source files under the src directory for references to getMessage(. Anything between the next two quote characters will be checked against the messages.properties file. If the reference doesn't exist an error will be reported.

Author:
Copyright © 2004 Nick Sydenham <nsydenham@yahoo.co.uk>

Constructor Summary
PropertiesValidator(java.lang.String props, java.lang.String dir, java.lang.String prefix)
          Creates a new instance of PropertiesValidator
 
Method Summary
 void checkProperties(java.io.File dirToCheck)
          Using the specified directory as a starting point check for properties
static void main(java.lang.String[] args)
          Initialise and start the utility
 void printFrequency(boolean zeroFrequency)
          Print out the frequency of the keys
 void setFrequency(boolean frequency)
          Print the frequencies of the keys used
 void setVerbose(boolean verbose)
          Set verbose output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesValidator

public PropertiesValidator(java.lang.String props,
                           java.lang.String dir,
                           java.lang.String prefix)
Creates a new instance of PropertiesValidator

Parameters:
props - the properties file to check
dir - the directory to start searching from
prefix - the prefix which uniquely identifies a message
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Set verbose output

Parameters:
verbose - if true generate extra logging information

setFrequency

public void setFrequency(boolean frequency)
Print the frequencies of the keys used

Parameters:
frequency - if true print frequency of keys

checkProperties

public void checkProperties(java.io.File dirToCheck)
Using the specified directory as a starting point check for properties

Parameters:
dirToCheck - the directory to start checking from

printFrequency

public void printFrequency(boolean zeroFrequency)
Print out the frequency of the keys

Parameters:
zeroFrequency - only print out keys with no matches

main

public static void main(java.lang.String[] args)
Initialise and start the utility



Copyright © 2004-2005 Nick Sydenham <nsydenham@yahoo.co.uk>