com.g11ntoolkit.levblock
Class JSXLEntry

java.lang.Object
  |
  +--com.g11ntoolkit.levblock.XLEntry
        |
        +--com.g11ntoolkit.levblock.JSXLEntry

public class JSXLEntry
extends XLEntry

The set of information that makes up one translation entry for a particular leverage entry block.

This class extends the XLEntry class because XLEntries for extracted JavaScript code requires a little different processing.

Version:
2005/06/20
Author:
Tomi Fujinaga, webMethods, Inc.
Copyright © 2003, webMethods, Inc. All rights reserved.
, Bill Rich, Wilandra Consulting LLC
Copyright © 2003-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 java.util.logging.Logger log
          The log used for all messages from this class.
protected  java.lang.String[] theBlock
          The string for this entry block.
 
Fields inherited from class com.g11ntoolkit.levblock.XLEntry
datatype, mrb, theComments, theContext, theLocale, theString, vrb, xliffrb, xrb
 
Constructor Summary
JSXLEntry()
          Constructs an empty instance so it is ready to receive data via the set methods.
JSXLEntry(java.util.Locale aLocale, java.lang.String[] aBlock)
          Constructs an instance for the specified locale and string.
 
Method Summary
 boolean analyzeThis(java.lang.String str)
          Analyzes the string to see if it is translatable.
 void debugDump()
          Dumps the contents of the object to StdOut.
 java.lang.String[] getBlock()
          Returns the string for this entry.
 void setBlock(java.util.Locale aLocale, java.lang.String[] aBlock)
          Sets the locale and string for this entry.
 void writeFlatXML(java.io.Writer out)
          Writes the string to the specified output writer in a flat XML form.
 
Methods inherited from class com.g11ntoolkit.levblock.XLEntry
addComment, addString, clean, equals, equals, getComments, getContext, getContextDisplay, getDatatype, getLocale, getString, hasComments, hasContext, hashCode, setComments, setContext, setDatatype, setString, toString, validate, writeXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

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


theBlock

protected java.lang.String[] theBlock
The string for this entry block.

Constructor Detail

JSXLEntry

public JSXLEntry()
Constructs an empty instance so it is ready to receive data via the set methods.


JSXLEntry

public JSXLEntry(java.util.Locale aLocale,
                 java.lang.String[] aBlock)
Constructs an instance for the specified locale and string.

Parameters:
aLocale - a Locale object
aBlock - a StringArray specifying the strings for this entry
Method Detail

setBlock

public void setBlock(java.util.Locale aLocale,
                     java.lang.String[] aBlock)
Sets the locale and string for this entry.

If the locale or string are already specified they will be replaced.

Parameters:
aLocale - a Locale object
aBlock - a StringArray specifying the string for this entry
See Also:
XLEntry.getString()

getBlock

public java.lang.String[] getBlock()
Returns the string for this entry.

Returns:
a String containing the String value or null if no string is set
See Also:
XLEntry.setString(java.util.Locale, java.lang.String)

writeFlatXML

public void writeFlatXML(java.io.Writer out)
                  throws java.io.IOException
Writes the string to the specified output writer in a flat XML form.

The flat XML form just makes the Context element attributes of the String element.

This is done to accomodate the use of the StrFile in SDLX.

This is where we differ from the XLEntry class in that we use special tags for the JavaScript entries.

Overrides:
writeFlatXML in class XLEntry
Parameters:
out - a Writer for the output
Throws:
java.io.IOException - when any errors are detected in writing to the output file

analyzeThis

public boolean analyzeThis(java.lang.String str)
Analyzes the string to see if it is translatable.

This method can be extended or modified by adjusting the xlstring list resource bundle file.

Parameters:
str - a String specifying the contents of the string to analyze
Returns:
a boolean representing whether to translate the string (true) or not (false)

debugDump

public void debugDump()
Dumps the contents of the object to StdOut.

Overrides:
debugDump in class XLEntry