Class IfBuilder


  • public class IfBuilder
    extends StatementBuilderBase
    If statement builder. This wraps the AST if representation with convenience methods and added control information.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • m_if

        private final IfStatement m_if
        Method invocation.
      • m_thenBlock

        private BlockBuilder m_thenBlock
        "then" block of statement (automatically created).
    • Constructor Detail

      • IfBuilder

        public IfBuilder​(ClassBuilder source,
                         Expression expr)
        Constructor.
        Parameters:
        source -
        expr - expression
    • Method Detail

      • getThen

        public BlockBuilder getThen()
        Get the "then" conditional block.
        Returns:
        block
      • setElse

        public void setElse​(StatementBuilderBase stmt)
        Set the "else" conditional statement.
        Parameters:
        stmt -