Package com.microstrategy.web.beans
Class ComponentBlock
- java.lang.Object
-
- com.microstrategy.web.beans.ComponentBlock
-
public class ComponentBlock extends java.lang.ObjectThis 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 voidaddChildBlock(ComponentBlock bl)Add a childComponentBlockto the children listvoidaddErrorInfo(java.lang.String error)Append more error information to the ComponentBlock instance.java.util.List<ComponentBlock>getChildBlocks()Returns the list of child ComponentBlocks.MarkupOutputgetContent()Returns theMarkupOutputinstance that holds the HTML contentbooleanhasChildBlocks()Return a flag indicating whether this instance has childrenComponentBlock(s) or notvoidserializeInto(MarkupOutput out, BlockContext bContext)This method is called when a ComponentBlock needs to serialize itself.voidsetErrorInfo(java.lang.StringBuffer error)Set error information on the ComponentBlock instance.BlockPropertysetOrCreateProperty(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
BlockPropertyobject 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 theMarkupOutputinstance that holds the HTML content- Returns:
- The
MarkupOutputwith HTML content
-
addChildBlock
public void addChildBlock(ComponentBlock bl)
Add a childComponentBlockto 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- theMarkupOutputinstance that will hold the serialization resultbContext- theBlockContextobject that will be used for theBlockinstance 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
-
-