|
CS 1705 Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zhtml.Text
cs1705.web.PrintExpression
public class PrintExpression
Evaluate and echo the contents of a Java expression, such as an arbitrary method call.
A <print-expression> tag has one required property and two optional properties:
type - The (optional) Java type of the expression--this
should be a legal Java class name that is in scope (see
Import) (must come before the value!).isHtml - A boolean that indicates whether the expression
should be treated as a string of HTML text, or whether any special HTML
entities in the value should be escaped so they show up correctly in
web browsers. (Must come before the value!)value - The expression to print. It can be any Java
expression, or any EL expression (i.e., ${...}), but may not be a
bound data value (no @{...}).Examples:
<print-expression value="myString.substring(pos, subLen)"/>
<!-- With an included type -->
<print-expression type="URL" value="myWebBot.getPageURL()"/>
<!-- If you use quotes, they must be HTML-escaped -->
<print-expression
value=""string " + "concatenation""/>
<!-- A longer version, so you don't have to escape the quotes. -->
<print-expression>
<attribute name="value">
"Name: " + person.getLastName() + ", " + person.getFirstName()
</attribute>
</variable>
| Field Summary |
|---|
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
PrintExpression()
Creates a new PrintExpression component. |
|
| Method Summary | |
|---|---|
boolean |
getIsHtml()
Accessor for the "isHtml" property. |
String |
getType()
Accessor for the "type" property, which may be null if no type has been specified. |
void |
setIsHtml(boolean value)
Mutator for the "isHtml" property, which is optional. |
void |
setType(String newType)
Mutator for the "type" property, which is optional. |
void |
setValue(Object value)
Mutator for the "value" property, which provides the variable's initial value. |
void |
setValue(String value)
Mutator for the "value" property, which provides the variable's initial value. |
| Methods inherited from class org.zkoss.zhtml.Text |
|---|
getValue, invalidate, isChildable, redraw, setParent |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrintExpression()
| Method Detail |
|---|
public String getType()
Class name)public void setType(String newType)
newType - The type (class) to use for the variable. The class
name specified must either be fully qualified, or must have been
imported (see Import).public void setValue(Object value)
value - The value to use for the variable. It must
be an object of the appropriate type.public void setValue(String value)
setValue in class org.zkoss.zhtml.Textvalue - A string that will be interpreted as a Java expression
of the appropriate type to produce the desired variable value.public boolean getIsHtml()
public void setIsHtml(boolean value)
value - True if this expression should be treated as HTML, or
false if it should be treated as non-HTML (meaning any HTML entities
should be properly escaped before the value is printed).
|
Last updated: Wed, Apr 1, 2009 12:29 AM EDT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||