Class IDLNames

  • All Implemented Interfaces:
    Constants, Constants, Constants, RuntimeConstants

    public class IDLNames
    extends java.lang.Object
    implements Constants
    IDLNames provides static utility methods to perform the IDL name mappings specified in Chapter 5 of the Java Language to IDL specification.
    • Field Detail

      • ASCII_HEX

        public static final byte[] ASCII_HEX
        Used to convert ascii to hex.
      • IDL_IDENTIFIER_CHARS

        private static final byte[] IDL_IDENTIFIER_CHARS
    • Constructor Detail

      • IDLNames

        public IDLNames()
    • Method Detail

      • getMemberOrMethodName

        public static java.lang.String getMemberOrMethodName​(NameContext nameContext,
                                                             java.lang.String name,
                                                             BatchEnvironment env)
        Convert a name. The nameContext argument MUST be pre-filled with all names from the appropriate context (e.g. all the method names in a given class). The names must not have had any IDL conversions applied.

        Section 28.3.2.2 Section 28.3.2.3 Section 28.3.2.4 Section 28.3.2.7 (member and method names only)

      • convertToISOLatin1

        public static java.lang.String convertToISOLatin1​(java.lang.String name)
        Convert names with illegal IDL identifier characters.

        Section 28.3.2.4

      • convertIDLKeywords

        public static java.lang.String convertIDLKeywords​(java.lang.String name)
        Convert names which collide with IDL keywords.

        Section 28.3.2.5

      • convertLeadingUnderscores

        public static java.lang.String convertLeadingUnderscores​(java.lang.String name)
        Convert names which have leading underscores

        Section 28.3.2.3

      • getClassOrInterfaceName

        public static java.lang.String getClassOrInterfaceName​(Identifier id,
                                                               BatchEnvironment env)
                                                        throws java.lang.Exception
        Convert a type name.

        Section 28.3.2.5 Section 28.3.2.7 (class or interface names only) Throws exception if fails 28.3.2.7.

        Throws:
        java.lang.Exception
      • toInnerClassName

        private static java.lang.String toInnerClassName​(java.lang.String typeName)
      • getExceptionName

        public static java.lang.String getExceptionName​(java.lang.String idlName)
        Convert an Exception name.

        Section 28.3.7.2 (see ValueType)

      • getModuleNames

        public static java.lang.String[] getModuleNames​(Identifier theID,
                                                        boolean boxIt,
                                                        BatchEnvironment env)
                                                 throws java.lang.Exception
        Convert a qualified Identifier into an array of IDL names.

        Section 28.3.2.1 (see CompoundType) Throws exception if fails 28.3.2.7.

        Throws:
        java.lang.Exception
      • getArrayName

        public static java.lang.String getArrayName​(Type theType,
                                                    int arrayDimension)
        Get an array name with the specified dimensions.

        Section 28.3.6 (see ArrayType)

      • getArrayModuleNames

        public static java.lang.String[] getArrayModuleNames​(Type theType)
        Get an array module names.
      • setAttributeKinds

        private static void setAttributeKinds​(CompoundType.Method[] methods,
                                              int[] kinds,
                                              java.lang.String[] names)
      • setMethodNames

        public static void setMethodNames​(CompoundType container,
                                          CompoundType.Method[] allMethods,
                                          BatchEnvironment env)
                                   throws java.lang.Exception
        Set all the method names in a given class.

        Section 28.3.2.7 (see CompoundType) Section 28.3.2.7 Section 28.3.4.3 (RemoteType/AbstractType only).

        Throws:
        java.lang.Exception
      • stripLeadingUnderscore

        private static java.lang.String stripLeadingUnderscore​(java.lang.String name)
      • stripTrailingUnderscore

        private static java.lang.String stripTrailingUnderscore​(java.lang.String name)
      • convertOverloadedMethods

        private static void convertOverloadedMethods​(CompoundType.Method[] allMethods,
                                                     java.lang.String[] names,
                                                     boolean[] overloaded)
      • doesMethodCollide

        private static boolean doesMethodCollide​(java.lang.String name,
                                                 CompoundType.Method method,
                                                 CompoundType.Method[] allMethods,
                                                 java.lang.String[] allNames,
                                                 boolean ignoreAttributes)
      • doesConstructorCollide

        private static boolean doesConstructorCollide​(java.lang.String name,
                                                      CompoundType.Method method,
                                                      CompoundType.Method[] allMethods,
                                                      java.lang.String[] allNames,
                                                      boolean compareConstructors)
      • getTypeName

        public static java.lang.String getTypeName​(int typeCode,
                                                   boolean isConstant)
        Get the name for the specified type code.

        Section 28.3..3 (see PrimitiveType) Section 28.3.5.10 (see SpecialClassType) Section 28.3.4.1 (see SpecialInterfaceType) Section 28.3.10.1 (see SpecialInterfaceType) Section 28.3.10.2 (see SpecialClassType)

      • getQualifiedName

        public static java.lang.String getQualifiedName​(java.lang.String[] idlModuleNames,
                                                        java.lang.String idlName)
        Create a qualified name.
      • replace

        public static java.lang.String replace​(java.lang.String source,
                                               java.lang.String match,
                                               java.lang.String replace)
        Replace substrings
        Parameters:
        source - The source string.
        match - The string to search for within the source string.
        replace - The replacement for any matching components.
        Returns:
      • getIDLRepositoryID

        public static java.lang.String getIDLRepositoryID​(java.lang.String idlName)
        Get an IDL style repository id for
      • getTypeOrModuleName

        private static java.lang.String getTypeOrModuleName​(java.lang.String name)
        Convert a type or module name.

        Section 28.3.2.2 Section 28.3.2.3