com.devexperts.evolution.utils.configencoder
Class ConfigDecoder

java.lang.Object
  extended by com.devexperts.evolution.utils.configencoder.ConfigDecoder

public class ConfigDecoder
extends java.lang.Object

The ConfigDecoder class is used to read textual documents created using the ConfigEncoder and is used just like the XMLDecoder.

Author:
Anton V. Shakhmin
See Also:
XMLDecoder, ConfigEncoder

Constructor Summary
ConfigDecoder(java.io.InputStream in)
          Creates a new input stream for reading archives created by the ConfigEncoder class.
ConfigDecoder(java.io.InputStream in, java.lang.Object owner)
          Creates a new input stream for reading archives created by the ConfigEncoder class.
ConfigDecoder(java.io.InputStream in, java.lang.Object owner, java.beans.ExceptionListener exceptionListener)
          Creates a new input stream for reading archives created by the ConfigEncoder class.
ConfigDecoder(java.io.InputStream in, java.lang.Object owner, java.beans.ExceptionListener exceptionListener, java.lang.ClassLoader cl)
          Creates a new input stream for reading archives created by the ConfigEncoder class.
 
Method Summary
 void close()
          This method closes the input stream associated with this stream.
 ClassResolver getClassResolver()
           
 java.beans.ExceptionListener getExceptionListener()
          Gets the exception handler for this stream.
 NameConverter getNameConverter()
           
 java.lang.Object getOwner()
          Gets the owner of this decoder.
 ValueResolver getValueResolver()
           
 java.lang.Object readObject()
          Reads the next object from the underlying input stream.
 void setClassResolver(ClassResolver classResolver)
           
 void setExceptionListener(java.beans.ExceptionListener exceptionListener)
          Sets the exception handler for this stream to exceptionListener.
 void setNameConverter(NameConverter nameConverter)
           
 void setOwner(java.lang.Object owner)
          Sets the owner of this decoder to owner.
 void setValueResolver(ValueResolver valueResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigDecoder

public ConfigDecoder(java.io.InputStream in)
Creates a new input stream for reading archives created by the ConfigEncoder class.

Parameters:
in - The underlying stream.
See Also:
ConfigEncoder.ConfigEncoder(java.io.OutputStream)

ConfigDecoder

public ConfigDecoder(java.io.InputStream in,
                     java.lang.Object owner)
Creates a new input stream for reading archives created by the ConfigEncoder class.

Parameters:
in - The underlying stream.
owner - The owner of this stream.

ConfigDecoder

public ConfigDecoder(java.io.InputStream in,
                     java.lang.Object owner,
                     java.beans.ExceptionListener exceptionListener)
Creates a new input stream for reading archives created by the ConfigEncoder class.

Parameters:
in - the underlying stream.
owner - the owner of this stream.
exceptionListener - the exception handler for the stream; if null the default exception listener will be used.

ConfigDecoder

public ConfigDecoder(java.io.InputStream in,
                     java.lang.Object owner,
                     java.beans.ExceptionListener exceptionListener,
                     java.lang.ClassLoader cl)
Creates a new input stream for reading archives created by the ConfigEncoder class.

Parameters:
in - the underlying stream. null may be passed without error, though the resulting ConfigDecoder will be useless
owner - the owner of this stream. null is a legal value
exceptionListener - the exception handler for the stream, or null to use the default
cl - the class loader used for instantiating objects. null indicates that the default class loader should be used
Since:
1.5
Method Detail

close

public void close()
This method closes the input stream associated with this stream.


setExceptionListener

public void setExceptionListener(java.beans.ExceptionListener exceptionListener)
Sets the exception handler for this stream to exceptionListener. The exception handler is notified when this stream catches recoverable exceptions.

Parameters:
exceptionListener - The exception handler for this stream; if null the default exception listener will be used.
See Also:
getExceptionListener()

getExceptionListener

public java.beans.ExceptionListener getExceptionListener()
Gets the exception handler for this stream.

Returns:
The exception handler for this stream. Will return the default exception listener if this has not explicitly been set.
See Also:
setExceptionListener(java.beans.ExceptionListener)

readObject

public java.lang.Object readObject()
Reads the next object from the underlying input stream.

Returns:
the next object read
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the stream contains no objects (or no more objects)
See Also:
ConfigEncoder.writeObject(java.lang.Object)

setOwner

public void setOwner(java.lang.Object owner)
Sets the owner of this decoder to owner.

Parameters:
owner - The owner of this decoder.
See Also:
getOwner()

getOwner

public java.lang.Object getOwner()
Gets the owner of this decoder.

Returns:
The owner of this decoder.
See Also:
setOwner(java.lang.Object)

getNameConverter

public NameConverter getNameConverter()

setNameConverter

public void setNameConverter(NameConverter nameConverter)

getValueResolver

public ValueResolver getValueResolver()

setValueResolver

public void setValueResolver(ValueResolver valueResolver)

getClassResolver

public ClassResolver getClassResolver()

setClassResolver

public void setClassResolver(ClassResolver classResolver)


Copyright © 2012 Devexperts, LLC. All Rights Reserved.