Class Util
java.lang.Object
com.sun.tools.corba.ee.idl.Util
com.sun.tools.corba.ee.idl.toJavaPortable.Util
Class Util is a repository of static members available for general
use by the IDL parser framework and any generator extensions.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final short
(package private) static final short
private static Hashtable
(package private) static final short
(package private) static final short
(package private) static Hashtable
<String, SymtabEntry> (package private) static final short
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddImportLines
(SymtabEntry entry, Vector importTypes, short type) private static void
(package private) static String
arrayInfo
(Vector<Expression> arrayInfo) private static String
checkForArrayBase
(TypedefEntry t, Vector<SymtabEntry> importTypes, Vector<String> importList) private static void
checkForArrayDimensions
(String arrays, Vector<SymtabEntry> importTypes, Vector<String> importList) private static void
checkForArrays
(SymtabEntry entry, Vector<SymtabEntry> importTypes, Vector<String> importList) private static void
checkForBounds
(SymtabEntry entry, Vector<SymtabEntry> importTypes, Vector<String> importList) Determine the import lines for template types.private static void
checkForGlobalConstants
(String exprRep, Vector<SymtabEntry> importTypes, Vector<String> importList) Extract the global constants from the supplied integer expression representation (string) and add them to the supplied import list.static String
collapseName
(String name) Collapse primitive type names.static String
containerFullName
(SymtabEntry container) static boolean
corbaLevel
(float min, float max) private static String
doContainerFullName
(SymtabEntry container) static String
fileName
(SymtabEntry entry, NameModifier modifier, String extension) static String
fileName
(SymtabEntry entry, String extension) Given a symbol table entry, return the name of the file which should be created.(package private) static void
fillInfo
(SymtabEntry infoEntry) Fill the info field with the full name (with array info) of the type.(package private) static void
static GenFileStream
getStream
(String name, SymtabEntry entry) static String
Fetch the version number of this build of the IDL-to-Java (portable) compiler from the appropriate properties file.static String
helperName
(SymtabEntry entry, boolean qualifiedName) (package private) static String
hexToOctal
(String hex) static String
holderName
(SymtabEntry entry) static boolean
IDLEntity
(SymtabEntry entry) static boolean
isInterface
(String name) static String
javaName
(SymtabEntry entry) Given a SymtabEntry, return the string which should be used for this entry.static String
javaNativeName
(String name) static String
javaPrimName
(String name) static String
javaQualifiedName
(SymtabEntry entry) Given a symtabEntry, return the name of this entry.static void
(package private) static String
static String
(package private) static String
(package private) static String
private static void
printImports
(Vector<String> importList, PrintWriter stream) static String
sansArrayInfo
(String name) static String
sansArrayInfo
(Vector arrayInfo) static void
setPackageTranslation
(Hashtable pkgtrans) (package private) static void
setSymbolTable
(Hashtable symtab) This method is called by Setup.preEmit, so symbolTable is available for all Util methods.static GenFileStream
stream
(SymtabEntry entry, NameModifier modifier, String extension) static GenFileStream
stream
(SymtabEntry entry, String extension) static String
stripLeadingUnderscores
(String string) static String
stripLeadingUnderscoresFromID
(String string) static String
static SymtabEntry
typeOf
(SymtabEntry entry) static void
writeInitializer
(String indent, String name, String arrayDcl, SymtabEntry entry, PrintWriter stream) static void
writeInitializer
(String indent, String name, String arrayDcl, SymtabEntry entry, String initializer, PrintWriter stream) static void
writePackage
(PrintWriter stream, SymtabEntry entry) static void
writePackage
(PrintWriter stream, SymtabEntry entry, short type) static void
writePackage
(PrintWriter stream, SymtabEntry entry, String name, short type) static void
writeProlog
(PrintWriter stream, String filename) Methods inherited from class com.sun.tools.corba.ee.idl.Util
absDelta, capitalize, getAbsolutePath, getMessage, getMessage, getMessage, getVersion, isAttribute, isConst, isEnum, isException, isInterface, isMethod, isModule, isParameter, isPrimitive, isSequence, isString, isStruct, isTypedef, isUnion, registerMessageResource
-
Field Details
-
TypeFile
static final short TypeFile- See Also:
-
StubFile
static final short StubFile- See Also:
-
HelperFile
static final short HelperFile- See Also:
-
HolderFile
static final short HolderFile- See Also:
-
StateFile
static final short StateFile- See Also:
-
symbolTable
-
packageTranslation
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
getVersion
Fetch the version number of this build of the IDL-to-Java (portable) compiler from the appropriate properties file.- Returns:
- the version number of this compiler build.
-
setSymbolTable
This method is called by Setup.preEmit, so symbolTable is available for all Util methods. -
setPackageTranslation
-
isInterface
-
arrayInfo
-
sansArrayInfo
-
sansArrayInfo
-
fileName
Given a symbol table entry, return the name of the file which should be created. -
fileName
-
stream
-
stream
-
getStream
-
containerFullName
-
translate
-
doContainerFullName
-
javaName
Given a SymtabEntry, return the string which should be used for this entry. Enums are converted to ints, typedefs and sequences are converted to their info types. javaQualifiedName does not do any of these conversions. -
javaPrimName
-
javaNativeName
-
javaQualifiedName
Given a symtabEntry, return the name of this entry. This method does not do any conversions like javaName does. -
collapseName
Collapse primitive type names. -
typeOf
-
fillInfo
Fill the info field with the full name (with array info) of the type. -
fillValueBoxInfo
-
holderName
-
helperName
-
writePackage
-
writePackage
-
writePackage
-
printImports
-
addTo
-
addImportLines
-
checkForArrays
private static void checkForArrays(SymtabEntry entry, Vector<SymtabEntry> importTypes, Vector<String> importList) -
checkForArrayBase
private static String checkForArrayBase(TypedefEntry t, Vector<SymtabEntry> importTypes, Vector<String> importList) -
checkForArrayDimensions
private static void checkForArrayDimensions(String arrays, Vector<SymtabEntry> importTypes, Vector<String> importList) -
checkForBounds
private static void checkForBounds(SymtabEntry entry, Vector<SymtabEntry> importTypes, Vector<String> importList) Determine the import lines for template types. -
checkForGlobalConstants
private static void checkForGlobalConstants(String exprRep, Vector<SymtabEntry> importTypes, Vector<String> importList) Extract the global constants from the supplied integer expression representation (string) and add them to the supplied import list. -
writeInitializer
public static void writeInitializer(String indent, String name, String arrayDcl, SymtabEntry entry, PrintWriter stream) -
writeInitializer
public static void writeInitializer(String indent, String name, String arrayDcl, SymtabEntry entry, String initializer, PrintWriter stream) -
mkdir
-
writeProlog
-
stripLeadingUnderscores
-
stripLeadingUnderscoresFromID
-
parseExpression
-
parseTerminal
-
hexToOctal
-
parseBinary
-
parseUnary
-
IDLEntity
-
corbaLevel
public static boolean corbaLevel(float min, float max) - Returns:
- true if the current setting of corbaLevel is within delta of the range min <= corbaLevel <= max
-