private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Class<? extends ConverterMatcher> converterType = annotation.value(); final Converter converter = cacheConverter(converterType); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, XStream.PRIORITY_NORMAL); } else { throw new InitializationException("Converter " + converterType.getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Class<? extends ConverterMatcher> converterType = annotation.value(); final Converter converter = cacheConverter(converterType); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, XStream.PRIORITY_NORMAL); } else { throw new InitializationException("Converter " + converterType.getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type.getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type.getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter(annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }
private void processConverterAnnotations(final Class<?> type) { if (converterRegistry != null) { final XStreamConverters convertersAnnotation = type .getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type .getAnnotation(XStreamConverter.class); final List<XStreamConverter> annotations = convertersAnnotation != null ? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value())) : new ArrayList<XStreamConverter>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } for (final XStreamConverter annotation : annotations) { final Converter converter = cacheConverter( annotation, converterAnnotation != null ? type : null); if (converter != null) { if (converterAnnotation != null || converter.canConvert(type)) { converterRegistry.registerConverter(converter, annotation.priority()); } else { throw new InitializationException("Converter " + annotation.value().getName() + " cannot handle annotated class " + type.getName()); } } } } }