Package com.microstrategy.web.beans
Class AbstractTransformable
- java.lang.Object
-
- com.microstrategy.utils.serialization.AbstractPersistable
-
- com.microstrategy.web.beans.AbstractTransformable
-
- All Implemented Interfaces:
EnumWebPersistableState,Persistable,Transformable
- Direct Known Subclasses:
AbstractWebComponent
public abstract class AbstractTransformable extends AbstractPersistable implements Transformable
This is a base class for transformable objects. It provides default implementation of many methods defined in this interface.- Since:
- MicroStrategy Web 7.3.1 or earlier
- See Also:
Transformable
-
-
Field Summary
Fields Modifier and Type Field Description protected BeanContext_beanContext-
Fields inherited from class com.microstrategy.utils.serialization.AbstractPersistable
scriptEndTagEncoder
-
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 AbstractTransformable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransformInstanceaddTransform(Transform transform)Please also overridehasTransform(String)if overriding this method.protected TransformInstanceaddTransform(Transform transform, java.lang.String key)TransformInstanceaddTransformByClass(java.lang.String transformClass)Adds into the collection of transforms aTransformobject with the specified fully qualified class name.TransformInstanceaddTransformByStyle(java.lang.String style)Adds into the collection of transforms aTransformobject with the specified style name.TransformInstanceaddTransformByStyle(java.lang.String style, StyleRequestContext context)Adds into the collection of transforms aTransformobject with the specified style name.voidclearTransforms()Deletes all transforms added to the objectprotected TransformInstancecreateTransformInstance(Transform transform)protected TransformInstancecreateTransformInstance(Transform transform, TransformKeyMapper m)BeanContextgetBeanContext()Returns an instance ofBeanContext.protected TransformInstancegetDefaultTransform()Returns default transform associated with this objectjava.lang.StringgetMessageString(java.lang.String key)Returns the string descriptor from aMessagesinstance, which is in turn retrieved from theBeanContextif any.java.util.EnumerationgetMyTransformInstances()TransformInstancegetTransformInstance()Returns the defaultTransformInstanceobjectTransformInstancegetTransformInstance(java.lang.String key)Returns theTransformInstanceobject with the specified key.java.util.EnumerationgetTransformInstances()Retuns ajava.util.Enumerationover all theTransformInstanceobjects.booleanhasTransform()Returns a boolean value indicating whether there is a defaultTransformInstanceobject.booleanhasTransform(java.lang.String key)Returns a boolean value indicating whether there is such aTransformInstanceobject with the specified key.protected voidinternalCollectData()Overriding method should not only throwWebBeanException, but also sets error info if possible.protected voidinternalCollectData(boolean collectOnError)Overriding method should not only throwWebBeanException, but also sets error info if possible.protected voidinternalCollectData(boolean collectOnError, boolean collectOnProcessing)Overriding method should not only throwWebBeanException, but also sets error info if possible.voidinvalidateTransformCache()This method is called by any transformable object after collecting dataprotected booleanisTransformSuitable(Transform transform)This method is called in the addTransform methods.protected BeanContextnewDefaultBeanContext()This method is called by getBeanContext() to automatically create an instance of a BeanContext if one has not been explicitly set.protected StyleRequestContextnewStyleRequestContext()voidsetBeanContext(BeanContext beanContext)Sets an instance ofBeanContexton the current WebBean.MarkupOutputtransform()Performs transform on a component by the defaultTransformInstanceobject.protected MarkupOutputtransform(TransformInstance ti)protected voidtransform(Transform t, MarkupOutput mo)All public transform methods eventually delegate to this method.MarkupOutputtransform(java.lang.String key)Performs transform on a component by theTransformInstancewith the specified key.-
Methods inherited from class com.microstrategy.utils.serialization.AbstractPersistable
doFlatState, doFlatState, getStateHandler, isXMLStateZipped, restoreState, restoreState, restoreXMLState, saveState, saveState, saveState, saveState, saveXMLState, saveXMLState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
getType
-
-
-
-
Field Detail
-
_beanContext
protected BeanContext _beanContext
-
-
Method Detail
-
addTransform
public TransformInstance addTransform(Transform transform) throws java.lang.IllegalArgumentException
Please also overridehasTransform(String)if overriding this method.- Specified by:
addTransformin interfaceTransformable- Parameters:
transform- aTransformto add- Returns:
- a TransformInstance holding the transform added.
- Throws:
java.lang.IllegalArgumentException
-
createTransformInstance
protected TransformInstance createTransformInstance(Transform transform, TransformKeyMapper m)
- Since:
- MicroStrategy Web 9.0.1
-
createTransformInstance
protected TransformInstance createTransformInstance(Transform transform)
- Since:
- MicroStrategy Web 9.0.1
-
addTransform
protected TransformInstance addTransform(Transform transform, java.lang.String key) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException- Since:
- MicroStrategy Web 9.0.0
-
addTransformByClass
public TransformInstance addTransformByClass(java.lang.String transformClass) throws WebTransformException, java.lang.IllegalArgumentException
Description copied from interface:TransformableAdds into the collection of transforms aTransformobject with the specified fully qualified class name. The first transform added is automatically set to be the default transform. Any transform added has a key of value null.The collection of
TransformInstanceis a synchronized collection.- Specified by:
addTransformByClassin interfaceTransformable- Parameters:
transformClass- the fully qualified class name of theTransformobject to be added.- Returns:
- a TransformInstance holding the transform added.
- Throws:
WebTransformException- thrown if the specified transform can not be found or instantiated.java.lang.IllegalArgumentException
-
addTransformByStyle
public TransformInstance addTransformByStyle(java.lang.String style) throws WebTransformException, java.lang.IllegalArgumentException
Description copied from interface:TransformableAdds into the collection of transforms aTransformobject with the specified style name. The first transform added is automatically set to be the default transform. Any transform added has a key of value null.The collection of
TransformInstanceis a synchronized collection.- Specified by:
addTransformByStylein interfaceTransformable- Parameters:
style- the style name in a style catalog.- Returns:
- a TransformInstance holding the transform added.
- Throws:
WebTransformException- thrown if the specified transform can not be instantiated.java.lang.IllegalArgumentException
-
newStyleRequestContext
protected StyleRequestContext newStyleRequestContext()
- Since:
- MicroStrategy Web 9.0.0
-
addTransformByStyle
public TransformInstance addTransformByStyle(java.lang.String style, StyleRequestContext context) throws WebTransformException, java.lang.IllegalArgumentException
Description copied from interface:TransformableAdds into the collection of transforms aTransformobject with the specified style name. The first transform added is automatically set to be the default transform. Any transform added has a key of value null.The collection of
TransformInstanceis a synchronized collection.- Specified by:
addTransformByStylein interfaceTransformable- Parameters:
style- the style name in a style catalog.context- theStyleRequestContextobject.- Returns:
- a TransformInstance holding the transform added.
- Throws:
WebTransformException- thrown if the specified transform can not be instantiated.java.lang.IllegalArgumentException- Since:
- MicroStrategy Web 8.0.1
-
hasTransform
public boolean hasTransform()
Description copied from interface:TransformableReturns a boolean value indicating whether there is a defaultTransformInstanceobject.- Specified by:
hasTransformin interfaceTransformable- Returns:
- true if there is a default transform.
-
hasTransform
public boolean hasTransform(java.lang.String key)
Description copied from interface:TransformableReturns a boolean value indicating whether there is such aTransformInstanceobject with the specified key.- Specified by:
hasTransformin interfaceTransformable- Parameters:
key- the key of aTransform- Returns:
- true if there is such a
TransformInstancewith the specified key.
-
getTransformInstance
public TransformInstance getTransformInstance()
Description copied from interface:TransformableReturns the defaultTransformInstanceobject- Specified by:
getTransformInstancein interfaceTransformable- Returns:
- the default
TransformInstanceobject; null if there is no defaultTransformInstanceobject.
-
getTransformInstance
public TransformInstance getTransformInstance(java.lang.String key) throws KeyDoesNotExistException
Description copied from interface:TransformableReturns theTransformInstanceobject with the specified key.- Specified by:
getTransformInstancein interfaceTransformable- Parameters:
key- the key of aTransformInstance.- Returns:
- the
TransformInstanceobject with the specified key. - Throws:
KeyDoesNotExistException- thrown if the key is not found.
-
transform
public MarkupOutput transform() throws TransformDoesNotExistException
Description copied from interface:TransformablePerforms transform on a component by the defaultTransformInstanceobject. This method is synchronized on theTransformInstanceobject.- Specified by:
transformin interfaceTransformable- Returns:
- a
MarkupOutputobject containing the result of transform. - Throws:
TransformDoesNotExistException- thrown if there is no defaultTransformInstanceor the transform can not be performed.
-
transform
public MarkupOutput transform(java.lang.String key) throws KeyDoesNotExistException, TransformDoesNotExistException
Description copied from interface:TransformablePerforms transform on a component by theTransformInstancewith the specified key. This method is synchronized on theTransformInstanceobject.- Specified by:
transformin interfaceTransformable- Parameters:
key- the key of aTransformInstanceobject.- Returns:
- a
MarkupOutputobject containing the result of transform. - Throws:
KeyDoesNotExistException- thrown if the key is not found.TransformDoesNotExistException- thrown if there is no such aTransformInstanceor the transform can not be performed.
-
getTransformInstances
public java.util.Enumeration getTransformInstances()
Description copied from interface:TransformableRetuns ajava.util.Enumerationover all theTransformInstanceobjects.- Specified by:
getTransformInstancesin interfaceTransformable- Returns:
- a
java.util.Enumerationover all theTransformInstanceobjects.
-
getMyTransformInstances
public java.util.Enumeration getMyTransformInstances()
- Specified by:
getMyTransformInstancesin interfaceTransformable- Since:
- MicroStrategy Web 9.0.0
-
transform
protected MarkupOutput transform(TransformInstance ti) throws TransformDoesNotExistException
- Throws:
TransformDoesNotExistException
-
invalidateTransformCache
public void invalidateTransformCache()
This method is called by any transformable object after collecting data- Specified by:
invalidateTransformCachein interfaceTransformable
-
transform
protected void transform(Transform t, MarkupOutput mo) throws TransformDoesNotExistException, java.lang.IllegalArgumentException
All public transform methods eventually delegate to this method. This method calls transform an the passed transform object passing itself and mo as parameters.- Throws:
TransformDoesNotExistExceptionjava.lang.IllegalArgumentException
-
internalCollectData
protected void internalCollectData() throws WebBeanExceptionOverriding method should not only throwWebBeanException, but also sets error info if possible. This is equivalent tointernalCollectData(true).- Throws:
WebBeanException- thrown if there is severe errors when collecting data- See Also:
internalCollectData(boolean)
-
internalCollectData
protected void internalCollectData(boolean collectOnError) throws WebBeanExceptionOverriding method should not only throwWebBeanException, but also sets error info if possible.- Parameters:
collectOnError- will attempt to collect data even if object in in error.- Throws:
WebBeanException- thrown if there is severe errors when collecting data- Since:
- MicroStrategy Web 9.0.0
-
internalCollectData
protected void internalCollectData(boolean collectOnError, boolean collectOnProcessing) throws WebBeanExceptionOverriding method should not only throwWebBeanException, but also sets error info if possible.- Parameters:
collectOnError- will attempt to collect data even if object in in error.collectOnProcessing- will attempt to collect data even if object is in processing.- Throws:
WebBeanException- thrown if there is severe errors when collecting data- Since:
- MicroStrategy Web 9.4.0
-
getDefaultTransform
protected TransformInstance getDefaultTransform()
Returns default transform associated with this object
-
isTransformSuitable
protected boolean isTransformSuitable(Transform transform)
This method is called in the addTransform methods. It verifies that the passed transform is suitable for this object. Default implementation simply calls transform's supports method.
-
getBeanContext
public BeanContext getBeanContext()
Returns an instance ofBeanContext.- Specified by:
getBeanContextin interfaceTransformable- Returns:
- an instance of
BeanContext.
-
newDefaultBeanContext
protected BeanContext newDefaultBeanContext()
This method is called by getBeanContext() to automatically create an instance of a BeanContext if one has not been explicitly set.- Since:
- MicroStrategy Web 9.0.0
-
setBeanContext
public void setBeanContext(BeanContext beanContext)
Sets an instance ofBeanContexton the current WebBean.- Specified by:
setBeanContextin interfaceTransformable- Parameters:
beanContext- theBeanContextinstance to set.
-
getMessageString
public java.lang.String getMessageString(java.lang.String key)
Description copied from interface:TransformableReturns the string descriptor from aMessagesinstance, which is in turn retrieved from theBeanContextif any. The string descriptor is mapped by the specified key. A String of value "ERROR" is returned if there is no such a string descriptor.- Specified by:
getMessageStringin interfaceTransformable- Parameters:
key- the key mapped to a string descriptor in a Messages- Returns:
- the string descriptor from a
Messages.
-
clearTransforms
public void clearTransforms()
Deletes all transforms added to the object- Specified by:
clearTransformsin interfaceTransformable- Since:
- MicroStrategy Web 8.0.0
-
-