org.openide.util.io
Class NbMarshalledObject

java.lang.Object
  |
  +--org.openide.util.io.NbMarshalledObject
All Implemented Interfaces:
Serializable

public final class NbMarshalledObject
extends Object
implements Serializable

Object that holds serialized reference to another object. Inspirated by java.rmi.MarshalledObject but modified to work with NetBeans and its modules. So no annotations are stored with the bytestream and when the object is deserialized it is assumed to be produced by the core IDE or one of installed modules or it is located in the repository.

See Also:
Serialized Form

Constructor Summary
NbMarshalledObject(Object obj)
          Creates a new NbMarshalledObject that contains the serialized representation of the provided object.
 
Method Summary
 boolean equals(Object obj)
          Two objects are equal if the hold the same serialized representation.
 Object get()
          Returns a new copy of the contained marshalledobject.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NbMarshalledObject

public NbMarshalledObject(Object obj)
                   throws IOException
Creates a new NbMarshalledObject that contains the serialized representation of the provided object.
Parameters:
obj - the object to be serialized (must be serializable)
Throws:
IOException - the object is not serializable
Method Detail

get

public Object get()
           throws IOException,
                  ClassNotFoundException
Returns a new copy of the contained marshalledobject. The object is deserialized by NbObjectInputStream, so it is assumed that it can be located by core IDE, a module or in the repository.
Returns:
a copy of the contained object
Throws:
IOException - on any I/O problem
ClassNotFoundException - if the class of the object cannot be found

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
a hash code

equals

public boolean equals(Object obj)
Two objects are equal if the hold the same serialized representation.
Overrides:
equals in class Object
Parameters:
obj - the object to compare with this MarshalledObject
Returns:
true if the objects are serialized into the same bytestreams


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.