org.jamon.logic.If Maven / Gradle / Ivy
// Autogenerated Jamon proxy
// /Users/jay/jamon/jamon-stdlib/src/main/templates/org/jamon/logic/If.jamon
package org.jamon.logic;
@org.jamon.annotations.Template(
signature = "433599F24334B0959D3D8A14940E3768",
requiredArguments = {
@org.jamon.annotations.Argument(name = "condition", type = "boolean")},
fragmentArguments = {
@org.jamon.annotations.Fragment(
name = "Then")})
// 20, 1
@Deprecated
public class If
extends org.jamon.AbstractTemplateProxy
{
public If(org.jamon.TemplateManager p_manager)
{
super(p_manager);
}
public If()
{
super("/org/jamon/logic/If");
}
protected interface Intf
extends org.jamon.AbstractTemplateProxy.Intf{
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;
// 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_Then
extends Intf.Fragment_Then
{
}
@Override
public org.jamon.AbstractTemplateImpl constructImpl(Class extends org.jamon.AbstractTemplateImpl> 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 IfImpl(getTemplateManager(), getImplData());
}
public org.jamon.Renderer makeRenderer(final boolean condition, final Fragment_Then Then)
{
return new org.jamon.AbstractRenderer() {
@Override
public void renderTo(final java.io.Writer jamonWriter)
throws java.io.IOException
{
render(jamonWriter, condition, Then);
}
};
}
public void render(final java.io.Writer jamonWriter, final boolean condition, final Fragment_Then Then)
throws java.io.IOException
{
renderNoFlush(jamonWriter, condition, Then);
jamonWriter.flush();
}
public void renderNoFlush(final java.io.Writer jamonWriter, final boolean condition, final Fragment_Then Then)
throws java.io.IOException
{
ImplData implData = getImplData();
implData.setCondition(condition);
implData.setThen(Then);
Intf instance = (Intf) getTemplateManager().constructImpl(this);
instance.renderNoFlush(jamonWriter);
reset();
}
}