iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/marshal/CDRStream.java
public static CDRStreamWriter writerFor(String s, ClassLoader cl) {
        switch (s.charAt(0)) {

            case 'A':
                return AbstractInterfaceWriter.instance;
            case 'B':
                return ByteWriter.instance;
            case 'C':
                return CharWriter.instance;
            case 'D':
                return DoubleWriter.instance;
            case 'E':
                return SerializableWriter.instance;
            case 'F':
                return FloatWriter.instance;
            case 'G':
                return StringWriter.instance;
            case 'I':
                return IntWriter.instance;
            case 'J':
                return LongWriter.instance;
            case 'L':
                try {
                    // Use Class.forName() (rather than cl.loadClass()), because
                    // Class.forName() loads Java array types (which are valuetypes).
                    return new ValuetypeWriter(Class.forName(s.substring(1),
                            true,
                            cl));
                } catch (ClassNotFoundException e) {
                    throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(s.substring(1), e);
                }
            case 'M':
                return CorbaObjectWriter.instance;
            case 'N':
                try {
                    return new IdlInterfaceWriter(cl.loadClass(s.substring(1)));
                } catch (ClassNotFoundException e) {
                    throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(s.substring(1), e);
                }
            case 'O':
                return ObjectWriter.instance;
            case 'R':
                return RemoteWriter.instance;
            case 'S':
                return ShortWriter.instance;
            case 'V':
                return null;
            case 'X':
                return ExternalizableWriter.instance;
            case 'Z':
                return BooleanWriter.instance;
            default:
                return null;
        }
    }
public static CDRStreamWriter writerFor(String s, ClassLoader cl) {
        switch (s.charAt(0)) {

            case 'A':
                return AbstractInterfaceWriter.instance;
            case 'B':
                return ByteWriter.instance;
            case 'C':
                return CharWriter.instance;
            case 'D':
                return DoubleWriter.instance;
            case 'E':
                return SerializableWriter.instance;
            case 'F':
                return FloatWriter.instance;
            case 'G':
                return StringWriter.instance;
            case 'I':
                return IntWriter.instance;
            case 'J':
                return LongWriter.instance;
            case 'L':
                try {
                    // Use Class.forName() (rather than cl.loadClass()), because
                    // Class.forName() loads Java array types (which are valuetypes).
                    return new ValuetypeWriter(Class.forName(s.substring(1),
                            true,
                            cl));
                } catch (ClassNotFoundException e) {
                    throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(s.substring(1), e);
                }
            case 'M':
                return CorbaObjectWriter.instance;
            case 'N':
                try {
                    return new IdlInterfaceWriter(cl.loadClass(s.substring(1)));
                } catch (ClassNotFoundException e) {
                    throw IIOPLogger.ROOT_LOGGER.errorLoadingClass(s.substring(1), e);
                }
            case 'O':
                return ObjectWriter.instance;
            case 'R':
                return RemoteWriter.instance;
            case 'S':
                return ShortWriter.instance;
            case 'V':
                return null;
            case 'X':
                return ExternalizableWriter.instance;
            case 'Z':
                return BooleanWriter.instance;
            default:
                return null;
        }
    }
public static CDRStreamWriter writerFor ( String s , ClassLoader cl ) { switch ( s . charAt ( 0 ) ) { case ' ' : return AbstractInterfaceWriter . instance ; case ' ' : return ByteWriter . instance ; case ' ' : return CharWriter . instance ; case ' ' : return DoubleWriter . instance ; case ' ' : return SerializableWriter . instance ; case ' ' : return FloatWriter . instance ; case ' ' : return StringWriter . instance ; case ' ' : return IntWriter . instance ; case ' ' : return LongWriter . instance ; case ' ' : try { // Use Class.forName() (rather than cl.loadClass()), because // Class.forName() loads Java array types (which are valuetypes). return new ValuetypeWriter ( Class . forName ( s . substring ( 1 ) , true , cl ) ) ; } catch ( ClassNotFoundException e ) { throw IIOPLogger . ROOT_LOGGER . errorLoadingClass ( s . substring ( 1 ) , e ) ; } case ' ' : return CorbaObjectWriter . instance ; case ' ' : try { return new IdlInterfaceWriter ( cl . loadClass ( s . substring ( 1 ) ) ) ; } catch ( ClassNotFoundException e ) { throw IIOPLogger . ROOT_LOGGER . errorLoadingClass ( s . substring ( 1 ) , e ) ; } case ' ' : return ObjectWriter . instance ; case ' ' : return RemoteWriter . instance ; case ' ' : return ShortWriter . instance ; case ' ' : return null ; case ' ' : return ExternalizableWriter . instance ; case ' ' : return BooleanWriter . instance ; default : return null ; } }
Returns a <code>CDRStreamWriter</code> given an abbreviated name
and a <code>ClassLoader</code> for valuetype classes.
Returns a <code > CDRStreamWriter< / code > given an abbreviated name and a <code > ClassLoader< / code > for valuetype classes .