Class TemplateBlock

    • Constructor Detail

      • TemplateBlock

        TemplateBlock()
        Constructor for serialization.
      • TemplateBlock

        public TemplateBlock​(ITemplateElement[] body)
        Creates a new block.
        Parameters:
        body - the body
    • Method Detail

      • setBody

        public void setBody​(ITemplateElement[] body)
        Changes the body elements.
        Parameters:
        body - the new body elements
      • getBodyElementCount

        public int getBodyElementCount()
        Get the number of body elements of this rule.
        Returns:
        The number of body elements of this rule.
      • getBodyElement

        public ITemplateElement getBodyElement​(int index)
        Get the element of this block at the specified index.
        Parameters:
        index - The 0-based index of the element to be returned.
        Returns:
        The element at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >=getBodyElementCount()
      • accept

        public java.lang.Object accept​(IVisitor visitor)
                                throws VilException
        Description copied from interface: ITemplateLangElement
        Accepts the visitor for visiting.
        Parameters:
        visitor - the visitor to be used
        Returns:
        the result of visiting this instance (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • isBlock

        public boolean isBlock()
        Description copied from interface: ITemplateElement
        Returns whether this element is a block (opposite is a single statement).
        Returns:
        true if it is a block, false else
      • getTypeDefiningElement

        protected ITemplateElement getTypeDefiningElement()
        Returns the type-defining body element.
        Returns:
        the type-defining body element
      • setParent

        protected void setParent​(ILanguageElement parent)
        Description copied from class: AbstractTemplateElement
        Changes the parent. Please override if children must be adjusted according. Shall be called only once per instance, but there is no limitation.
        Overrides:
        setParent in class AbstractTemplateElement
        Parameters:
        parent - the parent
      • endsWithContentStatement

        public boolean endsWithContentStatement()
        Description copied from interface: ITemplateElement
        Returns whether this element ends with a content statement.
        Returns:
        true for end with content statement, false else