|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectau.gov.tas.dpiwe.mr.tool.XMap
public class XMap
This tool blindly replaces text in accordance with a mapping in a specified properties file.
It was originally intended to transform OO.org spreadsheets by changing metadata lines appearing at the heads of each worksheet within the constituent XML file.
Of course, this tool actually operates on the whole file, so the tokens on the left of the properties file need to be unique to the metadata (and similarly must not appear in the OO.org XML as mark up.)
| Field Summary | |
|---|---|
protected static ThreadLocal |
returnCode
|
| Constructor Summary | |
|---|---|
XMap()
|
|
| Method Summary | |
|---|---|
static void |
generateError(String bundleName,
String messageToken)
Generates the error message for the specified token. |
static void |
main(String[] argv)
Initiates the XMap tool. |
static void |
xMap(Reader input,
PrintWriter output,
Properties map)
Produce an XMapped stream. |
static boolean |
xMap(String filename,
String mapFilename)
Produce a XMapped file, renaming the original version. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static ThreadLocal returnCode
| Constructor Detail |
|---|
public XMap()
| Method Detail |
|---|
public static void main(String[] argv)
throws Exception
IOException - if the input files could not be read or the output
files could not be written.
SecurityException - if the configured security policy is too
restrictive.
Exception - if something else goes wrong.
public static void generateError(String bundleName,
String messageToken)
bundleName - identifies the bundle.messageToken - identifies the error message.
public static boolean xMap(String filename,
String mapFilename)
throws IOException,
SecurityException
filename - the name of the file to be XMapped.
IOException - if the input files could not be read or the output
file could not be written.
SecurityException - if the configured security policy is too
restrictive.
public static void xMap(Reader input,
PrintWriter output,
Properties map)
throws IOException
input - the Reader from which the original text/XML should be read.output - the PrintWriter to which the remapped text/XML should be written.
IOException - if the input file could not be read or the output
file could not be written.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||