|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.tools.generation.Util
Field Summary | |
private static String[] |
javaDocTags
|
static char |
MODULE_SEPARATOR
|
private static ModuleRegistry |
moduleRegistry
|
static String |
targetModule
|
Constructor Summary | |
Util()
|
Method Summary | |
static int |
arraySize(String arrayType)
|
static String |
beanPropertyName(String string)
|
static String |
capitalize(String string)
|
static String |
classname(String qualifiedClassname)
Get a String that is the base classname for a fully qualified classname. |
static int |
containsCount(String target,
String searchFor)
|
static void |
copyFile(File source_file,
File target_file)
|
static String |
decapitalize(String string)
|
static String |
defaultValue(String type)
Get he default value for a type. |
static int |
getTagBlockBeginIndex(String documentation)
|
static String |
getTargetModule()
|
static String |
getterName(String root)
|
static String |
getterName(String root,
String type)
|
static double |
hexToDecimal(String hexString)
Convert a hex string to a double. |
static boolean |
isEmpty(String theString)
|
private static boolean |
isJavaDocTag(String documentation)
|
static boolean |
isPrimitive(String type)
Determine if a type name is a primitive type. |
static boolean |
isPrimitiveComponent(String type)
Determine if a type name is a primitive type, or an array of primitive types. |
static boolean |
isPrimitiveWrapper(String type)
Determine if a type name is a primitive wrapper type. |
static boolean |
isPrimitiveWrapperComponent(String type)
Determine if a type name is a primitive wrapper type, or an array of primitive wrapper types. |
static boolean |
javaFileExists(String class_name,
String package_name)
|
static String |
javaPackageName(String module_qualified_name)
Get a String that is the package name of a module qualified package name. |
private static String |
methodName(String root,
String prefix)
|
static String |
moduleName(String module_qualified_name)
Get the module name from a module qualified name. |
static String |
packageName(String qualifiedClassname)
Get a String that is the package name of a fully qualified class name. |
static String |
packagePath(String packageName,
String artifact)
Get a String that is a path name for a particular artifact type, for a given package. |
static String |
pathPackage(String path,
String artifact)
Get a String that is the package name for a path to a given type of artifact. |
static String |
pathToModularPackage(String path,
String artifact)
Get a String that is the module qualified package name for a path to a given type of artifact. |
static String |
primitiveToWrapper(String typename)
Get a String that is the name of the object wrapper type for a primitive type. |
static void |
printStackTrace()
|
static boolean |
processChangedFile(File source_file,
File target_file,
String target_root,
boolean copy,
boolean notify)
|
static void |
propertySetup(String[] args)
|
static String |
qualifiedClassname(String fullFileName,
String rootPath)
Get a String that is a fully qualified classname. |
static String |
removerKeyedName(String root)
|
static void |
setTargetModule(String target_module)
|
static String |
setterKeyedName(String root)
|
static String |
setterName(String root)
|
static String |
setterParamName(String root)
|
static String |
stripArray(String type)
|
static String |
toArrayClassID(String type)
|
static String |
toConstant(String string)
Get a String that is the constant name, based on the passed string. |
static String |
variableName(String string)
|
static String |
wrapperToPrimitive(String typename)
Get a String that is the name of the primitive type for a object wrapper type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static String targetModule
public static final char MODULE_SEPARATOR
private static final ModuleRegistry moduleRegistry
private static final String[] javaDocTags
Constructor Detail |
public Util()
Method Detail |
public static int arraySize(String arrayType)
public static final String beanPropertyName(String string)
public static final String capitalize(String string)
public static String classname(String qualifiedClassname)
Example Usage: Util.classname( "wt.test.MyClass" ); // returns "MyClass"
qualifiedClassname
- - a String, which is a fully qualified classname
public static int containsCount(String target, String searchFor)
public static final String decapitalize(String string)
public static String defaultValue(String type)
Example Usage: Util.defaultValue( "boolean" ) // returns "false" Util.defaultValue( "char" ) // returns "' '" Util.defaultValue( "int" ) // returns "0" Util.defaultValue( "Integer[]" ) // returns "null" Util.defaultValue( "Integer" ) // returns "null"
public static int getTagBlockBeginIndex(String documentation)
public static String getterName(String root)
public static String getterName(String root, String type)
public static boolean isEmpty(String theString)
private static boolean isJavaDocTag(String documentation)
public static boolean isPrimitive(String type)
Example Usage: Util.isPrimitive( "int" ) // returns true Util.isPrimitive( "int[]" ) // returns false Util.isPrimitive( "Integer" ) // returns false
type
- - a String, which represent the name of a type
generation.Util#primitiveToObject(String)
,
generation.Util#isPrimitiveComponent(String)
,
generation.Util#isPrimitiveWrapper(String)
public static boolean isPrimitiveComponent(String type)
Example Usage: Util.isPrimitiveComponent( "int" ) // returns true Util.isPrimitiveComponent( "int[]" ) // returns true Util.isPrimitiveComponent( "Integer" ) // returns false
type
- - a String, which represent the name of a type
generation.Util#primitiveToObject(String)
,
generation.Util#isPrimitive(String)
,
generation.Util#isPrimitiveWrapperComponent(String)
public static boolean isPrimitiveWrapper(String type)
Example Usage: Util.isPrimitiveWrapper( "int" ) // returns false Util.isPrimitiveWrapper( "Integer[]" ) // returns false Util.isPrimitiveWrapper( "Integer" ) // returns true Util.isPrimitiveWrapper( "java.lang.Integer" ) // returns true
type
- - a String, which represent the name of a type
generation.Util#wrapperToPrimitive(String)
,
generation.Util#isPrimitiveWrapperComponent(String)
,
generation.Util#isPrimitiveWrapper(String)
public static boolean isPrimitiveWrapperComponent(String type)
Example Usage: Util.isPrimitiveWrapper( "int" ) // returns false Util.isPrimitiveWrapper( "Integer[]" ) // returns true Util.isPrimitiveWrapper( "Integer" ) // returns true Util.isPrimitiveWrapper( "java.lang.Integer" ) // returns true
type
- - a String, which represent the name of a type
generation.Util#wrapperToPrimitive(String)
,
generation.Util#isPrimitiveWrapper(String)
,
generation.Util#isPrimitiveComponent(String)
public static boolean javaFileExists(String class_name, String package_name)
private static String methodName(String root, String prefix)
public static String packageName(String qualifiedClassname)
Example Usage: Util.packageName( "wt.test.MyClass" ); // return "wt.test" Util.packageName( "wt.test.MyClass$Inner" ); // return "wt.test"
qualifiedClassname
- - a String, which is a full qualified class name
generation.Util#classname(String)
public static String javaPackageName(String module_qualified_name)
Example Usage: Util.moduleName( "WNC/CommonCore:wt.util" ); // return "wt.util"
module_qualified_name
- - a String, which is a module qualified package name
generation.Util#moduleName(String)
public static String moduleName(String module_qualified_name)
Example Usage: Util.moduleName( "WNC/CommonCore:wt.util" ); // return "WNC/CommonCore" Util.moduleName( "WNC/CommonCore:wt.util.MyClass" ); // return "WNC/CommonCore"
module_qualified_name
- - a String, which is a module qualified name
generation.Util#javaPackageName(String)
public static String packagePath(String packageName, String artifact)
Example Usage: Util.packagePath( "wt.test", ArtifactDir.BIN ); returns -> "C:\Windchill\codebase\wt\test"
packageName
- - a String, which is a package nameartifact
- - a String, which is the type of artifact whose path
will be returned.
public static String pathPackage(String path, String artifact)
Example Usage: Util.pathPackage( "C:/CommonCore/src/wt/util/Example.java", ArtifactDir.SRC ); // returns -> "wt.util" Util.pathPackage( "C:/CommonCore/src/wt/util", ArtifactDir.SRC ); // returns -> "wt.util"
path
- - a String, which is a pathartifact
- - a String, which represents the type of artifact represented by the path.
public static String pathToModularPackage(String path, String artifact)
Util.pathToModularPackage( "C:/CommonCore/src/wt/util/Example.java", ArtifactDir.SRC ); // returns -> "WNC/CommonCore:wt.util" Util.pathToModularPackage( "C:/CommonCore/src/wt/util", ArtifactDir.SRC ); // returns -> "WNC/CommonCore:wt.util" Util.pathToModularPackage( "C:/Windchill/src/wt/util", ArtifactDir.SRC ); // returns -> "wt.util"
path
- - a String, which is a pathartifact
- - a String, which represents the type of artifact represented by the path.
public static String primitiveToWrapper(String typename)
Example Usage: Util.primitiveToObject( "int" ) // returns "Integer" Util.primitiveToObject( "int[]" ) // returns "Integer[]" Util.primitiveToObject( "Integer" ) // returns "Integer"
typename
- - a String, which represent the name of a type
generation.Util#isPrimitive(String)
public static void printStackTrace()
public static void propertySetup(String[] args) throws Exception
Exception
public static String qualifiedClassname(String fullFileName, String rootPath)
Example Usage: Util.qualifiedClassname( "C:\classpath\wt\test\MyClass.ext", "C:\classpath" ); returns -> "wt.test.MyClass" Util.qualifiedClassname( "C:\classpath\wt\test\MyClass.ext", "C:\classpath\" ); returns -> "wt.test.MyClass" Util.qualifiedClassname( "C:\classpath\wt\test", "C:\classpath" ); returns -> "wt.test"
fullFileName
- - a String, which is a full file namerootPath
- - a String, which is a path in the class path
generation.Util#packageName(String)
public static String removerKeyedName(String root)
public static String setterKeyedName(String root)
public static String setterName(String root)
public static String setterParamName(String root)
public static String stripArray(String type)
public static String toArrayClassID(String type)
public static String toConstant(String string)
Example Usage: Util.toConstant( "myAttribute" ) // returns "MY_ATTRIBUTE" Util.toConstant( "something" ) // returns "SOMETHING" Util.toConstant( "aBigAttribute" ) // returns "A_BIG_ATTRIBUTE"
string
- - a String, which is a name to convert
public static final String variableName(String string)
public static String wrapperToPrimitive(String typename)
Example Usage: Util.wrapperToPrimitive( "int" ) // returns "int" Util.wrapperToPrimitive( "Integer[]" ) // returns "int[]" Util.wrapperToPrimitive( "Integer" ) // returns "int" Util.wrapperToPrimitive( "java.lang.Integer" ) // returns "int"
typename
- - a String, which represent the name of a type
generation.Util#isPrimitiveWrapper(String)
,
generation.Util#primitiveToWrapper(String)
public static double hexToDecimal(String hexString)
Example Usage: WTStringUtilities.hexToDecimal( "21C" ) // returns 540.0 WTStringUtilities.hexToDecimal( "-12" ) // returns -18.0
hexString
- - a hex number as a String
public static String getTargetModule()
public static void setTargetModule(String target_module)
public static boolean processChangedFile(File source_file, File target_file, String target_root, boolean copy, boolean notify) throws IOException
IOException
public static void copyFile(File source_file, File target_file) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |