All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.openly.dt.ConditionalText

com.openly.dt.EncodingDynamicTag   |   +----com.openly.dt.ParsingDynamicTag           |           +----com.openly.dt.ConditionalText

public class ConditionalText
extends com.openly.dt.ParsingDynamicTag
ConditionalText is a dynamic tag implementation uses argument 1 as the name of a switch parameter. It retrieves the value of the parameter, returns the second argument, as a dynamic tag (either as a DynamicTag class or Params item), if "true" or the third argument, as a dynamic tag, if "false". a String is true if not "", an Integer is true if >0 , and any other object is treated as a String. The result is interpreted as a dynamic tag, unless parameter starts with a quote character, in which case enclosing quotes are stripped and the string is returned.

Conditional Text has a synonym in JSText, "if".

USAGE:

    [[@if(inFrame,"target=_top",@template(noframetarget.tpl)]]     means: if there is a non-empty value for inFrame in params, then replace the tag with "target=_top",  otherwise insert template "noframetarget.tpl"    [[@com.openly.dt.ConditionalText(for,for)]]     means: if there is a non-empty value for "for" in params, then replace the tag with that value,  otherwise insert nothing
Check out Java and Linking related books at Openly.com!


Constructor Index

 o ConditionalText()

Method Index

 o getValue(String, Params)
 o main(String[])

Constructors

 o ConditionalText
 public ConditionalText()

Methods

 o getValue
 public java.lang.String getValue(java.lang.String param,                                  com.openly.util.Params params)
Overrides:
getValue in class com.openly.dt.EncodingDynamicTag
 o main
 public static void main(java.lang.String params[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index