Class BlockPropertyAnnotationGroup


  • public class BlockPropertyAnnotationGroup
    extends java.lang.Object
    A BlockProperty can hold any number of annotations organized by group names. This class represents a single group of annotations, organized by its name. Syntactically, a group name begins with a simple name (no spaces) followed by a colon (':') and any number of annotations, each separated by semicolon (';').
    Since:
    MicroStrategy Web 9.0.0
    See Also:
    BlockPropertyAnnotation
    • Method Detail

      • getGroupName

        public java.lang.String getGroupName()
        Returns the group name.
        Returns:
        The group name.
      • numAnnotations

        public int numAnnotations()
        Returns the number of annotations in this group.
        Returns:
        The number of annotations in this group.
      • getAnnotation

        public BlockPropertyAnnotation getAnnotation​(int index)
        Returns a single annotation by its numeric index.
        Parameters:
        index - The numeric index of the annotation to return.
        Returns:
        The BlockPropertyAnnotation at this index.
        Throws:
        java.lang.IllegalArgumentException - is thrown if there is no annotation at this index.
        See Also:
        numAnnotations()
      • hasAnnotation

        public boolean hasAnnotation​(java.lang.String name)
        Returns whether there is annotation in this group by the supplied name.
        Parameters:
        name - The name of the annotation to check.
        Returns:
        True if an annotation exists with this name.
      • getAnnotation

        public BlockPropertyAnnotation getAnnotation​(java.lang.String name,
                                                     boolean create)
        Returns the annotation with the supplied name.
        Parameters:
        name - The name of the annotation to return.
        create - If the annotation does not exist, whether to create a new one.
        Returns:
        The BlockPropertyAnnotation if it exists (or the caller opted to create a new one) or null if none exists.
      • addAnnotation

        public BlockPropertyAnnotation addAnnotation​(java.lang.String name)
        Adds a new annotation to this group.
        Parameters:
        name - The name of the new annotation.
        Returns:
        The BlockPropertyAnnotation that was created.
        Throws:
        java.lang.IllegalArgumentException - is thrown if an annotation already exists by this name.