Class BlockListElement

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Block, BlockList

    public abstract class BlockListElement
    extends BlockTarget
    This class represents a generic element of a List. This is used as a base class for a List or a Block.
    Since:
    MicroStrategy Web 8.1.0
    See Also:
    Serialized Form
    • Method Detail

      • getListElementKey

        public java.lang.String getListElementKey()
        Returns the key associated with this list element, if one exists.
        Returns:
        The key for this list element, or null if none exists.
        Since:
        MicroStrategy Web 9.0.0
      • setListElementKey

        public void setListElementKey​(java.lang.String key)
        Sets the key to be associated with this list element. This key is used to associate an identifier with a specific index in the containing BlockList. Note that changing the key has no effect after a list element has been added to a list.
        Parameters:
        key - The key used to identify this "slot" in the BlockList.
        Since:
        MicroStrategy Web 9.0.0
      • getListItem

        public java.lang.Object getListItem()
        Returns the "list item" specified for this Block. Only valid when the Block is in a "list context", a "list item" specifies the existing element that an "insert", "add" or "replace" operation is relative to. If a numeric index was specified, then this method returns an Integer. Otherwise, it returns the (String) key specified.
        Returns:
        Either an Integer or a String, if it was specified. Otherwise, it is null.
        Since:
        MicroStrategy Web 9.0.0
      • setListItem

        public void setListItem​(int listItem)
        Sets the "list item" to a numeric index.
        Parameters:
        listItem - The numeric index to use with an "add", "insert" or "replace" operation.
        Since:
        MicroStrategy Web 9.0.0
      • setListItem

        public void setListItem​(java.lang.String key)
        Sets the "list item" to either a numeric index or a key. It tries to parse the string as an integer. If valid, an Integer is created. Otherwise, the String is used as the key of the item.
        Parameters:
        key - Either a number or key, saved as a String.
        Since:
        MicroStrategy Web 9.0.0
      • getListAction

        public BlockListElement.ListAction getListAction()
        Returns the specified list action to perform when a Block List Element is added to a list.
        Returns:
        The specified list action (a value of the BlockListElement.ListAction enumeration).
        Since:
        MicroStrategy Web 9.0.0
      • setListAction

        public void setListAction​(BlockListElement.ListAction listAction)
        Sets the specified list action to perform when a Block List Element is added to a list.
        Parameters:
        listAction - A value from the BlockListElement.ListAction enumeration.
        Since:
        MicroStrategy Web 9.0.0