public abstract class AbstractField<T> extends Object implements Field<T>
Modifier and Type | Field and Description |
---|---|
protected PropertyAccessor |
accessor |
protected String |
bulkCheckboxName |
protected boolean |
bulkChecked |
protected int |
colSpan |
static String |
COPYRIGHT |
static String |
EDITABLE_FIELD_CSS_CLASS |
protected Configuration |
elementsConfiguration |
protected boolean |
enabled |
protected List<String> |
errors |
protected String |
fieldCssClass |
protected boolean |
forceNewRow |
static String |
FORM_LABEL_CSS_CLASS |
protected String |
help |
protected String |
href |
protected String |
id |
static String |
INPUT_CONTAINER_CSS_CLASS |
protected String |
inputName |
protected boolean |
insertable |
protected String |
label |
static org.slf4j.Logger |
logger |
protected Mode |
mode |
protected boolean |
required |
static String |
STATIC_VALUE_CSS_CLASS |
protected String |
title |
protected boolean |
updatable |
Constructor and Description |
---|
AbstractField(PropertyAccessor accessor,
Mode mode) |
AbstractField(PropertyAccessor accessor,
Mode mode,
String prefix) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStringValue, getValue, setStringValue, setValue, valueToXhtml
validate, writeToObject
public static final String COPYRIGHT
public static final String INPUT_CONTAINER_CSS_CLASS
public static final String FORM_LABEL_CSS_CLASS
public static final String EDITABLE_FIELD_CSS_CLASS
public static final String STATIC_VALUE_CSS_CLASS
protected final Configuration elementsConfiguration
protected final PropertyAccessor accessor
protected final Mode mode
protected String id
protected String bulkCheckboxName
protected boolean bulkChecked
protected String inputName
protected String label
protected String href
protected String title
protected boolean required
protected boolean enabled
protected boolean insertable
protected boolean updatable
protected boolean forceNewRow
protected int colSpan
protected String help
@NotNull protected String fieldCssClass
public static final org.slf4j.Logger logger
public AbstractField(@NotNull PropertyAccessor accessor, @NotNull Mode mode)
public AbstractField(@NotNull PropertyAccessor accessor, @NotNull Mode mode, @Nullable String prefix)
public void toXhtml(@NotNull XhtmlBuffer xb)
toXhtml
in interface XhtmlFragment
protected void openVisibleField(XhtmlBuffer xb)
xb
- the buffer to write to.public boolean isValid()
public boolean isReadOnly()
public boolean isBlank()
protected void closeVisibleField(XhtmlBuffer xb)
xb
- the buffer to write to.public void labelToXhtml(XhtmlBuffer xb)
labelToXhtml
in interface Field<T>
public void helpToXhtml(XhtmlBuffer xb)
helpToXhtml
in interface Field<T>
public void errorsToXhtml(XhtmlBuffer xb)
errorsToXhtml
in interface Field<T>
public void readFromRequest(HttpServletRequest req)
readFromRequest
in interface Element
public void readFromObject(Object obj)
readFromObject
in interface Element
public void readFrom(KeyValueAccessor keyValueAccessor)
readFrom
in interface FormElement
public void writeTo(KeyValueAccessor keyValueAccessor)
writeTo
in interface FormElement
public String getDisplayValue()
getDisplayValue
in interface Field<T>
public PropertyAccessor getPropertyAccessor()
getPropertyAccessor
in interface Field<T>
public String getLabel()
getLabel
in interface FormElement
public void setLabel(String label)
setLabel
in interface FormElement
public String getInputName()
getInputName
in interface Field<T>
public void setInputName(String inputName)
setInputName
in interface Field<T>
public boolean isRequired()
isRequired
in interface Field<T>
public void setRequired(boolean required)
setRequired
in interface Field<T>
public String getHelp()
getHelp
in interface FormElement
public void setHelp(String help)
setHelp
in interface FormElement
public Mode getMode()
getMode
in interface FormElement
public List<String> getErrors()
getErrors
in interface FormElement
public boolean isForceNewRow()
isForceNewRow
in interface FormElement
public void setForceNewRow(boolean forceNewRow)
setForceNewRow
in interface FormElement
public int getColSpan()
getColSpan
in interface FormElement
public void setColSpan(int colSpan)
setColSpan
in interface FormElement
public boolean hasRequiredFields()
hasRequiredFields
in interface FormElement
@NotNull public String getFieldCssClass()
public void setFieldCssClass(@NotNull String fieldCssClass)
public void setEnabled(boolean enabled)
setEnabled
in interface Field<T>
public boolean isInsertable()
isInsertable
in interface Field<T>
public void setInsertable(boolean insertable)
setInsertable
in interface Field<T>
public boolean isUpdatable()
isUpdatable
in interface Field<T>
public void setUpdatable(boolean updatable)
setUpdatable
in interface Field<T>
protected void writeToObject(@NotNull PropertyAccessor accessor, @NotNull Object obj, @Nullable Object value)