All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jamon.logic.IfElse Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
// Autogenerated Jamon proxy
// /Users/jay/jamon/jamon-stdlib/src/main/templates/org/jamon/logic/IfElse.jamon

package org.jamon.logic;


@org.jamon.annotations.Template(
  signature = "2D6A258328EFE1D25400A673ECA87951",
  requiredArguments = {
    @org.jamon.annotations.Argument(name = "condition", type = "boolean")},
  fragmentArguments = {
    @org.jamon.annotations.Fragment(
      name = "Then"),
    @org.jamon.annotations.Fragment(
      name = "Else")})
// 20, 1
@Deprecated
public class IfElse
  extends org.jamon.AbstractTemplateProxy
{
  
  public IfElse(org.jamon.TemplateManager p_manager)
  {
     super(p_manager);
  }
  
  public IfElse()
  {
     super("/org/jamon/logic/IfElse");
  }
  
  protected interface Intf
    extends org.jamon.AbstractTemplateProxy.Intf{
    public static interface Fragment_Else
    {
      void renderNoFlush(final java.io.Writer jamonWriter)
        throws java.io.IOException;
      org.jamon.Renderer makeRenderer();
    }
    
    
    public static interface Fragment_Then
    {
      void renderNoFlush(final java.io.Writer jamonWriter)
        throws java.io.IOException;
      org.jamon.Renderer makeRenderer();
    }
    
    
    
    void renderNoFlush(final java.io.Writer jamonWriter) throws java.io.IOException;
    
  }
  public static class ImplData
    extends org.jamon.AbstractTemplateProxy.ImplData
  {
    // 23, 3
    public void setCondition(boolean condition)
    {
      // 23, 3
      m_condition = condition;
    }
    public boolean getCondition()
    {
      return m_condition;
    }
    private boolean m_condition;
    // 26, 1
    public void setElse(Fragment_Else Else)
    {
      // 26, 1
      m_Else = Else;
    }
    public Fragment_Else getElse()
    {
      return m_Else;
    }
    private Fragment_Else m_Else;
    // 25, 1
    public void setThen(Fragment_Then Then)
    {
      // 25, 1
      m_Then = Then;
    }
    public Fragment_Then getThen()
    {
      return m_Then;
    }
    private Fragment_Then m_Then;
  }
  @Override
  protected ImplData makeImplData()
  {
    return new ImplData();
  }
  @Override @SuppressWarnings("unchecked") public ImplData getImplData()
  {
    return (ImplData) super.getImplData();
  }
  public static interface Fragment_Else
    extends Intf.Fragment_Else
  {
  }
  
  
  public static interface Fragment_Then
    extends Intf.Fragment_Then
  {
  }
  
  
  
  
  @Override
  public org.jamon.AbstractTemplateImpl constructImpl(Class p_class){
    try
    {
      return p_class
        .getConstructor(new Class [] { org.jamon.TemplateManager.class, ImplData.class })
        .newInstance(new Object [] { getTemplateManager(), getImplData()});
    }
    catch (RuntimeException e)
    {
      throw e;
    }
    catch (Exception e)
    {
      throw new RuntimeException(e);
    }
  }
  
  @Override
  protected org.jamon.AbstractTemplateImpl constructImpl(){
    return new IfElseImpl(getTemplateManager(), getImplData());
  }
  public org.jamon.Renderer makeRenderer(final boolean condition, final Fragment_Then Then, final Fragment_Else Else)
  {
    return new org.jamon.AbstractRenderer() {
      @Override
      public void renderTo(final java.io.Writer jamonWriter)
        throws java.io.IOException
      {
        render(jamonWriter, condition, Then, Else);
      }
    };
  }
  
  public void render(final java.io.Writer jamonWriter, final boolean condition, final Fragment_Then Then, final Fragment_Else Else)
    throws java.io.IOException
  {
    renderNoFlush(jamonWriter, condition, Then, Else);
    jamonWriter.flush();
  }
  public void renderNoFlush(final java.io.Writer jamonWriter, final boolean condition, final Fragment_Then Then, final Fragment_Else Else)
    throws java.io.IOException
  {
    ImplData implData = getImplData();
    implData.setCondition(condition);
    implData.setThen(Then);
    implData.setElse(Else);
    Intf instance = (Intf) getTemplateManager().constructImpl(this);
    instance.renderNoFlush(jamonWriter);
    reset();
  }
  
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy