| Constructor and Description |
|---|
ModelFieldBean(String name,
ch.rasc.extclassgenerator.ModelType type)
Creates a new ModelFieldBean with name and type
|
ModelFieldBean(String name,
String type)
Creates a new ModelFieldBean with name and type
|
| Modifier and Type | Method and Description |
|---|---|
Boolean |
getAllowBlank() |
Boolean |
getAllowNull() |
String |
getCalculate() |
String |
getConvert() |
Boolean |
getCritical() |
String |
getDateFormat() |
Object |
getDefaultValue() |
List<String> |
getDepends() |
String |
getMapping() |
ch.rasc.extclassgenerator.ModelType |
getModelType() |
String |
getName() |
Boolean |
getPersist() |
Object |
getReference() |
String |
getType() |
Boolean |
getUnique() |
Boolean |
getUseNull() |
List<AbstractValidation> |
getValidators() |
boolean |
hasOnlyName(OutputConfig outputConfig)
Returns true if only the name property is set
|
void |
setAllowBlank(Boolean allowBlank)
Used for validating a model.
|
void |
setAllowNull(Boolean allowNull)
Use when converting received data into a
integer,
float/number, boolean or string type. |
void |
setCalculate(String calculate)
This config defines a simple field calculation function.
|
void |
setConvert(String convert)
Function which coerces string values in raw data into the field's type
Typical use for a virtual field http://localhost/ext4.1/docs/index.html#!/api/Ext.data.Field-cfg-convert Property ' Ext.data.Field.convert' in JS. |
void |
setCritical(Boolean critical)
A critical field is a field that must always be sent to the server even if it has
not changed.
|
void |
setDateFormat(String dateFormat)
Specifies format of date.
|
void |
setDefaultValue(Object defaultValue)
The default value.
|
void |
setDepends(List<String> depends)
The field name or names within the Model on which the value of this field depends,
and from which a new value may be calculated.
|
void |
setMapping(String mapping)
Typical use for a virtual field to extract field data from the model object
Property ' mapping' in JS. |
void |
setModelType(ch.rasc.extclassgenerator.ModelType type)
Type of the field.
|
void |
setName(String name)
Name of the field.
|
void |
setPersist(Boolean persist)
Prevent the value of this field to be serialized or written with
Ext.data.writer.Writer
Typical use for a virtual field Property ' persist' in JS. |
void |
setReference(Object reference)
Defines a relationship to another model.
|
void |
setUnique(Boolean unique)
true if the value of this field is unique amongst all instances.
|
void |
setUseNull(Boolean useNull)
If true null value is used if value cannot be parsed.
|
void |
setValidators(List<AbstractValidation> validators) |
public ModelFieldBean(String name, ch.rasc.extclassgenerator.ModelType type)
name - name of the fieldtype - type of the fieldpublic boolean hasOnlyName(OutputConfig outputConfig)
public String getName()
public void setName(String name)
name - new name for the fieldpublic ch.rasc.extclassgenerator.ModelType getModelType()
public String getType()
public void setModelType(ch.rasc.extclassgenerator.ModelType type)
type - new type for the fieldpublic Object getDefaultValue()
public void setDefaultValue(Object defaultValue)
defaultValue - new defaultValuepublic String getDateFormat()
public void setDateFormat(String dateFormat)
Will be ignored if the field is not a ModelType.DATE field.
dateFormat - new dateFormat Stringpublic Boolean getUseNull()
public void setUseNull(Boolean useNull)
Only used if type of field is ModelType.INTEGER, ModelType.FLOAT,
ModelType.NUMBER, ModelType.STRING or ModelType.BOOLEAN.
useNull - new value for useNullpublic String getMapping()
public void setMapping(String mapping)
mapping - A path expressionpublic Boolean getPersist()
public void setPersist(Boolean persist)
persist - defaults to true, only a false value will be generatedpublic Boolean getCritical()
public void setCritical(Boolean critical)
See Ext.data.field.FieldView#critical
Defaults to false
public String getConvert()
public void setConvert(String convert)
convert - A function. JavaScript Syntax example: function(v, record) { return
... ; }public String getCalculate()
public void setCalculate(String calculate)
public List<AbstractValidation> getValidators()
public void setValidators(List<AbstractValidation> validators)
public void setDepends(List<String> depends)
#convert() method. If you do not have a #convert() method then
this config should not be specified. Before using this config you should consider
if using a #calculate() method instead of a #convert() method would
be simpler.
public Object getReference()
public void setReference(Object reference)
ReferenceBean
public Boolean getAllowNull()
public void setAllowNull(Boolean allowNull)
integer,
float/number, boolean or string type. If the
value cannot be parsed, null will be used if allowNull is true, otherwise a default
value for that type will be used (0 for integer and float/number, "" for string and
false for boolean)
Defaults to false
Only used if type of field is ModelType.INTEGER, ModelType.FLOAT,
ModelType.NUMBER, ModelType.STRING or ModelType.BOOLEAN.
This is another name for setUseNull(Boolean). Both properties
behave exactly the same. Use only one.
public Boolean getAllowBlank()
public void setAllowBlank(Boolean allowBlank)
Defaults to true
public Boolean getUnique()
public void setUnique(Boolean unique)
Defaults to false
Copyright © 2013–2015. All rights reserved.