| java.lang.Object org.apache.harmony.rmi.compiler.RmicUtil
RmicUtil | final class RmicUtil implements RmicConstants(Code) | | Utility functions for RMI compiler.
This class cannot be instantiated.
author: Vasily Zakharov version: $Revision: 1.1.2.1 $ |
Method Summary | |
static String | firstLetterToUpperCase(String str) Returns string with capitalized first letter.
Parameters: str - String. | static String | getHandlingType(Class cls) Returns name of the class with capitalized first letter
for primitive classes and Object for non-primitive classes.
Parameters: cls - Class. | static String | getObjectParameterString(Class cls, String varName) Creates source code fragment for method parameter,
wrapping primitive types into respective Object types.
Parameters: cls - Parameter class. Parameters: varName - Parameter variable name. | static File | getPackageDir(String base, String packageName) Creates a file object for a directory created basing on the specified
base directory and the package name for subdirectory.
Parameters: base - Base directory. Parameters: packageName - Package name (for subdirectory). | static File | getPackageFile(File dir, String fileName) Creates a file object for a file created basing on the specified
directory and the name of file itself.
Parameters: dir - Directory to create the file in. Parameters: fileName - Name of file itself. | static String | getParameterName(Class cls, int number) Returns suitable name for a parameter based on its class name and number.
Parameters: cls - Parameter class. Parameters: number - Parameter number. | static String | getReadObjectString(Class cls, String streamName) Creates source code fragment for reading object from a stream,
correctly handling primitive types.
Parameters: cls - Class of object being read. Parameters: streamName - Name of stream to read variable from. | static String | getReturnObjectString(Class cls, String varName) Creates source code fragment for return object,
correctly de-wrapping primitive types.
Parameters: cls - Return class. Parameters: varName - Return variable name. | static String | getWriteObjectString(Class cls, String varName, String streamName) Creates source code fragment for writing object to a stream,
correctly handling primitive types.
Parameters: cls - Class of object to write. Parameters: varName - Name of the variable to write. Parameters: streamName - Name of stream to write variable to. |
firstLetterToUpperCase | static String firstLetterToUpperCase(String str)(Code) | | Returns string with capitalized first letter.
Parameters: str - String. String with capitalized first letter,or string itself if the string is empty. |
getHandlingType | static String getHandlingType(Class cls)(Code) | | Returns name of the class with capitalized first letter
for primitive classes and Object for non-primitive classes.
Parameters: cls - Class. Returns name of the class with capitalized first letterfor primitive classes and Object for non-primitiveclasses. |
getObjectParameterString | static String getObjectParameterString(Class cls, String varName)(Code) | | Creates source code fragment for method parameter,
wrapping primitive types into respective Object types.
Parameters: cls - Parameter class. Parameters: varName - Parameter variable name. Source code fragment for method parameter,for Object types it's just varName ,for primitive types (e. g. int )it's a string like this:"new java.lang.Integer(varName)" . |
getPackageDir | static File getPackageDir(String base, String packageName) throws RMICompilerException(Code) | | Creates a file object for a directory created basing on the specified
base directory and the package name for subdirectory.
Parameters: base - Base directory. Parameters: packageName - Package name (for subdirectory). File object for a directory like this:baseDir/my/java/package . throws: RMICompilerException - If directory cannot be created. |
getPackageFile | static File getPackageFile(File dir, String fileName) throws RMICompilerException(Code) | | Creates a file object for a file created basing on the specified
directory and the name of file itself.
Parameters: dir - Directory to create the file in. Parameters: fileName - Name of file itself. File object for a file name like this:dir/fileName . throws: RMICompilerException - If file cannot be created. |
getParameterName | static String getParameterName(Class cls, int number)(Code) | | Returns suitable name for a parameter based on its class name and number.
Parameters: cls - Parameter class. Parameters: number - Parameter number. Suitable name for a parameter. |
getReadObjectString | static String getReadObjectString(Class cls, String streamName)(Code) | | Creates source code fragment for reading object from a stream,
correctly handling primitive types.
Parameters: cls - Class of object being read. Parameters: streamName - Name of stream to read variable from. Source code fragment for reading object,for Object class it's like"streamName.readObject()" ,for other Object types (e. g. Vector )it's a string like this:"(java.util.Vector) streamName.readObject()" ,for primitive types (e. g. int )it's a string like this:"streamName.readInt()" . |
getReturnObjectString | static String getReturnObjectString(Class cls, String varName)(Code) | | Creates source code fragment for return object,
correctly de-wrapping primitive types.
Parameters: cls - Return class. Parameters: varName - Return variable name. Source code fragment for return object,for Object class it's just varName ,for other Object types (e. g. Vector )it's a string like this:"((java.util.Vector) varName)" ,for primitive types (e. g. int )it's a string like this:"((java.lang.Integer) varName).intValue()" . |
getWriteObjectString | static String getWriteObjectString(Class cls, String varName, String streamName)(Code) | | Creates source code fragment for writing object to a stream,
correctly handling primitive types.
Parameters: cls - Class of object to write. Parameters: varName - Name of the variable to write. Parameters: streamName - Name of stream to write variable to. Source code fragment for writing object,for object types it's like"streamName.writeObject(varName)" ,for primitive types (e. g. int )it's a string like this:"streamName.writeInt(varName)" . |
|
|