Examples of BeanSerializerFactory


Examples of com.fasterxml.jackson.databind.ser.BeanSerializerFactory

   
    public void testFindExplicit() throws JsonMappingException
    {
        ObjectMapper mapper = new ObjectMapper();
        SerializationConfig config = mapper.getSerializationConfig();
        SerializerFactory f = new BeanSerializerFactory(null);
        DefaultSerializerProvider prov = new DefaultSerializerProvider.Impl().createInstance(config, f);

        // Should have working default key and null key serializers
        assertNotNull(prov.findKeySerializer(mapper.constructType(String.class), null));
        assertNotNull(prov.getDefaultNullKeySerializer());
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

        reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);

        QName beanQName = new QName("typeNS", "TheBean");
        tm.register(AttributeBean.class,
                    beanQName,
                    new BeanSerializerFactory(AttributeBean.class, beanQName),
                    new BeanDeserializerFactory(AttributeBean.class, beanQName));

        // Serialize the bean in to XML
        msg.output(context);
        // Get the XML as a string
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

        // if applicable, otherwise issue errors and treat as an anyType
        if (factory == null) {
            if (isEnumClass(type)) {
                factory = new EnumSerializerFactory(type, qName);
            } else if (isBeanCompatible(type, true)) {
                factory = new BeanSerializerFactory(type, qName);
            } else {
                return;
            }
        }
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

            // If we're doing autoTyping, and we got a type in the right
            // namespace, we can use the default serializer.
            if (doAutoTypes &&
                    xmlType.getNamespaceURI().equals(Constants.NS_URI_JAVA)) {
                return new BeanSerializerFactory(javaType, xmlType);
            }
        }

        // Try to get the serializer associated with this pair
        Pair pair = new Pair(javaType, xmlType);
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

                                             Constants.XSD_NMTOKENS)
        );

        // a xsd:NOTATION
        myRegister(Constants.XSD_NOTATION, org.apache.axis.types.Notation.class,
                   new BeanSerializerFactory(org.apache.axis.types.Notation.class,
                                             Constants.XSD_NOTATION),
                   new BeanDeserializerFactory(org.apache.axis.types.Notation.class,
                                             Constants.XSD_NOTATION)
        );

        // a xsd:XSD_ENTITY
        myRegister(Constants.XSD_ENTITY, org.apache.axis.types.Entity.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Entity.class,
                                             Constants.XSD_ENTITY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Entity.class,
                                             Constants.XSD_ENTITY)
        );

        // a xsd:XSD_ENTITIES
        myRegister(Constants.XSD_ENTITIES, org.apache.axis.types.Entities.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Entities.class,
                                             Constants.XSD_ENTITIES),
                   new SimpleDeserializerFactory(org.apache.axis.types.Entities.class,
                                             Constants.XSD_ENTITIES)
        );

        // a xsd:XSD_IDREF
        myRegister(Constants.XSD_IDREF, org.apache.axis.types.IDRef.class,
                   new SimpleSerializerFactory(org.apache.axis.types.IDRef.class,
                                             Constants.XSD_IDREF),
                   new SimpleDeserializerFactory(org.apache.axis.types.IDRef.class,
                                             Constants.XSD_IDREF)
        );

        // a xsd:XSD_XSD_IDREFS
        myRegister(Constants.XSD_IDREFS, org.apache.axis.types.IDRefs.class,
                   new SimpleSerializerFactory(org.apache.axis.types.IDRefs.class,
                                             Constants.XSD_IDREFS),
                   new SimpleDeserializerFactory(org.apache.axis.types.IDRefs.class,
                                             Constants.XSD_IDREFS)
        );
       
        // a xsd:Duration
        myRegister(Constants.XSD_DURATION, org.apache.axis.types.Duration.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Duration.class,
                                             Constants.XSD_DURATION),
                   new SimpleDeserializerFactory(org.apache.axis.types.Duration.class,
                                             Constants.XSD_DURATION)
        );
       
        // a xsd:anyURI
        myRegister(Constants.XSD_ANYURI, org.apache.axis.types.URI.class,
                   new SimpleSerializerFactory(org.apache.axis.types.URI.class,
                                             Constants.XSD_ANYURI),
                   new SimpleDeserializerFactory(org.apache.axis.types.URI.class,
                                             Constants.XSD_ANYURI)
        );

        // a xsd:schema
        myRegister(Constants.XSD_SCHEMA, org.apache.axis.types.Schema.class,
                   new BeanSerializerFactory(org.apache.axis.types.Schema.class,
                                             Constants.XSD_SCHEMA),
                   new BeanDeserializerFactory(org.apache.axis.types.Schema.class,
                                             Constants.XSD_SCHEMA)
        );
       
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

            // If we're doing autoTyping, and we got a type in the right
            // namespace, we can use the default serializer.
            if (doAutoTypes &&
                    xmlType.getNamespaceURI().equals(Constants.NS_URI_JAVA)) {
                return new BeanSerializerFactory(javaType, xmlType);
            }
        }

        // Try to get the serializer associated with this pair
        Pair pair = new Pair(javaType, xmlType);
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

        // If no factory is found, use the BeanSerializerFactory
        // if applicable, otherwise issue errors and treat as an anyType
        if (factory == null) {
            if (isBeanCompatible(type, true)) {
                factory = new BeanSerializerFactory(type, qName);
            } else {
                return null// Don't return an element name
            }
        }
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

        provider.deployService(SOAPAction, reverse);

        // And deploy the type mapping
        Class javaType = Data.class;
        QName xmlType = new QName("urn:foo", "Data");
        BeanSerializerFactory   sf = new BeanSerializerFactory(javaType, xmlType);
        BeanDeserializerFactory df = new BeanDeserializerFactory(javaType, xmlType);

        TypeMappingRegistry tmr = engine.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC);
        if (tm == null || tm == tmr.getDefaultTypeMapping()) {
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

            // If we're doing autoTyping, and we got a type in the right
            // namespace, we can use the default serializer.
            if (doAutoTypes &&
                    xmlType.getNamespaceURI().equals(Constants.NS_URI_JAVA)) {
                return new BeanSerializerFactory(javaType, xmlType);
            }
        }

        // Try to get the serializer associated with this pair
        Pair pair = new Pair(javaType, xmlType);
View Full Code Here

Examples of org.apache.axis.encoding.ser.BeanSerializerFactory

        provider.deployService(SOAPAction, reverse);
       
        // And deploy the type mapping
        Class javaType = Data.class;
        QName xmlType = new QName("urn:foo", "Data");
        BeanSerializerFactory   sf = new BeanSerializerFactory(javaType, xmlType);
        BeanDeserializerFactory df = new BeanDeserializerFactory(javaType, xmlType);

        TypeMappingRegistry tmr = engine.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC);
        if (tm == null || tm == tmr.getDefaultTypeMapping()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.