com.g11ntoolkit.tokenizer
Class TokRC

java.lang.Object
  |
  +--com.g11ntoolkit.tokenizer.FileTokenizer
        |
        +--com.g11ntoolkit.tokenizer.TokRC

public class TokRC
extends FileTokenizer

RC file adapter for FileTokenizer.

Only handles strings in the StringTable section of the rc file.

Version:
2005/07/22
Author:
Alin Dragomir, webMethods Inc., Copyright © 2001, webMethods Inc. All rights reserved.
, Bill Rich, Wilandra Consulting LLC
Copyright © 2001-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 static boolean eol
          Indicates the end of a line has been reached.
private static boolean inComment
          Indicates processing is in a comment.
private static boolean inContext
          Indicates processing is in a context.
private static boolean inEscape
          Indicates processing is in an escape sequence.
private static boolean inQuote
          Indicates processing is in a quote.
private static boolean inSlash
          Indicates processing is in a slash section.
private static java.lang.String localeString
          The locale for the input file.
private static java.util.logging.Logger log
          The log used for all messages from this class.
protected static java.lang.String theContextFileName
          The context input file name saved for later use.
protected static java.util.ResourceBundle xliffrb
          Constants, messages, and variables used by the tools and classes for XLIFF processing.
 
Fields inherited from class com.g11ntoolkit.tokenizer.FileTokenizer
context, encoding, inFileBuffer, jspVars, mrb, product, productVersion, revContext, targetLocale, tokContext, token, vrb
 
Constructor Summary
TokRC()
          Establishes an instance of the class with no input information.
TokRC(java.lang.String anEncoding, java.util.Locale aLocale, Token aToken)
          Establishes an instance of the class and saves all the input information for use in processing the file.
 
Method Summary
static void main(java.lang.String[] args)
          Allows this tool to be run from the command line.
static StrFile tokenize(java.lang.String inFileName, java.lang.String contextFileName, java.util.Locale targetLocale, java.lang.String localeString)
          Tokenizes the buffer and writes the two output files.
 
Methods inherited from class com.g11ntoolkit.tokenizer.FileTokenizer
cleanConcats, getEncoding, getFileBuffer, getKey, getProductName, getProductVersion, getToken, keys, readFile, readFilePlain, setContext, setEncoding, setProductName, setProductVersion, setupTok, setupTok, tokens
 
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.


xliffrb

protected static java.util.ResourceBundle xliffrb
Constants, messages, and variables used by the tools and classes for XLIFF processing.


inQuote

private static boolean inQuote
Indicates processing is in a quote.


inEscape

private static boolean inEscape
Indicates processing is in an escape sequence.


inContext

private static boolean inContext
Indicates processing is in a context.


inComment

private static boolean inComment
Indicates processing is in a comment.


inSlash

private static boolean inSlash
Indicates processing is in a slash section.


eol

private static boolean eol
Indicates the end of a line has been reached.


theContextFileName

protected static java.lang.String theContextFileName
The context input file name saved for later use.


localeString

private static java.lang.String localeString
The locale for the input file.

Constructor Detail

TokRC

public TokRC()
      throws FileTokenizerError
Establishes an instance of the class with no input information.

It is useful for setting up the class for the check function.

Throws:
FileTokenizerError - if any errors occur during processing.

TokRC

public TokRC(java.lang.String anEncoding,
             java.util.Locale aLocale,
             Token aToken)
      throws FileTokenizerError
Establishes an instance of the class and saves all the input information for use in processing the file.

Parameters:
anEncoding - a String specifying the file encoding
aLocale - a Locale to override the default
aToken - a Token object to use for generating token ids
Throws:
FileTokenizerError - if any errors occur during processing.
Method Detail

main

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

Sets up the environment then uses the tokenize method to extract the strings.

Parameters:
args - a String array specifying the command line parameters. The order does not matter except that the arguments that are paired must be paired in order. The arguments are not case sensitive.
FileTokRunError

tokenize

public static StrFile tokenize(java.lang.String inFileName,
                               java.lang.String contextFileName,
                               java.util.Locale targetLocale,
                               java.lang.String localeString)
                        throws FileTokenizerError
Tokenizes the buffer and writes the two output files.

Uses the super class setupTok method to do the common work of reading the file into a string buffer.

Parameters:
inFileName - a String specifying the input file name
contextFileName - a String specifying the input file name to use as the token id and context
targetLocale - a Locale specifying the intended target locale
Returns:
a StrFile representing the extracted strings for the input file
Throws:
FileTokenizerError - if any errors occur during processing.