Class AbstractPersistable
- java.lang.Object
-
- com.microstrategy.utils.serialization.AbstractPersistable
-
- All Implemented Interfaces:
EnumWebPersistableState,Persistable
- Direct Known Subclasses:
AbstractTransformable,PageHistoryItem,PageHistoryList,WebBlobImpl,WebChangeJournalSearchImpl,WebDBMSImpl,WebDeliveryThresholdsMetricImpl,WebDerivedElementsEditorObject,WebDerivedElementsHelper,WebDossierPersonalViewShortcutImpl,WebEmailDeviceImpl,WebFileDeviceImpl,WebFTPDeviceImpl,WebIAMImpl,WebIServerSubscriptionDeliveryModeMobilePropertiesImpl,WebIServerSubscriptionDynamicRecipientListImpl,WebMobileDeviceImpl,WebPrinterDeviceImpl,WebReportDefinitionImpl,WebReusableThresholdsImpl,WebScriptRuntimeEnvImpl,WebSessionManagerImpl,WebSyncSearchFolder,WebTransmitterImpl,WebWalletImpl
public abstract class AbstractPersistable extends java.lang.Object implements Persistable
Base class that provides facilities to save and restore states.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected ScriptVariableJSONEncoderscriptEndTagEncoderreference to encoder that deals with tag encoding-
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 AbstractPersistable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFlatState(FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok)protected voiddoFlatState(FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok, int stateFlag)protected AbstractHandlergetStateHandler()protected booleanisXMLStateZipped()booleanrestoreState(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.booleanrestoreState(java.lang.String state)Restores a component based on its saved state.protected voidrestoreXMLState(java.lang.String state)java.lang.StringsaveState()Returns ajava.lang.Stringrepresentation of a component.java.lang.StringsaveState(int howMuchState)Returns ajava.lang.Stringrepresentation of a component.voidsaveState(java.lang.StringBuffer buf, int howMuchState)Saves and stores a component's state into aStringBuffer.voidsaveState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)Saves and stores a component's state into aStringBuffer.protected voidsaveXMLState(java.lang.StringBuffer buf, int howMuchState)protected voidsaveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)
-
-
-
Field Detail
-
scriptEndTagEncoder
protected ScriptVariableJSONEncoder scriptEndTagEncoder
reference to encoder that deals with tag encoding
-
-
Method Detail
-
isXMLStateZipped
protected boolean isXMLStateZipped()
- Since:
- MicroStrategy Web 8.1.1
-
saveState
public java.lang.String saveState()
Description copied from interface:PersistableReturns ajava.lang.Stringrepresentation of a component. The returned state should be HTML friendly. This method call is equivalent to callsaveState(EnumWebPersistableState.TYPICAL_STATE_INFO).- Specified by:
saveStatein interfacePersistable- Returns:
- the serialized state of a component.
-
saveState
public java.lang.String saveState(int howMuchState)
Description copied from interface:PersistableReturns ajava.lang.Stringrepresentation of a component. The returned state should be HTML friendly. This method call is equivalent to callsaveState(new StringBuffer(), howMuchState).- Specified by:
saveStatein interfacePersistable- Parameters:
howMuchState- how much state information to save (EnumWebPersistableState).- Returns:
- the serialized state of a component.
-
saveState
public void saveState(java.lang.StringBuffer buf, int howMuchState) throws java.lang.UnsupportedOperationExceptionDescription copied from interface:PersistableSaves 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:
saveStatein interfacePersistable- Parameters:
buf- a StringBuffer to store the saved state.howMuchState- how much state information to save (EnumWebPersistableState).- Throws:
java.lang.UnsupportedOperationException- thrown if the component does not support this method, or does not support certainhowMuchStatelevel.
-
saveState
public void saveState(java.lang.StringBuffer buf, int howMuchState, int stateFlag) throws java.lang.UnsupportedOperationExceptionDescription copied from interface:PersistableSaves 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:
saveStatein 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).- Throws:
java.lang.UnsupportedOperationException- thrown if the component does not support this method, or does not support certainhowMuchStatelevel.- Since:
- MicroStrategy Web 9.0.0
-
restoreState
public boolean restoreState(java.lang.String state)
Description copied from interface:PersistableRestores a component based on its saved state.- Specified by:
restoreStatein interfacePersistable- Parameters:
state- the state of a component- Returns:
- true if restoration succeeds.
-
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:PersistableRestores a component from an embedded XML during a SAX parsing.- Specified by:
restoreStatein 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:
trueto indicate a successful restoration. Otherwise,falsewill be returned.
-
doFlatState
protected void doFlatState(FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok)
-
doFlatState
protected void doFlatState(FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok, int stateFlag)
- Since:
- MicroStrategy Web 9.0.0
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState)
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)- Since:
- MicroStrategy Web 9.0.0
-
restoreXMLState
protected void restoreXMLState(java.lang.String state) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
getStateHandler
protected AbstractHandler getStateHandler() throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
-