Package com.thoughtworks.xstream.mapper

Examples of com.thoughtworks.xstream.mapper.AttributeMapper


        mapper = new SystemAttributeAliasingMapper(mapper);
        mapper = new ImplicitCollectionMapper(mapper);
        mapper = new OuterClassMapper(mapper);
        mapper = new ArrayMapper(mapper);
        mapper = new DefaultImplementationsMapper(mapper);
        mapper = new AttributeMapper(mapper, converterLookup, reflectionProvider);
        mapper = new EnumMapper(mapper);
        mapper = new LocalConversionMapper(mapper);
        mapper = new ImmutableTypesMapper(mapper);
        mapper = new SecurityMapper(mapper);
        mapper = new AnnotationMapper(mapper, converterRegistry, converterLookup, classLoaderReference,
View Full Code Here


        listElementMappingList.get(c),
        itemFieldMappings.get(c),
        getOmitMap(c),
        elementClassMap.get(c));

    AttributeMapper amapper = new AttributeMapper(fmapper);

    XStream xstream = new XStream(rp, amapper, driver);

    xstream.registerConverter(new MapConverter(fmapper));
    xstream.registerConverter(new RestfullCollectionConverter(fmapper));
    xstream.registerConverter(new DataCollectionConverter(fmapper));
    xstream.registerConverter(new AtomLinkConverter());

    xstream.registerConverter(new ISO8601DateConverter());
    xstream.registerConverter(new ISO8601GregorianCalendarConverter());
    xstream.registerConverter(new ISO8601SqlTimestampConverter());
    xstream.registerConverter(new GuiceBeanConverter(fmapper, injector));
    xstream.registerConverter(new AtomAttributeConverter());
    xstream.setMode(XStream.NO_REFERENCES);

    amapper.addAttributeFor(AtomAttribute.class);

    // prevent NPE on xstream 1.3.x
    amapper.setConverterLookup(xstream.getConverterLookup());
    return new ConverterConfig(fmapper, xstream);
  }
View Full Code Here

    public void testCustomConverterCanBeInstantiatedAndRegisteredWithDesiredPriority() {
        XStream xstream = new XStream(new XppDriver());
        // using default mapper instead of XStream#buildMapper()
        Mapper mapper = new DefaultMapper(new CompositeClassLoader());
        // AttributeMapper required by ReflectionConverter
        mapper = new AttributeMapper(mapper, xstream.getConverterLookup(), xstream.getReflectionProvider());
        Converter converter = new CustomReflectionConverter(mapper, new PureJavaReflectionProvider());
        xstream.registerConverter(converter, -20);
        xstream.alias("world", World.class);
        World world = new World();
View Full Code Here

        mapper = new SystemAttributeAliasingMapper(mapper);
        mapper = new ImplicitCollectionMapper(mapper);
        mapper = new OuterClassMapper(mapper);
        mapper = new ArrayMapper(mapper);
        mapper = new DefaultImplementationsMapper(mapper);
        mapper = new AttributeMapper(mapper, converterLookup, reflectionProvider);
        if (JVM.is15()) {
            mapper = buildMapperDynamically(
                "com.thoughtworks.xstream.mapper.EnumMapper", new Class[]{Mapper.class},
                new Object[]{mapper});
        }
View Full Code Here

            mapper = new XStream11XmlFriendlyMapper(mapper);
        }
        mapper = new ClassAliasingMapper(mapper);
        mapper = new FieldAliasingMapper(mapper);
        mapper = new AttributeAliasingMapper(mapper);
        mapper = new AttributeMapper(mapper);
        mapper = new ImplicitCollectionMapper(mapper);
        if (jvm.loadClass("net.sf.cglib.proxy.Enhancer") != null) {
           mapper = buildMapperDynamically(
                    "com.thoughtworks.xstream.mapper.CGLIBMapper",
                    new Class[]{Mapper.class}, new Object[]{mapper});
View Full Code Here

        listElementMappingList.get(c),
        itemFieldMappings.get(c),
        getOmitMap(c),
        elementClassMap.get(c));

    AttributeMapper amapper = new AttributeMapper(fmapper, new DefaultConverterLookup(), rp);

    XStream xstream = new XStream(rp, driver, getClass().getClassLoader(), amapper);

    xstream.registerConverter(new MapConverter(fmapper));
    xstream.registerConverter(new RestfullCollectionConverter(fmapper));
    xstream.registerConverter(new DataCollectionConverter(fmapper));
    xstream.registerConverter(new AtomLinkConverter());

    xstream.registerConverter(new ISO8601DateConverter());
    xstream.registerConverter(new ISO8601GregorianCalendarConverter());
    xstream.registerConverter(new ISO8601SqlTimestampConverter());
    xstream.registerConverter(new GuiceBeanConverter(fmapper, injector));
    xstream.registerConverter(new AtomAttributeConverter());
    xstream.registerConverter(new ExtendableBeanConverter(), XStream.PRIORITY_VERY_HIGH);
    xstream.setMode(XStream.NO_REFERENCES);

    amapper.addAttributeFor(AtomAttribute.class);

    // prevent NPE on xstream 1.3.x
    amapper.setConverterLookup(xstream.getConverterLookup());
    return new ConverterConfig(fmapper, xstream);
  }
