Package com.microstrategy.web.beans
Class ComponentBlock
- java.lang.Object
-
- com.microstrategy.web.beans.ComponentBlock
-
public class ComponentBlock extends java.lang.Object
This class represents a component block generated for partial update request. A ComponentBlock consists of a set of name/value pairs, HTML content (if the component needs to update itself) and a list of child ComponentBlocks (if the component has sub components to update) ComponentBlock renders itself into JSON stream. If child ComponentsBlocks are present it will just render the children array as the value of the COMPONENTS property; if it's child-less it will render the HTML content as the value of the CONTENT property.
-
-
Constructor Summary
Constructors Constructor Description ComponentBlock(java.lang.String id, MarkupOutput out)
Creates a new ComponentBlock object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildBlock(ComponentBlock bl)
Add a childComponentBlock
to the children listvoid
addErrorInfo(java.lang.String error)
Append more error information to the ComponentBlock instance.java.util.List<ComponentBlock>
getChildBlocks()
Returns the list of child ComponentBlocks.MarkupOutput
getContent()
Returns theMarkupOutput
instance that holds the HTML contentboolean
hasChildBlocks()
Return a flag indicating whether this instance has childrenComponentBlock
(s) or notvoid
serializeInto(MarkupOutput out, BlockContext bContext)
This method is called when a ComponentBlock needs to serialize itself.void
setErrorInfo(java.lang.StringBuffer error)
Set error information on the ComponentBlock instance.BlockProperty
setOrCreateProperty(java.lang.String propName, java.lang.String propType, java.lang.Object propValue)
Sets a property (creating it, if necessary) to a specific value.
-
-
-
Constructor Detail
-
ComponentBlock
public ComponentBlock(java.lang.String id, MarkupOutput out)
Creates a new ComponentBlock object.
-
-
Method Detail
-
setOrCreateProperty
public BlockProperty setOrCreateProperty(java.lang.String propName, java.lang.String propType, java.lang.Object propValue)
Sets a property (creating it, if necessary) to a specific value.- Parameters:
propName
- The name of the property to set.propType
- The type of the property.propValue
- The value of the property.- Returns:
- The
BlockProperty
object that was set (or created).
-
getChildBlocks
public java.util.List<ComponentBlock> getChildBlocks()
Returns the list of child ComponentBlocks.- Returns:
- The List containing child
ComponentBlock
.
-
getContent
public MarkupOutput getContent()
Returns theMarkupOutput
instance that holds the HTML content- Returns:
- The
MarkupOutput
with HTML content
-
addChildBlock
public void addChildBlock(ComponentBlock bl)
Add a childComponentBlock
to the children list- Parameters:
bl
- childComponentBlock
-
hasChildBlocks
public boolean hasChildBlocks()
Return a flag indicating whether this instance has childrenComponentBlock
(s) or not- Returns:
- boolean true if has children false if child-less
-
serializeInto
public void serializeInto(MarkupOutput out, BlockContext bContext)
This method is called when a ComponentBlock needs to serialize itself. If child ComponentsBlocks are present it will render the children array as the value of the COMPONENTS property; if it's child-less it will render the HTML content as the value of the CONTENT property.- Parameters:
out
- theMarkupOutput
instance that will hold the serialization resultbContext
- theBlockContext
object that will be used for theBlock
instance to render itself
-
setErrorInfo
public void setErrorInfo(java.lang.StringBuffer error)
Set error information on the ComponentBlock instance.- Parameters:
error
- the StringBuffer with error information that needs to be set
-
addErrorInfo
public void addErrorInfo(java.lang.String error)
Append more error information to the ComponentBlock instance.- Parameters:
error
- the error information that needs to be added
-
-