Package org.apache.cxf.aegis.type

Examples of org.apache.cxf.aegis.type.TypeMapping


            if (desc == null) {
                return null;
            }

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

                throw e;
View Full Code Here


            typeQName = extractQName(reader, typeName);
        } else {
            typeQName = reader.getName();
        }

        TypeMapping tm = context.getTypeMapping();
        if (tm == null) {
            tm = getTypeMapping();
        }

        type = tm.getType(typeQName);

        if (type == null) {
            type = tm.getType(getSchemaType());
        }

        if (type == this) {
            throw new DatabindingException("Could not determine how to read type: " + typeQName);
        }
View Full Code Here

            nilWriter.close();
        } else {
            Type type = determineType(context, object.getClass());

            if (null == type) {
                TypeMapping tm = context.getTypeMapping();
                if (tm == null) {
                    tm = getTypeMapping();
                }

                type = tm.getTypeCreator().createType(object.getClass());
                tm.register(type);
            }
           
            writer.writeXsiType(type.getSchemaType());
            boolean nextIsBeanType = type instanceof BeanType;
            if (nextIsBeanType) {
View Full Code Here

            }
        }
    }

    public Type determineType(Context context, Class clazz) {
        TypeMapping tm = context.getTypeMapping();
        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

        if (configuration == null) {
            configuration = new TypeCreationOptions();
        }
        if (typeMapping == null) {
            boolean defaultNillable = configuration.isDefaultNillable();
            TypeMapping baseTM = DefaultTypeMapping.createDefaultTypeMapping(defaultNillable,
                                                                             mtomUseXmime,
                                                                             enableJDOMMappings);
            if (mappingNamespaceURI == null) {
                mappingNamespaceURI = DefaultTypeMapping.DEFAULT_MAPPING_URI;
            }
View Full Code Here

            typeQName = extractQName(reader, typeName);
        } else {
            typeQName = reader.getName();
        }

        TypeMapping tm = context.getTypeMapping();
        if (tm == null) {
            tm = getTypeMapping();
        }

        type = tm.getType(typeQName);

        if (type == null) {
            type = tm.getType(getSchemaType());
        }

        if (type == this) {
            throw new DatabindingException("Could not determine how to read type: " + typeQName);
        }
View Full Code Here

            nilWriter.close();
        } else {
            Type type = determineType(context, object.getClass());

            if (null == type) {
                TypeMapping tm = context.getTypeMapping();
                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

            type.writeObject(object, writer, context);
        }
    }

    private Type determineType(Context context, Class clazz) {
        TypeMapping tm = context.getTypeMapping();
        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 AegisType getOrCreateNonQi4jType( Object value )
    {
        AegisType type;
        TypeMapping mapping = getTypeMapping();
        Class<?> javaType = value.getClass();
        type = mapping.getType( javaType );
        if( type == null )
        {
            // This might be wrong and instead the ultimate top parent should be used. This works, since
            // we know that we are the top parent.
            type = getTypeMapping().getTypeCreator().createType( javaType );
            mapping.register( type );
        }
        return type;
    }
View Full Code Here

        private void createQi4jTypeCreator( AegisDatabinding dataBinding )
        {
            Qi4jTypeCreator qi4jTypeCreator = obf.newObject( Qi4jTypeCreator.class );

            AegisContext aegisContext = dataBinding.getAegisContext();
            TypeMapping typeMapping = aegisContext.getTypeMapping();
            AbstractTypeCreator defaultCreator = (AbstractTypeCreator) typeMapping.getTypeCreator();
            TypeCreationOptions configuration = defaultCreator.getConfiguration();
            qi4jTypeCreator.setConfiguration( configuration );
            qi4jTypeCreator.setNextCreator( defaultCreator );
            qi4jTypeCreator.setTypeMapping( typeMapping );
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.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.