Class PersistableAdapter
- java.lang.Object
-
- com.microstrategy.utils.serialization.PersistableAdapter
-
- All Implemented Interfaces:
EnumWebPersistableState
,Persistable
- Direct Known Subclasses:
ProjectInfoPersister
public class PersistableAdapter extends java.lang.Object implements Persistable
ThePersistable
interface should be implemented by any class whose instances are intended to be saved into a java.lang.String representation. 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.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Constructor Summary
Constructors Constructor Description PersistableAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
restoreState(SAXSupport parser, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
Restores a component from an embedded XML during a SAX parsing.boolean
restoreState(java.lang.String state)
Restores a component based on its saved state.java.lang.String
saveState()
Returns ajava.lang.String
representation of a component.java.lang.String
saveState(int howMuchState)
Returns ajava.lang.String
representation of a component.void
saveState(java.lang.StringBuffer buf, int howMuchState)
Saves and stores a component's state into aStringBuffer
.void
saveState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)
Saves and stores a component's state into aStringBuffer
.
-
-
-
Method Detail
-
saveState
public java.lang.String saveState(int howMuchState)
Description copied from interface:Persistable
Returns ajava.lang.String
representation of a component. The returned state should be HTML friendly. This method call is equivalent to callsaveState(new StringBuffer(), howMuchState)
.- Specified by:
saveState
in interfacePersistable
- Parameters:
howMuchState
- how much state information to save (EnumWebPersistableState
).- Returns:
- the serialized state of a component.
-
saveState
public java.lang.String saveState()
Description copied from interface:Persistable
Returns ajava.lang.String
representation of a component. The returned state should be HTML friendly. This method call is equivalent to callsaveState(EnumWebPersistableState.TYPICAL_STATE_INFO)
.- Specified by:
saveState
in interfacePersistable
- Returns:
- the serialized state of a component.
-
restoreState
public boolean restoreState(java.lang.String state)
Description copied from interface:Persistable
Restores a component based on its saved state.- Specified by:
restoreState
in interfacePersistable
- Parameters:
state
- the state of a component- Returns:
- true if restoration succeeds.
-
saveState
public void saveState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)
Description copied from interface:Persistable
Saves and stores a component's state into aStringBuffer
. 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.
- Specified by:
saveState
in interfacePersistable
- 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
).- Since:
- MicroStrategy Web 9.0.0
-
saveState
public void saveState(java.lang.StringBuffer buf, int howMuchState)
Description copied from interface:Persistable
Saves and stores a component's state into aStringBuffer
. 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.
- Specified by:
saveState
in interfacePersistable
- Parameters:
buf
- a StringBuffer to store the saved state.howMuchState
- how much state information to save (EnumWebPersistableState
).
-
restoreState
public boolean restoreState(SAXSupport parser, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
Description copied from interface:Persistable
Restores a component from an embedded XML during a SAX parsing.- Specified by:
restoreState
in interfacePersistable
- Parameters:
parser
- a SAX parser processing the XML representation of a stateuri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedlocalName
- The local name (without prefix), or the empty string if Namespace processing is not being performedqName
- The qualified name (with prefix), or the empty string if qualified names are not availableattrs
- 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.
-
-