Class VariableDeclaration

    • Constructor Detail

      • VariableDeclaration

        VariableDeclaration()
        Constructor for serialization.
      • VariableDeclaration

        public VariableDeclaration​(java.lang.String name,
                                   TypeDescriptor<?> type)
        Creates a new variable declaration. Parent must be explicitly adjusted by parent instance.
        Parameters:
        name - the name of the variable
        type - the type of the variable
      • VariableDeclaration

        public VariableDeclaration​(java.lang.String name,
                                   TypeDescriptor<?> type,
                                   boolean isConstant,
                                   Expression expression)
        Creates a new variable declaration.
        Parameters:
        name - the name of the variable
        type - the type of the variable
        isConstant - whether this variable is a constant
        expression - an expression denoting the initial value (may be null)
    • Method Detail

      • accept

        public java.lang.Object accept​(IVisitor visitor)
                                throws VilException
        Description copied from interface: ITemplateLangElement
        Accepts the visitor for visiting.
        Specified by:
        accept in interface ITemplateLangElement
        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)
      • isLoop

        public boolean isLoop()
        Description copied from interface: ITemplateElement
        Returns whether this element is a loop.
        Specified by:
        isLoop in interface ITemplateElement
        Returns:
        true if it is a loop, false else
      • isBlock

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

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

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