public abstract class AbstractGenerator extends Object implements Generator
Abstract base class for Java and TLD generators.
The methods in this class presume the following command line option names and corresponding values:
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractGenerator.CodeWriter |
| Modifier and Type | Field and Description |
|---|---|
protected static Set<String> |
JAVA_KEYWORDS |
protected static Map<String,String> |
TYPE_DEFAULTS |
| Constructor and Description |
|---|
AbstractGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
capitalize(String name)
Return the capitalized version of the specified property name.
|
protected static String |
mangle(String name)
Return a mangled version of the specified name if it conflicts with
a Java keyword; otherwise, return the specified name unchanged.
|
protected static Map<String,String> |
options(String[] args)
Parse the command line options into a
Map. |
protected static boolean |
primitive(String type)
Return
true if the specified type is a primitive. |
protected static String |
shortName(String className)
Return the short class name from the specified (potentially fully
qualified) class name.
|
protected static String capitalize(String name)
Return the capitalized version of the specified property name.
name - Uncapitalized property nameprotected static String mangle(String name)
Return a mangled version of the specified name if it conflicts with a Java keyword; otherwise, return the specified name unchanged.
name - Name to be potentially mangledprotected static Map<String,String> options(String[] args)
Parse the command line options into a Map.
args - Command line arguments passed to this programIllegalArgumentException - if an option flag does not start
with a '-' or is missing a corresponding valueprotected static boolean primitive(String type)
Return true if the specified type is a primitive.
type - Type to be testedCopyright © 2010–2020 JBoss by Red Hat. All rights reserved.