Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: io ::

interface XPersistObject
Description
allows to make UNO objects persistent

Every UNO object, that wants to be serializable, should implement this interface. The object stores stores itself, when the write method is called.

The object needs to be created before it deserializes itself again (by using the read method). Therefor it must be createable by name via a factory, which is in general the global service manager. The create and read mechanism is implemented by the ObjectInputStream.

The serialization format (the series of strings, integers, objects) must be specified at the specification of the concrete service.

The interface does not support any special versioning mechanism.

See also
XObjectOutputStream, XObjectInputStream

Methods' Summary
getServiceName gives the service name of the object  
write writes all the persistent data of the object to the stream.  
read reads all the persistent data of the object from the stream.  
Methods' Details
getServiceName
string
getServiceName();

Description
gives the service name of the object
Returns
the service name that specifies the behavior and the persistent data format of this implementation.

This name is used to create such an object by a factory during deserialization.

See also
::com::sun::star::lang::XServiceInfo::getAvailableServiceNames
write
void
write( [in] XObjectOutputStream  OutStream )
raises( IOException );

Description
writes all the persistent data of the object to the stream.

The implementation must write the data in the order documented in the service specification.

Parameter OutStream
the stream, the data shall be written to. The stream supports simple types and other XPersistObject implementations.
read
void
read( [in] XObjectInputStream  InStream )
raises( IOException );

Description
reads all the persistent data of the object from the stream.

In case other XPersistObjects are read from the stream, the implementation uses a factory to create these objects (in general the global service manager).

The implementation must read the data in the order documented at the service specification.

Parameter InStream
the stream, the data shall be read from.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.