public class ModelBean extends Object
ModelGenerator.writeModel(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, ModelBean, OutputFormat, boolean)
or ModelGenerator.generateJavascript(ModelBean, OutputFormat, boolean).| Constructor and Description |
|---|
ModelBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssociation(AbstractAssociation bean)
Adds one instance of
AbstractAssociation to the internal collection of
associations |
void |
addAssociations(List<AbstractAssociation> associationsList) |
void |
addField(ModelFieldBean bean)
Adds one instance of
ModelFieldBean to the internal collection of fields |
void |
addFields(List<ModelFieldBean> modelFields)
Add all provided fields to the collection of fields
|
void |
addValidation(AbstractValidation bean)
Adds one instance of one of the subclasses of
AbstractValidation to the
internal collection of validations |
void |
addValidations(List<AbstractValidation> fieldValidations) |
AllDataOptionsBean |
getAllDataOptions() |
List<AbstractAssociation> |
getAssociations() |
String |
getClientIdProperty() |
String |
getCreateMethod() |
String |
getDestroyMethod() |
String |
getExtend() |
ModelFieldBean |
getField(String fieldName)
Looks for the
ModelFieldBean with the provided name and returns it. |
Map<String,ModelFieldBean> |
getFields() |
String |
getIdentifier() |
String |
getIdProperty() |
String |
getMessageProperty() |
String |
getName() |
PartialDataOptionsBean |
getPartialDataOptions() |
String |
getReader() |
String |
getReadMethod() |
String |
getRootProperty() |
String |
getSuccessProperty() |
String |
getTotalProperty() |
String |
getUpdateMethod() |
List<AbstractValidation> |
getValidations() |
String |
getVersionProperty() |
Boolean |
getWriteAllFields() |
String |
getWriter() |
boolean |
isAutodetectTypes() |
boolean |
isClientIdPropertyAddToWriter() |
boolean |
isDisablePagingParameters() |
boolean |
isPaging() |
void |
setAllDataOptions(AllDataOptionsBean allDataOptions)
Configuration for the writer
|
void |
setAssociations(List<AbstractAssociation> associations) |
void |
setAutodetectTypes(boolean autodetectTypes) |
void |
setClientIdProperty(String clientIdProperty)
The name of the property a server will use to send back a client-generated id in a
create or update operation.
|
void |
setClientIdPropertyAddToWriter(boolean clientIdPropertyAddToWriter)
If true configures the clientIdProperty on the proxy's writer config.
|
void |
setCreateMethod(String createMethod)
Specifies the create method.
|
void |
setDestroyMethod(String destroyMethod)
Specifies the destroy method.
|
void |
setDisablePagingParameters(boolean disablePagingParameters)
If set to true the pageParam, startParam and limitParam option of the proxy will be
set to undefined.
|
void |
setExtend(String extend)
"Superclass" of this model.
|
void |
setFields(Map<String,ModelFieldBean> fields)
Overwrites all field definitions with the provided map.
|
void |
setIdentifier(String identifier)
The id generator to use for this model.
|
void |
setIdProperty(String idProperty)
Name of the id property.
|
void |
setMessageProperty(String messageProperty)
if set add to reader
|
void |
setName(String name)
"Classname" of the model.
|
void |
setPaging(boolean paging)
If true a reader config with root : 'records' will be added to the model object.
|
void |
setPartialDataOptions(PartialDataOptionsBean partialDataOptions)
Configuration for the writer
|
void |
setReader(String reader)
If set adds a reader config to the proxy object.
|
void |
setReadMethod(String readMethod)
Specifies the read method.
|
void |
setRootProperty(String rootProperty)
If set a reader config with root : 'rootProperty' (Ext JS 4) or rootProperty :
'rootProperty' (Sencha Touch 2 and Ext JS 5) will be added to the model object.
|
void |
setSuccessProperty(String successProperty)
If set add to reader
|
void |
setTotalProperty(String totalProperty)
If set add to reader
|
void |
setUpdateMethod(String updateMethod)
Specifies the update method.
|
void |
setValidations(List<AbstractValidation> validations) |
void |
setVersionProperty(String versionProperty)
If specified, this is the name of the property that contains the entity "version".
|
void |
setWriteAllFields(Boolean writeAllFields)
If specified the generator adds a writer config object to the proxy with
writeAllFields.
|
void |
setWriter(String writer)
If set adds a writer config to the proxy object.
|
public boolean isAutodetectTypes()
public void setAutodetectTypes(boolean autodetectTypes)
public String getName()
public void setName(String name)
name - new name for the model objectpublic String getExtend()
public void setExtend(String extend)
Defaults to "Ext.data.Model"
public String getIdProperty()
public void setIdProperty(String idProperty)
idProperty - new value for the idProperty config optionpublic String getVersionProperty()
public void setVersionProperty(String versionProperty)
Defaults to null
public Map<String,ModelFieldBean> getFields()
public void setFields(Map<String,ModelFieldBean> fields)
fields - new collection of ModelFieldBeanpublic List<AbstractValidation> getValidations()
public void setValidations(List<AbstractValidation> validations)
public List<AbstractAssociation> getAssociations()
public void setAssociations(List<AbstractAssociation> associations)
public void addFields(List<ModelFieldBean> modelFields)
modelFields - collection of ModelFieldBeanpublic void addValidations(List<AbstractValidation> fieldValidations)
public void addAssociations(List<AbstractAssociation> associationsList)
public ModelFieldBean getField(String fieldName)
ModelFieldBean with the provided name and returns it.fieldName - name of a fieldModelFieldBean or null if not foundpublic void addField(ModelFieldBean bean)
ModelFieldBean to the internal collection of fieldsbean - instance of ModelFieldBeanpublic void addValidation(AbstractValidation bean)
AbstractValidation to the
internal collection of validationsbean - instance of subclass of AbstractValidationpublic void addAssociation(AbstractAssociation bean)
AbstractAssociation to the internal collection of
associationsbean - instance of AbstractAssociationpublic boolean isPaging()
public void setPaging(boolean paging)
ExtDirectStoreResult
reader : {
root : 'records'
}
paging - new value for pagingpublic boolean isDisablePagingParameters()
public void setDisablePagingParameters(boolean disablePagingParameters)
proxy: {
type: 'direct',
pageParam: undefined,
startParam: undefined,
limitParam: undefined,
}
Default value is falsepublic String getReadMethod()
public void setReadMethod(String readMethod)
If only the readMethod is specified generator will write property directFn instead.
readMethod - new value for read methodpublic String getCreateMethod()
public void setCreateMethod(String createMethod)
createMethod - new value for create methodpublic String getUpdateMethod()
public void setUpdateMethod(String updateMethod)
updateMethod - new value for update methodpublic String getDestroyMethod()
public void setDestroyMethod(String destroyMethod)
destroyMethod - new value for destroy methodpublic String getMessageProperty()
public void setMessageProperty(String messageProperty)
reader : {
messageProperty : 'your property name'
}
It is useful to add a customized message in case of error See Ext.data.reader.Reader#messagePropertymessageProperty - the messageProperty to setpublic String getWriter()
public void setWriter(String writer)
proxy: {
type: 'direct',
writer: {
type: 'mywriter'
}
}
See
Ext.data.proxy.Proxy#writer
Defaults to "json"
public String getReader()
public void setReader(String reader)
proxy: {
type: 'direct',
reader: {
type: 'myreader'
}
}
See
Ext.data.proxy.Proxy#reader
Defaults to "json"
public String getSuccessProperty()
public void setSuccessProperty(String successProperty)
reader : {
successProperty : 'success'
}
See Ext.data.reader.Reader#successProperty
If not present default value 'success' is used.
public String getTotalProperty()
public void setTotalProperty(String totalProperty)
reader : {
totalProperty : 'total'
}
See Ext.data.reader.Reader#totalProperty
If not present default value 'total' is used.
public String getRootProperty()
public void setRootProperty(String rootProperty)
reader : {
rootProperty : 'rootProperty'
}
If #paging() and #rootProperty() are present
#rootProperty() has precedence.
public Boolean getWriteAllFields()
public void setWriteAllFields(Boolean writeAllFields)
proxy: {
type: 'direct',
writer: {
writeAllFields: true
}
}
See Ext.data.writer.WriterView#writeAllFields
Defaults to true
public String getIdentifier()
public void setIdentifier(String identifier)
public String getClientIdProperty()
public void setClientIdProperty(String clientIdProperty)
public boolean isClientIdPropertyAddToWriter()
public void setClientIdPropertyAddToWriter(boolean clientIdPropertyAddToWriter)
clientIdProperty. If clientIdProperty is not set nothing
happens.public AllDataOptionsBean getAllDataOptions()
public void setAllDataOptions(AllDataOptionsBean allDataOptions)
This object contains the options passed to Ext.data.Model.getData when writing Ext.data.Model.phantom records or when writeAllFields is set to true.
public PartialDataOptionsBean getPartialDataOptions()
public void setPartialDataOptions(PartialDataOptionsBean partialDataOptions)
This object contains the options passed to Ext.data.Model.getData when writing non Ext.data.Model.phantom records or when writeAllFields is set to false.
Copyright © 2013–2015. All rights reserved.