com.thoughtworks.xstream.converters.ConverterMatcher Java Examples

The following examples show how to use com.thoughtworks.xstream.converters.ConverterMatcher. 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 Project: lams   Author: lamsfoundation   File: AnnotationReflectionConverter.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
public AnnotationReflectionConverter(
                                     Mapper mapper, ReflectionProvider reflectionProvider,
                                     AnnotationProvider annotationProvider) {
    super(mapper, reflectionProvider);
    this.annotationProvider = annotationProvider;
    this.cachedConverters = new HashMap<Class<? extends ConverterMatcher>, Converter>();
}
 
Example #2
Source Project: lams   Author: lamsfoundation   File: AnnotationReflectionConverter.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void marshallField(final MarshallingContext context, Object newObj, Field field) {
    XStreamConverter annotation = annotationProvider.getAnnotation(
        field, XStreamConverter.class);
    if (annotation != null) {
        Class<? extends ConverterMatcher> type = annotation.value();
        ensureCache(type);
        context.convertAnother(newObj, cachedConverters.get(type));
    } else {
        context.convertAnother(newObj);
    }
}
 
Example #3
Source Project: lams   Author: lamsfoundation   File: AnnotationReflectionConverter.java    License: GNU General Public License v2.0 4 votes vote down vote up
private void ensureCache(Class<? extends ConverterMatcher> type) {
    if (!this.cachedConverters.containsKey(type)) {
        cachedConverters.put(type, newInstance(type));
    }
}
 
Example #4
Source Project: spring-analysis-note   Author: Vip-Augus   File: XStreamMarshaller.java    License: MIT License 2 votes vote down vote up
/**
 * Set the {@code Converters} or {@code SingleValueConverters} to be registered
 * with the {@code XStream} instance.
 * @see Converter
 * @see SingleValueConverter
 */
public void setConverters(ConverterMatcher... converters) {
	this.converters = converters;
}
 
Example #5
Source Project: java-technology-stack   Author: codeEngraver   File: XStreamMarshaller.java    License: MIT License 2 votes vote down vote up
/**
 * Set the {@code Converters} or {@code SingleValueConverters} to be registered
 * with the {@code XStream} instance.
 * @see Converter
 * @see SingleValueConverter
 */
public void setConverters(ConverterMatcher... converters) {
	this.converters = converters;
}
 
Example #6
Source Project: spring4-understanding   Author: langtianya   File: XStreamMarshaller.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Set the {@code Converters} or {@code SingleValueConverters} to be registered
 * with the {@code XStream} instance.
 * @see Converter
 * @see SingleValueConverter
 */
public void setConverters(ConverterMatcher... converters) {
	this.converters = converters;
}