Spring Framework DefaultDeserializer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultDeserializer class.

This code example shows how to use the following methods:
 
	/** 
	 * Create a default DeserializingConverter that uses standard Java deserialization. 
	 */ 
	public DeserializingConverter() { 
		this.deserializer = new DefaultDeserializer();
	} 
 
	/** 
	 * Create a DeserializingConverter that delegates to the provided {@link Deserializer}. 
	 */ 
	public DeserializingConverter(Deserializer<Object> deserializer) {
		Assert.notNull(deserializer, "Deserializer must not be null");
		this.deserializer = deserializer;
	} 
 
 
	@Override 
	public Object convert(byte[] source) {
		ByteArrayInputStream byteStream = new ByteArrayInputStream(source);
6
CodeRank
This code example shows how to use the following methods:
 */ 
@SuppressWarnings("rawtypes") 
public class DefaultExecutionContextSerializer implements ExecutionContextSerializer { 
 
	private Serializer serializer = new DefaultSerializer();
	private Deserializer deserializer = new DefaultDeserializer();
 
	/** 
	 * Serializes an execution context to the provided {@link OutputStream}.  The 
	 * stream is not closed prior to it's return. 
	 * 
	 * @param context 
	 * @param out 
	 */ 
	@Override 
	@SuppressWarnings("unchecked") 
	public void serialize(Map<String, Object> context, OutputStream out) throws IOException {
		Assert.notNull(context);
		Assert.notNull(out);
 
5
CodeRank
This code example shows how to use the following methods:
 
	public static class EnhancedSerializer implements Serializer<Object>, Deserializer<Object> {
 
		private final Serializer<Object> targetSerializer = new DefaultSerializer();
 
		private final Deserializer<Object> targetDeserializer = new DefaultDeserializer();
 
		public Object deserialize(InputStream inputStream) throws IOException {
			Message<?> message = (Message<?>) targetDeserializer.deserialize(inputStream);
			return message; 
		} 
 
		public void serialize(Object object, OutputStream outputStream) throws IOException {
			Message<?> message = (Message<?>) object;
			message = MessageBuilder.fromMessage(message).setHeader("serializer", "CUSTOM").build(); 
			targetSerializer.serialize(message, outputStream);
		} 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
 
	private volatile String defaultCharset = DEFAULT_CHARSET;
 
	private volatile Serializer<Object> serializer = new DefaultSerializer();
 
	private volatile Deserializer<Object> deserializer = new DefaultDeserializer();
 
	private volatile boolean ignoreContentType = false;
 
	/** 
	 * Flag to signal that the content type should be ignored and the deserializer used irrespective if it is a text 
	 * message. Defaults to false, in which case the default encoding is used to convert a text message to a String. 
	 * 
	 * @param ignoreContentType the flag value to set 
	 */ 
	public void setIgnoreContentType(boolean ignoreContentType) {
		this.ignoreContentType = ignoreContentType;
	} 
 
	/** 
5
CodeRank
This code example shows how to use the following methods:
    private final String host;
    private final int port;
    private final boolean server;
    private final String connId = UUID.randomUUID().toString();
    private boolean running, open = true, single;
    private Deserializer<?> deser = new DefaultDeserializer();
    private Serializer<?> ser = new DefaultSerializer();
 
    /** 
     * 
     */ 
    public TcpTestConnectionFactory(String hostname, int portValue, boolean asServer) {
        host = hostname;
        port = portValue;
        server = asServer;
    } 
 
    public boolean isAutoStartup() { 
        return false; 
    } 
4
CodeRank
This code example shows how to use the following methods:
		scf.stop();
	} 
 
	private void interceptorsGuts(final int port, AbstractServerConnectionFactory scf) throws Exception {
		scf.setSerializer(new DefaultSerializer());
		scf.setDeserializer(new DefaultDeserializer());
		scf.setSingleUse(false);
		TcpReceivingChannelAdapter adapter = new TcpReceivingChannelAdapter();
		adapter.setConnectionFactory(scf);
		TcpConnectionInterceptorFactoryChain fc = new TcpConnectionInterceptorFactoryChain();
		fc.setInterceptors(new TcpConnectionInterceptorFactory[] {
				newInterceptorFactory(), 
				newInterceptorFactory() 
		}); 
		scf.setInterceptorFactoryChain(fc);
		scf.setSoTimeout(10000);
		scf.start();
		TestingUtilities.waitListening(scf, null);
		QueueChannel channel = new QueueChannel();
		adapter.setOutputChannel(channel);
4
CodeRank