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) |
List<AbstractAssociation> |
getAssociations() |
String |
getCreateMethod() |
String |
getDestroyMethod() |
ModelFieldBean |
getField(String fieldName)
Looks for the
ModelFieldBean with the provided name and returns
it. |
Map<String,ModelFieldBean> |
getFields() |
String |
getIdProperty() |
String |
getName() |
String |
getReadMethod() |
String |
getUpdateMethod() |
List<AbstractValidation> |
getValidations() |
boolean |
isPaging() |
void |
setAssociations(List<AbstractAssociation> associations) |
void |
setCreateMethod(String createMethod)
Specifies the create method.
|
void |
setDestroyMethod(String destroyMethod)
Specifies the destroy method.
|
void |
setFields(Map<String,ModelFieldBean> fields)
Overwrites all field definitions with the provided map.
|
void |
setIdProperty(String idProperty)
Name of the id property.
|
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 |
setReadMethod(String readMethod)
Specifies the read method.
|
void |
setUpdateMethod(String updateMethod)
Specifies the update method.
|
void |
setValidations(List<AbstractValidation> validations) |
public String getName()
public void setName(String name)
name - new name for the model objectpublic String getIdProperty()
public void setIdProperty(String idProperty)
idProperty - new value for the idProperty config optionpublic 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)
ExtDirectStoreReadResult
reader : {
root : 'records'
}
paging - new value for pagingpublic 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 methodCopyright © 2010-2013. All Rights Reserved.