Class IDLNames

java.lang.Object
org.glassfish.rmic.iiop.IDLNames
All Implemented Interfaces:
Constants, Constants, Constants, RuntimeConstants

public class IDLNames extends 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 Details

    • 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 Details

    • IDLNames

      public IDLNames()
  • Method Details

    • getMemberOrMethodName

      public static String getMemberOrMethodName(NameContext nameContext, 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 String convertToISOLatin1(String name)
      Convert names with illegal IDL identifier characters.

      Section 28.3.2.4

    • convertIDLKeywords

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

      Section 28.3.2.5

    • convertLeadingUnderscores

      public static String convertLeadingUnderscores(String name)
      Convert names which have leading underscores

      Section 28.3.2.3

    • getClassOrInterfaceName

      public static String getClassOrInterfaceName(Identifier id, BatchEnvironment env) throws 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:
      Exception
    • toInnerClassName

      private static String toInnerClassName(String typeName)
    • getExceptionName

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

      Section 28.3.7.2 (see ValueType)

    • getModuleNames

      public static String[] getModuleNames(Identifier theID, boolean boxIt, BatchEnvironment env) throws 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:
      Exception
    • getArrayName

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

      Section 28.3.6 (see ArrayType)

    • getArrayModuleNames

      public static String[] getArrayModuleNames(Type theType)
      Get an array module names.
    • getInitialAttributeKind

      private static int getInitialAttributeKind(CompoundType.Method method, BatchEnvironment env) throws ClassNotFound
      Throws:
      ClassNotFound
    • setAttributeKinds

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

      public static void setMethodNames(CompoundType container, CompoundType.Method[] allMethods, BatchEnvironment env) throws 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:
      Exception
    • stripLeadingUnderscore

      private static String stripLeadingUnderscore(String name)
    • stripTrailingUnderscore

      private static String stripTrailingUnderscore(String name)
    • convertOverloadedMethods

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

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

      private static boolean doesConstructorCollide(String name, CompoundType.Method method, CompoundType.Method[] allMethods, String[] allNames, boolean compareConstructors)
    • setMemberNames

      public static void setMemberNames(CompoundType container, CompoundType.Member[] allMembers, CompoundType.Method[] allMethods, BatchEnvironment env) throws Exception
      Set all the member names in a given class.

      Section 28.3.2.7 (see CompoundType) Section 28.3.2.7

      Throws:
      Exception
    • getTypeName

      public static 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 String getQualifiedName(String[] idlModuleNames, String idlName)
      Create a qualified name.
    • replace

      public static String replace(String source, String match, 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 String getIDLRepositoryID(String idlName)
      Get an IDL style repository id for
    • getTypeOrModuleName

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

      Section 28.3.2.2 Section 28.3.2.3