The following is my assumption.  I was not a developer on Apache SOAP when the 
code was written.

The XMI serializers depend on an XMI jar from IBM.  The ant build file allows 
Apache SOAP to be built without that jar, but Apache SOAP will then not have 
the XMI serializer classes as part of it.  This code is a way to handle the 
absence of those classes at run time when using a version of Apache SOAP built 
that way.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "WJCarpenter" <[EMAIL PROTECTED]>
To: "soap-dev" <[email protected]>
Sent: Friday, August 05, 2005 9:26 PM
Subject: odd reflective stuff


> I happened across this stuff in org.apache.soap.encoding.SOAPMappingRegistry.
> Those Class.forName() calls struck me as a little odd.  It's mainly
> curiosity, but I wonder why those things were instantiated
> reflectively instead of just via new like so many other serializers in
> that same source file.
> 
> 
>     try {
>       Class XMISerializer =
>         Class.forName("org.apache.soap.util.xml.XMISerializer");
>       Class XMIParameterSerializer =
>         Class.forName("org.apache.soap.encoding.xmi.XMIParameterSerializer");
> 
>       // Register default serializers for XMI encoding style.
>       mapTypes(Constants.NS_URI_XMI_ENC, null, null,
>                (Serializer)XMISerializer.newInstance(),
>                (Deserializer)XMIParameterSerializer.newInstance());
> 
>       // Register serializer for Parameter class - not deserializer!
>       mapTypes(Constants.NS_URI_XMI_ENC, null, Parameter.class,
>                (Serializer)XMIParameterSerializer.newInstance(), null);
>     } catch (IllegalAccessException iae) {
>     } catch (InstantiationException ie) {
>     } catch (ClassNotFoundException cnfe) {
>     } catch (NoClassDefFoundError ncdfe) {
>       // If the class can't be loaded, continue without it...
>     }
> 
> -- 
> [EMAIL PROTECTED] (WJCarpenter)    PGP 0x91865119
> 38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3
> 
>

Reply via email to