org.geotools.resources
Class IndexedResourceCompiler

java.lang.Object
  extended by org.geotools.resources.IndexedResourceCompiler
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public final class IndexedResourceCompiler
extends java.lang.Object
implements java.util.Comparator<java.lang.Object>

Resource compiler. This class is run from the command line at compile time only. IndexedResourceCompiler scans for .properties files and copies their content to .utf files using UTF8 encoding. It also checks for key validity and checks values for MessageFormat compatibility. Finally, it creates a FooKeys.java source file declaring resource keys as integer constants.

This class must be run from the maven root of Geotools project.

IndexedResourceCompiler and all FooKeys classes don't need to be included in the final JAR file. They are used at compile time only and no other classes should keep reference to them.

Since:
2.4
Version:
$Id: IndexedResourceCompiler.java 34724 2009-12-22 11:17:18Z aaime $
Author:
Martin Desruisseaux (IRD)

Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two resource keys.
static void main(java.lang.String[] args)
          Run the compiler for GeoTools resources.
static void main(java.lang.String[] args, java.io.File sourceDirectory, java.lang.Class<? extends IndexedResourceBundle>[] resourcesToProcess)
          Run the resource compiler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two resource keys. Object o1 and o2 are usually String objects representing resource keys (for example, "MISMATCHED_DIMENSION"), but may also be Map.Entry.

Specified by:
compare in interface java.util.Comparator<java.lang.Object>

main

public static void main(java.lang.String[] args,
                        java.io.File sourceDirectory,
                        java.lang.Class<? extends IndexedResourceBundle>[] resourcesToProcess)
Run the resource compiler.

Parameters:
args - The command-line arguments.
sourceDirectory - The base directory for "java" "resources" sub-directories. The directory structure must be consistent with Maven conventions.
resourcesToProcess - The resource bundle base classes (e.g. Vocabulary.class}).

main

public static void main(java.lang.String[] args)
Run the compiler for GeoTools resources.



Copyright © 1996-2010 Geotools. All Rights Reserved.