public interface

Persistable

implements EnumWebPersistableState
com.microstrategy.utils.serialization.Persistable
Known Indirect Subclasses

Class Overview

This interface provides the mechanism to save the state of a component in a String representation, as well as to restore the component from its saved state.

The saved state should be HTML compatible, which means, it could appear in any form, such as HTML form data, query string, cookies, or session variable.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
Public Methods
abstract boolean restoreState(String state)
Restores a component based on its saved state.
abstract boolean restoreState(SAXSupport parser, String uri, String localName, String qName, Attributes attrs)
Restores a component from an embedded XML during a SAX parsing.
abstract String saveState()
Returns a java.lang.String representaion of a component.
abstract String saveState(int howMuchState)
Returns a java.lang.String representaion of a component.
abstract void saveState(StringBuffer buf, int howMuchState)
Saves and stores a component's state into a StringBuffer.
abstract void saveState(StringBuffer buf, int howMuchState, int stateFlag)
Saves and stores a component's state into a StringBuffer.

Public Methods

public abstract boolean restoreState (String state)

Restores a component based on its saved state.

Parameters
state the state of a component
Returns
  • true if restoration succeeds.

public abstract boolean restoreState (SAXSupport parser, String uri, String localName, String qName, Attributes attrs)

Restores a component from an embedded XML during a SAX parsing.

Parameters
parser a SAX parser processing the XML representation of a state
uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
localName The local name (without prefix), or the empty string if Namespace processing is not being performed
qName The qualified name (with prefix), or the empty string if qualified names are not available
attrs The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object
Returns
  • true to indicate a successful restoration. Otherwise, false will be returned.

public abstract String saveState ()

Returns a java.lang.String representaion of a component. The returned state should be HTML friendly. This method call is equivalent to call saveState(EnumWebPersistableState.TYPICAL_STATE_INFO).

Returns
  • the serialized state of a component.

public abstract String saveState (int howMuchState)

Returns a java.lang.String representaion of a component. The returned state should be HTML friendly. This method call is equivalent to call saveState(new StringBuffer(), howMuchState).

Parameters
howMuchState how much state information to save (EnumWebPersistableState).
Returns
  • the serialized state of a component.

public abstract void saveState (StringBuffer buf, int howMuchState)

Saves and stores a component's state into a StringBuffer. The returned state should be HTML friendly.

There are generally two formats of the saved state: flat state and XML representation. The minimum state is saved in flat state format, while the typical and maximum states are saved in XML string representation.

Parameters
buf a StringBuffer to store the saved state.
howMuchState how much state information to save (EnumWebPersistableState).
Throws
UnsupportedOperationException thrown if the component does not support this method, or does not support certain howMuchState level.

public abstract void saveState (StringBuffer buf, int howMuchState, int stateFlag)

Saves and stores a component's state into a StringBuffer. The returned state should be HTML friendly.

There are generally two formats of the saved state: flat state and XML representation. The minimum state is saved in flat state format, while the typical and maximum states are saved in XML string representation.

Parameters
buf a StringBuffer to store the saved state.
howMuchState how much state information to save (EnumWebPersistableState).
stateFlag bit-wise flag to indicate additional information about the state (EnumWebStateFlags).
Throws
UnsupportedOperationException thrown if the component does not support this method, or does not support certain howMuchState level.