private void configureTypeMapping( final Configuration configuration )
throws ConfigurationException
{
final String namespace = configuration.getAttribute( "namespace" );
TypeMapping tm = getTypeMapping( namespace );
if( null == tm )
{
final String parentNamespace = configuration.getAttribute( "parentNamespace",
getDefaultTypeMapping().getEncodingStyleURI() );
tm = createTypeMapping( parentNamespace, false );
register( namespace, tm );
if( configuration.getAttributeAsBoolean( "default", false ) )
{
registerDefault( tm );
}
// register primitive types manually since there is no way
// to do Class.forName("boolean") et al.
tm.register( boolean.class, new QName( SoapConstants.XSD, "boolean" ), new BooleanType() );
tm.register( int.class, new QName( SoapConstants.XSD, "int" ), new IntType() );
tm.register( double.class, new QName( SoapConstants.XSD, "double" ), new DoubleType() );
tm.register( float.class, new QName( SoapConstants.XSD, "float" ), new FloatType() );
tm.register( long.class, new QName( SoapConstants.XSD, "long" ), new LongType() );
}
final Configuration[] types = configuration.getChildren( "type" );
for( int i = 0; i < types.length; i++ )