ariba.util.io
Class Deserializer

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by ariba.util.io.Deserializer
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class Deserializer
extends java.io.FilterReader

FilterInputStream subclass that can deserialize Maps, Lists, arrays, and Strings from an ASCII stream. The serialization format is very similar to the output of Map's and List's toString() methods, except strings with non-alphanumeric characters are quoted and special characters are escaped so that the output can be unambiguously deserialized.

See Also:
Serializer

Constructor Summary
Deserializer(java.io.Reader reader)
          Constructs a Deserializer that takes its input from reader.
 
Method Summary
static java.lang.Object deserializeObject(java.lang.String serialization)
          Convenience method for deserializing from the string serialization.
 java.lang.Object readObject()
          Deserializes the next Dictionary, array, List, or String from the current reader.
 void readObject(java.lang.Object instance)
          Deserializes the next object from the current reader.
static java.lang.Object readObject(java.io.Reader reader)
          Convenience method for creating a Deserializer taking its input from reader.
 void setUseOrderedHashtable(boolean useOrderedHashtable)
           
 boolean useOrderedHashtable()
           
 
Methods inherited from class java.io.FilterReader
close, mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deserializer

public Deserializer(java.io.Reader reader)
Constructs a Deserializer that takes its input from reader.

Method Detail

readObject

public static java.lang.Object readObject(java.io.Reader reader)
Convenience method for creating a Deserializer taking its input from reader. This method only returns null on error instead of throwing an exception.


useOrderedHashtable

public boolean useOrderedHashtable()

setUseOrderedHashtable

public void setUseOrderedHashtable(boolean useOrderedHashtable)

deserializeObject

public static java.lang.Object deserializeObject(java.lang.String serialization)
Convenience method for deserializing from the string serialization. Returns null on error.


readObject

public java.lang.Object readObject()
                            throws java.io.IOException,
                                   DeserializationException
Deserializes the next Dictionary, array, List, or String from the current reader.

Throws:
java.io.IOException
DeserializationException

readObject

public void readObject(java.lang.Object instance)
                throws java.io.IOException,
                       DeserializationException
Deserializes the next object from the current reader. The result goes *into* the passed in object as opposed to creating a brand new instance. NOTE: Currently, this is only wired up for hashtables and lists. See readObjectInternal(Object instance) for the actual implementation.

Throws:
java.io.IOException
DeserializationException


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.