Class ContentBlock

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ContentBlock
    extends ContentSelection
    Represents a block of content. The tree of content blocks provides the hierarchical structure of a content part into semantic units.
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class ContentSelection
        Throws:
        java.lang.Throwable
      • close

        public final void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class ContentSelection
      • isClosed

        public final boolean isClosed()
        Tells whether the close() method has been called. Once an object is closed any method will throw IllegalStateException.
        Overrides:
        isClosed in class ContentSelection
        Returns:
        true if this object is closed.
      • getType

        @NotNull
        public final @NotNull java.lang.String getType()
        Returns the type of this block.
        Returns:
        the type name.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
      • getId

        @NotNull
        public final @NotNull java.lang.String getId()
        Returns the identifier of this block.
        Returns:
        the identifier.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
      • getRenderingId

        @NotNull
        public final @NotNull java.lang.String getRenderingId()
        Returns an identifier that can be used to match corresponding calls to ICanvas.startGroup(String, float, float, float, float, boolean).
        Returns:
        the rendering identifier.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
      • getAttributes

        @NotNull
        public final @NotNull java.lang.String getAttributes()
        Returns the block's attributes as a JSON string.
        Returns:
        the attributes.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
        Since:
        1.1
      • getChildren

        @NotNull
        public final @NotNull ContentBlock[] getChildren()
        Returns the children of this block. The returned array is a copy of the list of child blocks, which makes it safe against concurrent changes.
        Returns:
        an array of the child blocks.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
      • getParent

        @Nullable
        public final @Nullable ContentBlock getParent()
        Returns the parent of this block.
        Returns:
        the parent of this block, or null if this block is the root block.
        Throws:
        java.lang.IllegalStateException - when this block is closed.
        java.lang.IllegalStateException - when block is invalid.
        Since:
        1.4