Package com.microstrategy.web.blocks
Class BlockProperty
- java.lang.Object
-
- com.microstrategy.web.blocks.BlockTarget
-
- com.microstrategy.web.blocks.BlockProperty
-
- All Implemented Interfaces:
java.io.Serializable
public class BlockProperty extends BlockTarget
This class represents a single Block property.- Since:
- MicroStrategy Web 8.1.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.web.blocks.BlockTarget
BlockTarget.PathInfo
-
-
Field Summary
-
Fields inherited from class com.microstrategy.web.blocks.BlockTarget
TARGETTYPE_BLOCK, TARGETTYPE_LIST, TARGETTYPE_PROPERTY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(BlockVisitor visitor)
Accept a BlockVisitor to this BlockProperty.BlockPropertyAnnotationGroups
getAnnotationGroups(boolean create)
Returns the annotation groups associated with this Block Property.java.lang.Object
getExpandedValue(BlockContext bContext)
Gets the "expanded" value of the Block Property.java.lang.String
getName()
Returns the name of this property.java.lang.String
getType()
Returns the type of this property.java.lang.Object
getValue()
Returns the value of this property.boolean
hasAnnotationGroups()
Returns whether there are any annotation groups associated with this Block Property.boolean
hasMacros()
Returns whether the Block Property contains a macro or not.boolean
isScalarType()
Returns whether the property holds a scalar value (is of a scalar type) as opposed a reference type.void
modifyTypeValue(java.lang.String newTypeName, java.lang.Object newValue)
Modify both the type and value of a Block Property.void
setValue(java.lang.Object suppliedValue)
Sets the value of this property.-
Methods inherited from class com.microstrategy.web.blocks.BlockTarget
findProperties, getTargetType, resolvePath, resolvePath
-
-
-
-
Method Detail
-
hasMacros
public boolean hasMacros()
Returns whether the Block Property contains a macro or not.- Returns:
- Whether the Block Property value contains a macro.
- Since:
- MicroStrategy Web 9.0.0
-
getName
public java.lang.String getName()
Returns the name of this property.- Returns:
- The name of this property.
-
getType
public java.lang.String getType()
Returns the type of this property.- Returns:
- The type of this property.
-
getValue
public java.lang.Object getValue()
Returns the value of this property.- Returns:
- The value of this property.
-
setValue
public void setValue(java.lang.Object suppliedValue)
Sets the value of this property. In the process, it may "normalize" the value supplied. For example, if a String value is supplied to a Boolean property, it will try to normalize it to be a Boolean value.- Parameters:
suppliedValue
- The supplied value of this property.
-
modifyTypeValue
public void modifyTypeValue(java.lang.String newTypeName, java.lang.Object newValue)
Modify both the type and value of a Block Property.- Parameters:
newTypeName
- The new type of the Block Property.newValue
- The new value of the Block Property.
-
isScalarType
public boolean isScalarType()
Returns whether the property holds a scalar value (is of a scalar type) as opposed a reference type.- Returns:
- True, if the type is scalar; otherwise, False.
-
getExpandedValue
public java.lang.Object getExpandedValue(BlockContext bContext)
Gets the "expanded" value of the Block Property. If a Block Property is assigned a string with macros embedded in it, then this method expands those macro values and normalizes the result. If there are no macro, this method returns the same as thegetValue()
method.- Parameters:
bContext
- TheBlockContext
object which supports the expansion of macros references.- Returns:
- The "normalized" value of the property, after macro expansion.
- Since:
- MicroStrategy Web 9.0.0
-
hasAnnotationGroups
public boolean hasAnnotationGroups()
Returns whether there are any annotation groups associated with this Block Property.- Returns:
- Whether there are any annotation groups associated with this Block Property.
- Since:
- MicroStrategy Web 9.0.0
-
getAnnotationGroups
public BlockPropertyAnnotationGroups getAnnotationGroups(boolean create)
Returns the annotation groups associated with this Block Property.- Parameters:
create
- If no annotation groups exists, this indicates whether a new set should be created.- Returns:
- A
BlockPropertyAnnotationGroups
object (if it exists or the caller set 'create' to true); otherwise it is null. - Since:
- MicroStrategy Web 9.0.0
-
accept
public void accept(BlockVisitor visitor)
Accept a BlockVisitor to this BlockProperty. Depending on the type and value of this property, a certain method on the visitor is invoked:- If the value is null, then
BlockVisitor.visitUnassignedProperty(BlockProperty, Block)
is invoked. - If the type is scalar, then
BlockVisitor.visitScalarProperty(BlockProperty, Block, boolean)
is invoked. - If the type is composite, then
BlockVisitor.visitCompositeProperty(BlockProperty, Block, boolean)
is invoked.
- Parameters:
visitor
- TheBlockVisitor
to accept.- Since:
- MicroStrategy Web 9.0.0
- If the value is null, then
-
-