Package org.codehaus.xfire.aegis.type

Examples of org.codehaus.xfire.aegis.type.TypeMapping


        return type;
    }

    public Type getType(Service service, Class clazz)
    {
        TypeMapping tm = getTypeMapping(service);
        Type type = tm.getType(clazz);

        if (type == null)
        {
            type = tm.getTypeCreator().createType(clazz);
            tm.register(type);
        }

        return type;
    }
View Full Code Here


        /*
         * Don't dig any deeper than Object or Exception
         */
        if (c != null && c != Object.class && c != Exception.class && c != RuntimeException.class)
        {
            TypeMapping tm = info.getTypeMapping();
            BeanType superType = (BeanType) tm.getType(c);
            if (superType == null)
            {
                superType = (BeanType) getTypeMapping().getTypeCreator().createType(c);
                Class cParent = c.getSuperclass();
                if (cParent != null && cParent != Object.class)
                {
                    superType.getTypeInfo().setExtension(true);
                }
                tm.register(superType);
            }
            return superType;
        }
        else
        {
View Full Code Here

        else
        {
            typeQName = reader.getName();
        }

        TypeMapping tm = (TypeMapping) context.getService().getProperty(AegisBindingProvider.TYPE_MAPPING_KEY);
        if (tm == null)
        {
            tm = getTypeMapping();
        }
       
        type = tm.getType( typeQName );
       
        if (type == null)
        {
            type = tm.getType(getSchemaType());
        }

        if (type == null && readToDocument)
    {
      type = getTypeMapping().getType(Document.class);
View Full Code Here

        {
            Type type = determineType( context, object.getClass() );

            if( null == type )
            {
              TypeMapping tm = (TypeMapping) context.getService().getProperty(AegisBindingProvider.TYPE_MAPPING_KEY);
                if (tm == null)
                {
                    tm = getTypeMapping();
                }
               
              type = tm.getTypeCreator().createType(object.getClass());
                tm.register(type);
            }
           
            String prefix = writer.getPrefixForNamespace( type.getSchemaType().getNamespaceURI() );

            if( null == prefix || prefix.length() == 0 )
View Full Code Here

        }
    }

    private Type determineType( MessageContext context, Class clazz )
    {
        TypeMapping tm = (TypeMapping) context.getService().getProperty(AegisBindingProvider.TYPE_MAPPING_KEY);
        if (tm == null)
        {
            tm = getTypeMapping();
        }
        Type type = tm.getType( clazz );

        if (null != type)
        {
            return type;
        }

        Class[] interfaces = clazz.getInterfaces();

        for( int i = 0; i < interfaces.length; i++ )
        {
            Class anInterface = interfaces[i];

            type = tm.getType( anInterface );

            if( null != type ) {
                return type;
            }
        }
View Full Code Here

    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++ )
View Full Code Here

                return null;
            }

            try
            {
                TypeMapping tm = getTypeMapping();
                TypeCreator tc = tm.getTypeCreator();
                type = tc.createType(desc);
            }
            catch (XFireRuntimeException e)
            {
                e.prepend("Couldn't create type for property " + desc.getName() + " on "
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.aegis.type.TypeMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.