View Full Code Here

        listElementMappingList.get(c),
        itemFieldMappings.get(c),
        getOmitMap(c),
        elementClassMap.get(c));

    AttributeMapper amapper = new AttributeMapper(fmapper, new DefaultConverterLookup(), rp);

    XStream xstream = new XStream(rp, driver, getClass().getClassLoader(), amapper);

    xstream.registerConverter(new MapConverter(fmapper));
    xstream.registerConverter(new RestfullCollectionConverter(fmapper));
    xstream.registerConverter(new DataCollectionConverter(fmapper));
    xstream.registerConverter(new AtomLinkConverter());

    xstream.registerConverter(new ISO8601DateConverter());
    xstream.registerConverter(new ISO8601GregorianCalendarConverter());
    xstream.registerConverter(new ISO8601SqlTimestampConverter());
    xstream.registerConverter(new GuiceBeanConverter(fmapper, injector));
    xstream.registerConverter(new AtomAttributeConverter());
    xstream.registerConverter(new ExtendableBeanConverter(), XStream.PRIORITY_VERY_HIGH);
    xstream.setMode(XStream.NO_REFERENCES);

    amapper.addAttributeFor(AtomAttribute.class);

    // prevent NPE on xstream 1.3.x
    amapper.setConverterLookup(xstream.getConverterLookup());
    return new ConverterConfig(fmapper, xstream);
  }
View Full Code Here

        mapper = new SystemAttributeAliasingMapper(mapper);
        mapper = new ImplicitCollectionMapper(mapper);
        mapper = new OuterClassMapper(mapper);
        mapper = new ArrayMapper(mapper);
        mapper = new DefaultImplementationsMapper(mapper);
        mapper = new AttributeMapper(mapper, converterLookup);
        if (JVM.is15()) {
            mapper = buildMapperDynamically(
                "com.thoughtworks.xstream.mapper.EnumMapper", new Class[]{Mapper.class},
                new Object[]{mapper});
        }
View Full Code Here

        listElementMappingList.get(c),
        itemFieldMappings.get(c),
        getOmitMap(c),
        elementClassMap.get(c));

    AttributeMapper amapper = new AttributeMapper(fmapper, new DefaultConverterLookup(), rp);

    XStream xstream = new XStream(rp, driver, getClass().getClassLoader(), amapper);

    xstream.registerConverter(new MapConverter(fmapper));
    xstream.registerConverter(new RestfullCollectionConverter(fmapper));
    xstream.registerConverter(new DataCollectionConverter(fmapper));
    xstream.registerConverter(new AtomLinkConverter());
    xstream.registerConverter(new AtomSummaryConverter());

    xstream.registerConverter(new ISO8601DateConverter());
    xstream.registerConverter(new ISO8601GregorianCalendarConverter());
    xstream.registerConverter(new ISO8601SqlTimestampConverter());
    xstream.registerConverter(new GuiceBeanConverter(fmapper, injector));
    xstream.registerConverter(new AtomAttributeConverter());
    xstream.registerConverter(new ExtendableBeanConverter(), XStream.PRIORITY_VERY_HIGH);
    xstream.setMode(XStream.NO_REFERENCES);

    amapper.addAttributeFor(AtomAttribute.class);

    // prevent NPE on xstream 1.3.x
    amapper.setConverterLookup(xstream.getConverterLookup());
    return new ConverterConfig(fmapper, xstream);
  }
View Full Code Here

    InterfaceFieldAliasingMapper emapper = new InterfaceFieldAliasingMapper(
        dmapper, writerStack, getFieldAliasMappingList(c));
    InterfaceClassMapper fmapper = new InterfaceClassMapper(writerStack, emapper,
        getElementMappingList(c), getListElementMappingList(c),
        getItemFieldMappings(c), getOmitMap(c), getElementClassMap(c));
    AttributeMapper amapper = new AttributeMapper(fmapper);

    XStream xstream = new XStream(rp, amapper, driver);
    amapper.addAttributeFor(AtomAttribute.class);
    for (Converter converter : getConverters(fmapper, c)) {
      xstream.registerConverter(converter);
    }
    xstream.registerConverter(new ISO8601DateConverter());
    xstream.registerConverter(new ISO8601GregorianCalendarConverter());
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.mapper.AttributeMapper

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.