@Override protected void registerConverters(ChainingConverter converter) { converter.registerConverter(Dom4JToByteArrayConverter.class); converter.registerConverter(InputStreamToDom4jConverter.class); converter.registerConverter(XomToStringConverter.class); converter.registerConverter(InputStreamToXomConverter.class); }
/** * Registers converters with the given {@code converter} which depend on the actual contents of the * serialized for to represent a JSON format. * * @param converter The ChainingConverter instance to register the converters with. */ protected void registerConverters(ChainingConverter converter) { converter.registerConverter(new JsonNodeToByteArrayConverter(objectMapper)); converter.registerConverter(new ByteArrayToJsonNodeConverter(objectMapper)); }
/** * Registers a convert of the given {@code converterType} with this factory, only if initialization of such a * converter is possible. Both the expected source type and target type classes are checked for availability on the * class path. In contrast to {@link #registerConverter(ContentTypeConverter)}, this method allows potentially * unsafe (in terms of class dependencies) converters to be registered. * <p/> * The converter which is registered <em>last</em> will be inspected <em>first</em> when finding a suitable * converter for a given input and output type. * <p/> * An alternative to explicit converter registration (but without the ordering guarantees) is to create a file * called {@code org.axonframework.serialization.ContentTypeConverter} in {@code /META-INF/services/} on the * class path which contains the fully qualified class names of the converters, separated by newlines. These * implementations must have a public no-arg constructor. * * @param converterType the type of converter to register. */ public void registerConverter(Class<? extends ContentTypeConverter> converterType) { try { ContentTypeConverter converter = converterType.getConstructor().newInstance(); converter.targetType(); converter.expectedSourceType(); registerConverter(converter); } catch (Exception e) { logger.warn("An exception occurred while trying to initialize a [{}].", converterType.getName(), e); } catch (NoClassDefFoundError e) { logger.info("ContentTypeConverter of type [{}] is ignored. It seems to rely on a class that is " + "not available in the class loader: {}", converterType, e.getMessage()); } }
@Override protected void registerConverters(ChainingConverter converter) { converter.registerConverter(Dom4JToByteArrayConverter.class); converter.registerConverter(InputStreamToDom4jConverter.class); converter.registerConverter(XomToStringConverter.class); converter.registerConverter(InputStreamToXomConverter.class); } }
@Override protected void registerConverters(ChainingConverter converter) { converter.registerConverter(Dom4JToByteArrayConverter.class); converter.registerConverter(InputStreamToDom4jConverter.class); converter.registerConverter(XomToStringConverter.class); converter.registerConverter(InputStreamToXomConverter.class); }
/** * Registers converters with the given {@code converter} which depend on the actual contents of the * serialized for to represent a JSON format. * * @param converter The ChainingConverter instance to register the converters with. */ protected void registerConverters(ChainingConverter converter) { converter.registerConverter(new JsonNodeToByteArrayConverter(objectMapper)); converter.registerConverter(new ByteArrayToJsonNodeConverter(objectMapper)); }
@Override protected void registerConverters(ChainingConverter converter) { converter.registerConverter(new DBObjectToStringContentTypeConverter()); converter.registerConverter(new DocumentToStringContentTypeConverter()); converter.registerConverter(new StringToDBObjectContentTypeConverter()); }
/** * Registers converters with the given {@code converter} which depend on the actual contents of the * serialized for to represent a JSON format. * * @param converter The ChainingConverter instance to register the converters with. */ protected void registerConverters(ChainingConverter converter) { converter.registerConverter(new JsonNodeToByteArrayConverter(objectMapper)); converter.registerConverter(new ByteArrayToJsonNodeConverter(objectMapper)); }
@Override protected void registerConverters(ChainingConverter converter) { converter.registerConverter(new DBObjectToStringContentTypeConverter()); converter.registerConverter(new DocumentToStringContentTypeConverter()); converter.registerConverter(new StringToDBObjectContentTypeConverter()); }
/** * Registers a convert of the given {@code converterType} with this factory, only if initialization of such a * converter is possible. Both the expected source type and target type classes are checked for availability on the * class path. In contrast to {@link #registerConverter(ContentTypeConverter)}, this method allows potentially * unsafe (in terms of class dependencies) converters to be registered. * <p/> * The converter which is registered <em>last</em> will be inspected <em>first</em> when finding a suitable * converter for a given input and output type. * <p/> * An alternative to explicit converter registration (but without the ordering guarantees) is to create a file * called {@code org.axonframework.serialization.ContentTypeConverter} in {@code /META-INF/services/} on the * class path which contains the fully qualified class names of the converters, separated by newlines. These * implementations must have a public no-arg constructor. * * @param converterType the type of converter to register. */ public void registerConverter(Class<? extends ContentTypeConverter> converterType) { try { ContentTypeConverter converter = converterType.getConstructor().newInstance(); converter.targetType(); converter.expectedSourceType(); registerConverter(converter); } catch (Exception e) { logger.warn("An exception occurred while trying to initialize a [{}].", converterType.getName(), e); } catch (NoClassDefFoundError e) { logger.info("ContentTypeConverter of type [{}] is ignored. It seems to rely on a class that is " + "not available in the class loader: {}", converterType, e.getMessage()); } }
/** * Registers a convert of the given {@code converterType} with this factory, only if initialization of such a * converter is possible. Both the expected source type and target type classes are checked for availability on the * class path. In contrast to {@link #registerConverter(ContentTypeConverter)}, this method allows potentially * unsafe (in terms of class dependencies) converters to be registered. * <p/> * The converter which is registered <em>last</em> will be inspected <em>first</em> when finding a suitable * converter for a given input and output type. * <p/> * An alternative to explicit converter registration (but without the ordering guarantees) is to create a file * called {@code org.axonframework.serialization.ContentTypeConverter} in {@code /META-INF/services/} on the * class path which contains the fully qualified class names of the converters, separated by newlines. These * implementations must have a public no-arg constructor. * * @param converterType the type of converter to register. */ public void registerConverter(Class<? extends ContentTypeConverter> converterType) { try { ContentTypeConverter converter = converterType.getConstructor().newInstance(); converter.targetType(); converter.expectedSourceType(); registerConverter(converter); } catch (Exception e) { logger.warn("An exception occurred while trying to initialize a [{}].", converterType.getName(), e); } catch (NoClassDefFoundError e) { logger.info("ContentTypeConverter of type [{}] is ignored. It seems to rely on a class that is " + "not available in the class loader: {}", converterType, e.getMessage()); } }