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 TransformInstance
addTransform(Transform transform)
Please also overridehasTransform(String)
if overriding this method.protected TransformInstance
addTransform(Transform transform, java.lang.String key)
TransformInstance
addTransformByClass(java.lang.String transformClass)
Adds into the collection of transforms aTransform
object with the specified fully qualified class name.TransformInstance
addTransformByStyle(java.lang.String style)
Adds into the collection of transforms aTransform
object with the specified style name.TransformInstance
addTransformByStyle(java.lang.String style, StyleRequestContext context)
Adds into the collection of transforms aTransform
object with the specified style name.void
clearTransforms()
Deletes all transforms added to the objectprotected TransformInstance
createTransformInstance(Transform transform)
protected TransformInstance
createTransformInstance(Transform transform, TransformKeyMapper m)
BeanContext
getBeanContext()
Returns an instance ofBeanContext
.protected TransformInstance
getDefaultTransform()
Returns default transform associated with this objectjava.lang.String
getMessageString(java.lang.String key)
Returns the string descriptor from aMessages
instance, which is in turn retrieved from theBeanContext
if any.java.util.Enumeration
getMyTransformInstances()
TransformInstance
getTransformInstance()
Returns the defaultTransformInstance
objectTransformInstance
getTransformInstance(java.lang.String key)
Returns theTransformInstance
object with the specified key.java.util.Enumeration
getTransformInstances()
Retuns ajava.util.Enumeration
over all theTransformInstance
objects.boolean
hasTransform()
Returns a boolean value indicating whether there is a defaultTransformInstance
object.boolean
hasTransform(java.lang.String key)
Returns a boolean value indicating whether there is such aTransformInstance
object with the specified key.protected void
internalCollectData()
Overriding method should not only throwWebBeanException
, but also sets error info if possible.protected void
internalCollectData(boolean collectOnError)
Overriding method should not only throwWebBeanException
, but also sets error info if possible.protected void
internalCollectData(boolean collectOnError, boolean collectOnProcessing)
Overriding method should not only throwWebBeanException
, but also sets error info if possible.void
invalidateTransformCache()
This method is called by any transformable object after collecting dataprotected boolean
isTransformSuitable(Transform transform)
This method is called in the addTransform methods.protected BeanContext
newDefaultBeanContext()
This method is called by getBeanContext() to automatically create an instance of a BeanContext if one has not been explicitly set.protected StyleRequestContext
newStyleRequestContext()
void
setBeanContext(BeanContext beanContext)
Sets an instance ofBeanContext
on the current WebBean.MarkupOutput
transform()
Performs transform on a component by the defaultTransformInstance
object.protected MarkupOutput
transform(TransformInstance ti)
protected void
transform(Transform t, MarkupOutput mo)
All public transform methods eventually delegate to this method.MarkupOutput
transform(java.lang.String key)
Performs transform on a component by theTransformInstance
with 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:
addTransform
in interfaceTransformable
- Parameters:
transform
- aTransform
to 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:Transformable
Adds into the collection of transforms aTransform
object 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
TransformInstance
is a synchronized collection.- Specified by:
addTransformByClass
in interfaceTransformable
- Parameters:
transformClass
- the fully qualified class name of theTransform
object 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:Transformable
Adds into the collection of transforms aTransform
object 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
TransformInstance
is a synchronized collection.- Specified by:
addTransformByStyle
in 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:Transformable
Adds into the collection of transforms aTransform
object 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
TransformInstance
is a synchronized collection.- Specified by:
addTransformByStyle
in interfaceTransformable
- Parameters:
style
- the style name in a style catalog.context
- theStyleRequestContext
object.- 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:Transformable
Returns a boolean value indicating whether there is a defaultTransformInstance
object.- Specified by:
hasTransform
in interfaceTransformable
- Returns:
- true if there is a default transform.
-
hasTransform
public boolean hasTransform(java.lang.String key)
Description copied from interface:Transformable
Returns a boolean value indicating whether there is such aTransformInstance
object with the specified key.- Specified by:
hasTransform
in interfaceTransformable
- Parameters:
key
- the key of aTransform
- Returns:
- true if there is such a
TransformInstance
with the specified key.
-
getTransformInstance
public TransformInstance getTransformInstance()
Description copied from interface:Transformable
Returns the defaultTransformInstance
object- Specified by:
getTransformInstance
in interfaceTransformable
- Returns:
- the default
TransformInstance
object; null if there is no defaultTransformInstance
object.
-
getTransformInstance
public TransformInstance getTransformInstance(java.lang.String key) throws KeyDoesNotExistException
Description copied from interface:Transformable
Returns theTransformInstance
object with the specified key.- Specified by:
getTransformInstance
in interfaceTransformable
- Parameters:
key
- the key of aTransformInstance
.- Returns:
- the
TransformInstance
object with the specified key. - Throws:
KeyDoesNotExistException
- thrown if the key is not found.
-
transform
public MarkupOutput transform() throws TransformDoesNotExistException
Description copied from interface:Transformable
Performs transform on a component by the defaultTransformInstance
object. This method is synchronized on theTransformInstance
object.- Specified by:
transform
in interfaceTransformable
- Returns:
- a
MarkupOutput
object containing the result of transform. - Throws:
TransformDoesNotExistException
- thrown if there is no defaultTransformInstance
or the transform can not be performed.
-
transform
public MarkupOutput transform(java.lang.String key) throws KeyDoesNotExistException, TransformDoesNotExistException
Description copied from interface:Transformable
Performs transform on a component by theTransformInstance
with the specified key. This method is synchronized on theTransformInstance
object.- Specified by:
transform
in interfaceTransformable
- Parameters:
key
- the key of aTransformInstance
object.- Returns:
- a
MarkupOutput
object containing the result of transform. - Throws:
KeyDoesNotExistException
- thrown if the key is not found.TransformDoesNotExistException
- thrown if there is no such aTransformInstance
or the transform can not be performed.
-
getTransformInstances
public java.util.Enumeration getTransformInstances()
Description copied from interface:Transformable
Retuns ajava.util.Enumeration
over all theTransformInstance
objects.- Specified by:
getTransformInstances
in interfaceTransformable
- Returns:
- a
java.util.Enumeration
over all theTransformInstance
objects.
-
getMyTransformInstances
public java.util.Enumeration getMyTransformInstances()
- Specified by:
getMyTransformInstances
in 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:
invalidateTransformCache
in 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:
TransformDoesNotExistException
java.lang.IllegalArgumentException
-
internalCollectData
protected void internalCollectData() throws WebBeanException
Overriding 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 WebBeanException
Overriding 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 WebBeanException
Overriding 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:
getBeanContext
in 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 ofBeanContext
on the current WebBean.- Specified by:
setBeanContext
in interfaceTransformable
- Parameters:
beanContext
- theBeanContext
instance to set.
-
getMessageString
public java.lang.String getMessageString(java.lang.String key)
Description copied from interface:Transformable
Returns the string descriptor from aMessages
instance, which is in turn retrieved from theBeanContext
if 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:
getMessageString
in 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:
clearTransforms
in interfaceTransformable
- Since:
- MicroStrategy Web 8.0.0
-
-