X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Foutput%2Ftemplate%2FIfStatement.java;h=1b49f3b28f0ae1dad5dfe8526cbd5e347cd9b9e6;hb=3e6fc72fae3a11ad28b602f8ee6b02b91f15ed5e;hp=29cfc768f2ac674706a367325ef5eb6aa90b6dea;hpb=ec155eec51606c19970c9099ef23f700fb6aa53a;p=gigi.git diff --git a/src/org/cacert/gigi/output/template/IfStatement.java b/src/org/cacert/gigi/output/template/IfStatement.java index 29cfc768..1b49f3b2 100644 --- a/src/org/cacert/gigi/output/template/IfStatement.java +++ b/src/org/cacert/gigi/output/template/IfStatement.java @@ -6,6 +6,10 @@ import java.util.Map; import org.cacert.gigi.localisation.Language; +/** + * One ore two {@link Outputable}s that are emitted conditionally if a given + * variable is neither null nor {@link Boolean#FALSE}. + */ public final class IfStatement implements Translatable { private final String variable; @@ -14,12 +18,30 @@ public final class IfStatement implements Translatable { private final TemplateBlock iffalse; + /** + * Creates a new {@link IfStatement} with an empty else-part. + * + * @param variable + * the variable to check. + * @param body + * the body to emit conditionally. + */ public IfStatement(String variable, TemplateBlock body) { this.variable = variable; this.iftrue = body; this.iffalse = null; } + /** + * Creates a new {@link IfStatement} with an else-block. + * + * @param variable + * the variable to check. + * @param iftrue + * the block to emit if the check succeeds. + * @param iffalse + * the block to emit if the check fails. + */ public IfStatement(String variable, TemplateBlock iftrue, TemplateBlock iffalse) { this.variable = variable; this.iftrue = iftrue;