com.thoughtworks.xstream.converters.reflection.ExternalizableConverter Java Examples

The following examples show how to use com.thoughtworks.xstream.converters.reflection.ExternalizableConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CubaXStream.java    From cuba with Apache License 2.0 5 votes vote down vote up
public CubaXStreamConverterLookup(List<Class> excluded) {
    super();
    this.excluded = new ArrayList<>();
    this.excluded.add(ExternalizableConverter.class);
    if (excluded != null) {
        this.excluded.addAll(excluded);
    }
}
 
Example #2
Source File: XStreamValid.java    From Digital with GNU General Public License v3.0 4 votes vote down vote up
@Override
    protected void setupConverters() {
        this.registerConverter(new ReflectionConverter(getMapper(), getReflectionProvider()), -20);
        this.registerConverter(new SerializableConverter(getMapper(), getReflectionProvider(), getClassLoaderReference()), -10);
        this.registerConverter(new ExternalizableConverter(getMapper(), getClassLoaderReference()), -10);
        this.registerConverter(new NullConverter(), 10000);
        this.registerConverter(new IntConverter(), 0);
        this.registerConverter(new FloatConverter(), 0);
        this.registerConverter(new DoubleConverter(), 0);
        this.registerConverter(new LongConverter(), 0);
        this.registerConverter(new ShortConverter(), 0);
        this.registerConverter((Converter) (new CharConverter()), 0);
        this.registerConverter(new BooleanConverter(), 0);
        this.registerConverter(new ByteConverter(), 0);
        this.registerConverter(new StringConverter(), 0);
        this.registerConverter(new StringBufferConverter(), 0);
        this.registerConverter(new DateConverter(), 0);
        this.registerConverter(new BitSetConverter(), 0);
        this.registerConverter(new URIConverter(), 0);
        this.registerConverter(new URLConverter(), 0);
        this.registerConverter(new BigIntegerConverter(), 0);
        this.registerConverter(new BigDecimalConverter(), 0);
        this.registerConverter(new ArrayConverter(getMapper()), 0);
        this.registerConverter(new CharArrayConverter(), 0);
        this.registerConverter(new CollectionConverter(getMapper()), 0);
        this.registerConverter(new MapConverter(getMapper()), 0);
//        this.registerConverter((Converter)(new TreeMapConverter(getMapper())), 0);
//        this.registerConverter((Converter)(new TreeSetConverter(getMapper())), 0);
        this.registerConverter(new SingletonCollectionConverter(getMapper()), 0);
        this.registerConverter(new SingletonMapConverter(getMapper()), 0);
//        this.registerConverter((Converter)(new PropertiesConverter()), 0);
        this.registerConverter((Converter) (new EncodedByteArrayConverter()), 0);
        this.registerConverter(new FileConverter(), 0);
        if (JVM.isSQLAvailable()) {
            this.registerConverter(new SqlTimestampConverter(), 0);
            this.registerConverter(new SqlTimeConverter(), 0);
            this.registerConverter(new SqlDateConverter(), 0);
        }

//        this.registerConverter((Converter)(new DynamicProxyConverter(getMapper(), getClassLoaderReference())), 0);
        this.registerConverter(new JavaClassConverter(getClassLoaderReference()), 0);
        this.registerConverter(new JavaMethodConverter(getClassLoaderReference()), 0);
        this.registerConverter(new JavaFieldConverter(getClassLoaderReference()), 0);
        if (JVM.isAWTAvailable()) {
//            this.registerConverter((Converter)(new FontConverter(getMapper())), 0);
            this.registerConverter(new ColorConverter(), 0);
//            this.registerConverter((SingleValueConverter)(new TextAttributeConverter()), 0);
        }

        if (JVM.isSwingAvailable()) {
            this.registerConverter(new LookAndFeelConverter(getMapper(), getReflectionProvider()), 0);
        }

        this.registerConverter(new LocaleConverter(), 0);
        this.registerConverter(new GregorianCalendarConverter(), 0);

        this.registerConverter(new EnumConverter(), 0);

        this.registerConverter(new SelfStreamingInstanceChecker(getConverterLookup(), this), 0);
    }