Package com.thoughtworks.xstream.converters

Examples of com.thoughtworks.xstream.converters.Converter


    void migrateFrom24() throws SecurityConfigException, IOException {
        // allows migration of RoleSource from PreAuthenticatedUserNameFilterConfig
        MigrationHelper mh = new MigrationHelper() {
            @Override
            public void migrationPersister(XStreamPersister xp) {
                xp.getXStream().registerConverter(new Converter() {
   
                    @Override
                    public boolean canConvert(Class cls) {
                        return cls.isAssignableFrom(RoleSource.class);
                    }
View Full Code Here


        xs.processAnnotations(AboutModel.class);
        xs.addImplicitCollection(AboutModel.class, "manifests");
        xs.alias("about", AboutModel.class);

        // ManifestModel Xstream converter
        xs.registerConverter(new Converter() {

            @Override
            public boolean canConvert(Class type) {
                return type.equals(ManifestModel.class);
            }

            @Override
            public void marshal(Object source, HierarchicalStreamWriter writer,
                    MarshallingContext context) {
                ManifestModel model = (ManifestModel) source;
                writer.addAttribute("name", model.getName());
                for (java.util.Map.Entry<String, String> entry : model.getEntries().entrySet())
                    context.convertAnother(entry, new Converter() {

                        @Override
                        public boolean canConvert(Class type) {
                            if (java.util.Map.Entry.class.isAssignableFrom(type))
                                return true;
View Full Code Here

                    writer.endNode();
                }
            }
        );
        xstream.registerConverter(
            new Converter() {

                public boolean canConvert(Class type) {
                    return clazz.isAssignableFrom( type );
                }
               
View Full Code Here

                    writer.endNode();
                }
            }
        );
        xstream.registerConverter(
            new Converter() {

                public boolean canConvert(Class type) {
                    return clazz.isAssignableFrom( type );
                }
               
View Full Code Here

        private AssociatedConverterImpl(XStream xstream) {
            this.xstream = xstream;
        }

        private Converter findConverter(Class t) {
            Converter result = cache.get(t);
            if (result != null)
                // ConcurrentHashMap does not allow null, so use this object to represent null
                return result == this ? null : result;
            try {
                if(t==null || t.getClassLoader()==null)
View Full Code Here

            final XStream xStream = ((XstreamRepresentation) representation).getXStream();
            xStream.alias("layers", List.class);

            xmlConfig.getConfiguredXStreamWithContext(xStream, Context.REST);

            xStream.registerConverter(new Converter() {

                /**
                 * @see com.thoughtworks.xstream.converters.ConverterMatcher#canConvert(java.lang.Class)
                 */
                public boolean canConvert(@SuppressWarnings("rawtypes") Class type) {
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.converters.Converter

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.