|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.student.common.ui.client.mvc.DataModel
public class DataModel
Nested Class Summary | |
---|---|
static interface |
DataModel.QueryCallback<T>
|
Field Summary | |
---|---|
private HasChangeCallbacks.ChangeCallbackRegistration |
bridgeCallbackReg
|
private ModelDefinition |
definition
|
private com.google.gwt.event.shared.HandlerManager |
handlers
|
private String |
modelName
|
private String |
parentPath
|
private Data |
root
|
private static long |
serialVersionUID
|
private DataModelValidator |
validator
|
Constructor Summary | |
---|---|
DataModel()
|
|
DataModel(ModelDefinition definition,
Data root)
|
|
DataModel(String name)
|
Method Summary | ||
---|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addModelChangeHandler(ModelChangeHandler handler)
Adds a ModelChangeHandler that will be invoked for ModelChangeEvents |
|
|
get(QueryPath path)
|
|
|
get(String path)
|
|
ModelDefinition |
getDefinition()
|
|
Metadata |
getMetadata(QueryPath path)
|
|
String |
getModelName()
|
|
String |
getParentPath()
|
|
Data |
getRoot()
|
|
Data.DataType |
getType(QueryPath path)
|
|
boolean |
isValidPath(String sPath)
Checks to see if data exists for the path passed in |
|
Map<QueryPath,Object> |
query(QueryPath path)
|
|
Map<QueryPath,Object> |
query(String path)
|
|
private void |
queryRelative(Data branch,
QueryPath path,
Map<QueryPath,Object> result)
|
|
void |
remove(QueryPath path)
|
|
void |
resetRoot()
|
|
void |
set(QueryPath path,
Boolean value)
|
|
void |
set(QueryPath path,
Data.Value value)
|
|
void |
set(QueryPath path,
Data value)
|
|
void |
set(QueryPath path,
Date value)
|
|
void |
set(QueryPath path,
Double value)
|
|
void |
set(QueryPath path,
Float value)
|
|
void |
set(QueryPath path,
Integer value)
|
|
void |
set(QueryPath path,
Long value)
|
|
void |
set(QueryPath path,
Short value)
|
|
void |
set(QueryPath path,
String value)
|
|
void |
setDefinition(ModelDefinition definition)
|
|
void |
setModelName(String modelName)
|
|
void |
setParentPath(String parentPath)
If the root element for this is a child of another data object, then the parent path must be set to the path where this child data object can be found. |
|
void |
setRoot(Data root)
Set the top level data for this DataModel |
|
void |
validate(Callback<List<ValidationResultInfo>> callback)
Validates this data model against its ModelDefinition/Metadata and returns the result to the callback |
|
void |
validateField(FieldDescriptor fd,
Callback<List<ValidationResultInfo>> callback)
Validates a single field |
|
void |
validateNextState(Callback<List<ValidationResultInfo>> callback)
Validates this data model against the next state in its ModelDefinition and returns the result to the callback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private String modelName
private ModelDefinition definition
private DataModelValidator validator
private com.google.gwt.event.shared.HandlerManager handlers
private HasChangeCallbacks.ChangeCallbackRegistration bridgeCallbackReg
private Data root
private String parentPath
Constructor Detail |
---|
public DataModel()
public DataModel(String name)
public DataModel(ModelDefinition definition, Data root)
Method Detail |
---|
public String getModelName()
public void setModelName(String modelName)
public <T> T get(QueryPath path)
public <T> T get(String path)
public Data getRoot()
public void resetRoot()
public void remove(QueryPath path)
public Map<QueryPath,Object> query(QueryPath path)
path
- The path in the data model
public Map<QueryPath,Object> query(String path)
path
- The path in the data model
private void queryRelative(Data branch, QueryPath path, Map<QueryPath,Object> result)
branch
- The data branch on which to perform the querypath
- The path string relative to the root of the branchresult
- A map containing all matching paths and the corresponding data value. For a non-wildcard path
this should return a single entry in the map of the path supplied and the corresponding value. For
a path containing wildcard, an entry in the map will exist for each matching path and their corresponding values.
Note: A path ending in a wild card will not match the _runtimeData element.public void set(QueryPath path, Data value)
public void set(QueryPath path, Integer value)
public void set(QueryPath path, String value)
public void set(QueryPath path, Long value)
public void set(QueryPath path, Short value)
public void set(QueryPath path, Double value)
public void set(QueryPath path, Float value)
public void set(QueryPath path, Boolean value)
public void set(QueryPath path, Date value)
public void set(QueryPath path, Data.Value value)
public Data.DataType getType(QueryPath path)
public Metadata getMetadata(QueryPath path)
public void setRoot(Data root)
root
- the root to setpublic com.google.gwt.event.shared.HandlerRegistration addModelChangeHandler(ModelChangeHandler handler)
Model
addModelChangeHandler
in interface Model
handler
- the handler to add
public ModelDefinition getDefinition()
public void setDefinition(ModelDefinition definition)
public String getParentPath()
public void setParentPath(String parentPath)
parentPath
- public void validate(Callback<List<ValidationResultInfo>> callback)
callback
- public void validateNextState(Callback<List<ValidationResultInfo>> callback)
callback
- public void validateField(FieldDescriptor fd, Callback<List<ValidationResultInfo>> callback)
fd
- callback
- public boolean isValidPath(String sPath)
sPath
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |