|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.spray.template.form.DefaultFormContext
public class DefaultFormContext
A default implementation of FormContext.
Field Summary |
---|
Fields inherited from interface org.norther.tammi.spray.template.form.FormContext |
---|
FORM_INDEX_SEPARATOR, FORM_NAME_SEPARATOR, FORM_NAME_SPLITTER, FORM_PREFIX_SEPARATOR, PARAMETER_ELEMENT_SEPARATOR |
Constructor Summary | |
---|---|
DefaultFormContext()
Constructs a new context. |
|
DefaultFormContext(FormContext parent)
Constructs a new context with a parent. |
Method Summary | |
---|---|
void |
clearContext()
Clears the context. |
boolean |
contains(String name)
Checks whether the current form variable contains the named attribute. |
int |
getElement()
Gets the array index of the current form attribute element. |
int |
getFormIndex()
Gets the index of the current form variable, if any. |
String |
getFormName()
Gets the name of the current form, if any. |
String |
getFormPrefix()
Gets the prefix of the current form variable and form, if any. |
String |
getFormPrefix(int index)
Gets the prefix of the indexed form variable and the current form. |
protected String |
getFormPrefix(String form,
int index)
Gets the form prefix for the specified name and index. |
MBeanAttributeInfo |
getInfo()
Gets the attribute info of the current form attribute. |
MBeanAttributeInfo |
getInfo(boolean unlocked)
Gets the optionally unlocked attribute info of the current form attribute. |
VariableAttributeInfo |
getInfo(String name)
Gets the named attribute info of the current form variable. |
VariableAttributeInfo |
getInfo(String name,
boolean unlocked)
Gets the named and optionally unlocked attribute info of the current form variable. |
List<VariableAttributeInfo> |
getInfos()
Gets the attribute info list of the current form variable. |
List<VariableAttributeInfo> |
getInfos(boolean unlocked)
Gets the optionally unlocked attribute info list of the current form variable. |
String |
getNestedPrefix()
Gets the nested form prefix. |
FormContext |
getParentContext()
Gets the parent context, if any. |
FormContext |
getRootContext()
Gets the root context. |
Variable |
getVariable()
Gets the current form variable. |
boolean |
isReadOnly()
Checks whether the current form is read-only. |
void |
setElement(int index)
Sets the array index of the current form attribute element. |
void |
setFormName(String form)
Sets the name of the current form and resets its variable index. |
void |
setInfo(MBeanAttributeInfo attribute)
Sets the attribute info of the current form attribute. |
void |
setInfo(String name)
Sets the named attribute info of the current form attribute. |
void |
setReadOnly(boolean readonly)
Sets whether the current form is read-only. |
void |
setVariable(Variable variable,
boolean readonly,
int... index)
Sets the current form variable with a read-only option. |
void |
setVariable(Variable variable,
int... index)
Sets the current form variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFormContext()
public DefaultFormContext(FormContext parent)
parent
- the parent context.Method Detail |
---|
public String getFormName()
FormContext
getFormName
in interface FormContext
public void setFormName(String form)
FormContext
setFormName
in interface FormContext
form
- the form name.public int getFormIndex()
FormContext
getFormIndex
in interface FormContext
public String getFormPrefix()
FormContext
getFormPrefix
in interface FormContext
public String getFormPrefix(int index)
FormContext
getFormPrefix
in interface FormContext
index
- the index.
public String getNestedPrefix()
FormContext
getNestedPrefix
in interface FormContext
public boolean isReadOnly()
FormContext
isReadOnly
in interface FormContext
public void setReadOnly(boolean readonly)
FormContext
setReadOnly
in interface FormContext
readonly
- true if read-only, false otherwise.public Variable getVariable()
FormContext
getVariable
in interface FormContext
public void setVariable(Variable variable, int... index)
FormContext
setVariable
in interface FormContext
variable
- the form variable.index
- the form index.public void setVariable(Variable variable, boolean readonly, int... index)
FormContext
setVariable
in interface FormContext
variable
- the form variable.readonly
- a forced read-only option.index
- the form index.public MBeanAttributeInfo getInfo()
FormContext
getInfo
in interface FormContext
public MBeanAttributeInfo getInfo(boolean unlocked)
FormContext
getInfo
in interface FormContext
unlocked
- true if unlocked, false otherwise.
public VariableAttributeInfo getInfo(String name)
FormContext
getInfo
in interface FormContext
name
- the attribute name.
public VariableAttributeInfo getInfo(String name, boolean unlocked)
FormContext
getInfo
in interface FormContext
name
- the attribute name.unlocked
- true if unlocked, false otherwise.
public void setInfo(String name)
FormContext
setInfo
in interface FormContext
name
- the attribute name.public void setInfo(MBeanAttributeInfo attribute)
FormContext
setInfo
in interface FormContext
attribute
- the form attribute.public List<VariableAttributeInfo> getInfos()
FormContext
getInfos
in interface FormContext
public List<VariableAttributeInfo> getInfos(boolean unlocked)
FormContext
getInfos
in interface FormContext
unlocked
- true if unlocked, false otherwise.
public boolean contains(String name)
FormContext
contains
in interface FormContext
name
- the attribute name.
public int getElement()
FormContext
getElement
in interface FormContext
public void setElement(int index)
FormContext
setElement
in interface FormContext
index
- the element index.public FormContext getParentContext()
FormContext
getParentContext
in interface FormContext
public FormContext getRootContext()
FormContext
getRootContext
in interface FormContext
public void clearContext()
FormContext
clearContext
in interface FormContext
protected String getFormPrefix(String form, int index)
form
- the form name.index
- the variable index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |