public class ComponentGenerator
extends java.lang.Object
For a SAFS App Map named "App.map" this will create "AppMap.java".
If the input parameter is a directory, and not a specific file, then ALL *.map files will be processed into the resulting java file.
This Class is a standalone Java application typically invoked as shown below in static method 'main' below.
Component
,
main(String[])
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
ARG_ENCODING |
(package private) static java.lang.String |
ARG_IN |
(package private) static java.lang.String |
ARG_NAME |
(package private) static java.lang.String |
ARG_OUT |
(package private) static java.lang.String |
ARG_PACKAGE |
(package private) static java.lang.String |
BASH |
(package private) static java.lang.String |
EMPTY_SECTION |
(package private) static java.lang.String |
HASH |
(package private) static java.lang.String |
HELP_OUT |
(package private) static java.lang.String |
SEMI |
(package private) static java.io.BufferedWriter |
writer |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
java org.safs.model.tools.ComponentGenerator [args]
|
(package private) static java.lang.String |
normalize(java.lang.String name)
The purpose is to make a valid java variable/class name.
Replace all invalid characters (not suitable for a java variable/class name) with "_". If the string start with numbers, remove those numbers. Valid characters are a-z, A-Z, 0-9 and _. As a map can contain "." in the section-name or item-name, and this program will convert the map to a java file, and these names are going to be used as java class-name or field-name, but "." is not valid for class/field name, we must convert it to a valid character "_". |
(package private) static void |
writeln(java.lang.String line) |
static java.io.BufferedWriter writer
static final java.lang.String ARG_IN
static final java.lang.String ARG_OUT
static final java.lang.String ARG_NAME
static final java.lang.String ARG_PACKAGE
static final java.lang.String ARG_ENCODING
static final java.lang.String HELP_OUT
static final java.lang.String EMPTY_SECTION
static final java.lang.String BASH
static final java.lang.String SEMI
static final java.lang.String HASH
static void writeln(java.lang.String line) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
args:
REQUIRED relative or absolute path to the SAFS App Map file or directory to process.
Examples:
REQUIRED path to the directory in which to write the new Java Class file.
Example:
OPTIONAL Alternate name to give the generated class.
Example:
OPTIONAL package name to use for the output Java Class file. When not specified, no package name is written. The class is part of the nameless (default) Java package.
Example:
OPTIONAL character encoding used for the existing SAFS App Map. This argument is actually REQUIRED if the SAFS App Map is encoded in something other than the System default character encoding.
Examples:
Putting it all together for some sample invocations:
java org.safs.model.tools.ComponentGenerator -in "TIDTest.map" -out "c:/safs/datastorej/" java org.safs.model.tools.ComponentGenerator -in "TIDTest.map" -out "c:/safs/datastorej/" -encoding "UTF-8" java org.safs.model.tools.ComponentGenerator -in "c:/safs/project/datapool/tidtest.map" -out "c:/safs/datastorej" java org.safs.model.tools.ComponentGenerator -in "tidtest.map" -out "c:/safs/datastorej/org/safs/sample/" -package "org.safs.sample"
static java.lang.String normalize(java.lang.String name)
name
- String, the string to normalizeCopyright © SAS Institute. All Rights Reserved.