com.g11ntoolkit.detokenizer
Class DetokMCFile

java.lang.Object
  |
  +--com.g11ntoolkit.detokenizer.DetokMCFile

public class DetokMCFile
extends java.lang.Object

Replaces all the token identifiers in the specified tokenized resource bundle file with the strings taken from the specified string file.

Writes out the specified output file when finished replacing the tokens.

Version:
2005/07/22
Author:
Bill Rich, Wilandra Consulting LLC
Copyright © 2005, Wilandra Consulting LLC. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.


Field Summary
private  java.lang.String encoding
          Specifies the encoding to use for the input file.
private static java.util.logging.Logger log
          The log used for all messages from this class.
private static java.util.ResourceBundle mrb
          Message Resource Bundle.
private  StrFile strFile
          Collection the strings that will be used to resolve the tokens.
private  java.util.Locale targetLocale
          Specifies the locale to use for the resulting resource bundle.
private static java.util.ResourceBundle vrb
          Variables Resource Bundle.
(package private) static boolean XML
          Switch to indicate if we are using XML or not.
 
Constructor Summary
DetokMCFile(java.lang.String anEncoding, java.util.Locale aLocale)
          Creates an instance of this class setting the locale and encoding.
 
Method Summary
static void detokenize(java.lang.String strFileName, java.lang.String outFileName, java.lang.String contextFileName, java.lang.String encoding, java.util.Locale targetLocale)
          Finds and replaces the tokens with their strings.
static void main(java.lang.String[] args)
          Allows this tool to be run from the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log
The log used for all messages from this class.


mrb

private static java.util.ResourceBundle mrb
Message Resource Bundle.


vrb

private static java.util.ResourceBundle vrb
Variables Resource Bundle.


strFile

private StrFile strFile
Collection the strings that will be used to resolve the tokens.


encoding

private java.lang.String encoding
Specifies the encoding to use for the input file.

The encoding will also be used on the output files.


targetLocale

private java.util.Locale targetLocale
Specifies the locale to use for the resulting resource bundle.


XML

static boolean XML
Switch to indicate if we are using XML or not.

Constructor Detail

DetokMCFile

public DetokMCFile(java.lang.String anEncoding,
                   java.util.Locale aLocale)
Creates an instance of this class setting the locale and encoding.

Parameters:
anEncoding - a String specifying the encoding of the resulting Resource Bundle file
aLocale - a Locale object
Method Detail

main

public static void main(java.lang.String[] args)
                 throws DetokRunError
Allows this tool to be run from the command line.

Sets up the environment then calls the detokenize method to do the work.

Parameters:
args - a String containing the command line parameters.
DetokRunError

detokenize

public static void detokenize(java.lang.String strFileName,
                              java.lang.String outFileName,
                              java.lang.String contextFileName,
                              java.lang.String encoding,
                              java.util.Locale targetLocale)
                       throws DetokRunError
Finds and replaces the tokens with their strings.

This method begins from an XLIFF format StrFile.

Parameters:
strFileName - a String containing the name of the input StrFile
outFileName - a String containing the name of the output file
contextFileName - a String containing the name of the file to be used as the context file name
encoding - a String containing the code identifying how the output file should be encoded. This must be a valid encoding code.
targetLocale - a Locale for the desired target locale.
Throws:
DetokRunError - for any error detected during the processing.