|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jelly.TagSupport
org.apache.commons.jelly.tags.interaction.AskTag
public class AskTag
Jelly Tag that asks the user a question, and puts his answer into a variable, with the attribute "answer". This variable may be reused further as any other Jelly variable.
Field Summary | |
---|---|
private java.lang.String |
answer
The variable in which we will stock the user's input. |
private static jline.History |
consoleHistory
|
private java.lang.String |
defaultInput
The default value, if the user doesn't answer |
private java.lang.String |
input
The user's input |
private static org.apache.commons.logging.Log |
logger
|
private java.lang.String |
prompt
The prompt to display before the user input |
private java.lang.String |
question
The question to ask to the user |
Fields inherited from class org.apache.commons.jelly.TagSupport |
---|
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary | |
---|---|
AskTag()
|
Method Summary | |
---|---|
void |
doTag(org.apache.commons.jelly.XMLOutput output)
Perform functionality provided by the tag |
void |
setAnswer(java.lang.String answer)
Sets the name of the variable that will hold the answer This defaults to "interact.answer". |
void |
setDefault(java.lang.String defaultInput)
Sets the default answer to the question. |
void |
setPrompt(java.lang.String prompt)
Sets the prompt that will be displayed before the user's input. |
void |
setQuestion(java.lang.String question)
Sets the question to ask to the user. |
Methods inherited from class org.apache.commons.jelly.TagSupport |
---|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.commons.logging.Log logger
private java.lang.String question
private java.lang.String answer
private java.lang.String defaultInput
private java.lang.String input
private java.lang.String prompt
private static jline.History consoleHistory
Constructor Detail |
---|
public AskTag()
Method Detail |
---|
public void setQuestion(java.lang.String question)
question
- The question to ask to the userpublic void setAnswer(java.lang.String answer)
answer
- the name of the variable that will hold the answerpublic void setDefault(java.lang.String defaultInput)
default
- the default answer to the questionpublic void setPrompt(java.lang.String prompt)
promt
- the prompt that will be displayed before the user's input.public void doTag(org.apache.commons.jelly.XMLOutput output)
output
- the place to write output
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |