public interface Model extends PropertyChangeListener, Cloneable, Mutable, Serializable
Controller
,
View
Modifier and Type | Interface and Description |
---|---|
static class |
Model.Attribute
The Class Attribute.
|
Modifier and Type | Method and Description |
---|---|
Object |
access(String attributeName)
Returns the value of the attribute.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the property change listener.
|
void |
addSubModel(Model model)
Adds the sub model.
|
boolean |
attributeExists(String attributeName)
Checks if attribute exists in the model or sub-models.
|
Object |
clone()
Clones model
|
void |
copyFrom(Model model)
Copies model from another model.
|
Map<String,Model.Attribute> |
getAllAttributes()
Gets the map of all attributes, including sub-models.
|
Map<String,Model.Attribute> |
getAttributes()
Gets the map of attributes for this model only, excluding sub-models.
|
Model |
getModelByAttributeName(String attributeName)
Gets the model by attribute name.
|
Model |
getOwner()
Gets the owner model.
|
void |
populate(String attributeName,
Object newValue)
Sets the value for the attribute.
|
void |
propertyChange(PropertyChangeEvent event) |
void |
read(String attributeName,
Object value)
Reads the attribute from the storage such as xml, database, etc
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the property change listener.
|
void |
removeSubModel(Model model)
Removes the sub model.
|
void |
setOwner(Model value)
Sets the owner.
|
Object |
write(String attributeName)
Writes the attribute to the storage such as xml, database, etc
|
Object access(String attributeName)
attributeName
- the attribute namevoid addPropertyChangeListener(PropertyChangeListener listener)
listener
- the listenervoid addSubModel(Model model)
model
- the modelboolean attributeExists(String attributeName)
attributeName
- the attribute nameObject clone() throws CloneNotSupportedException
CloneNotSupportedException
- the clone not supported exceptionvoid copyFrom(Model model) throws Exception
model
- the model to copyException
- in case of any errorMap<String,Model.Attribute> getAllAttributes()
Map<String,Model.Attribute> getAttributes()
Model getModelByAttributeName(String attributeName)
attributeName
- the attribute nameModel getOwner()
void populate(String attributeName, Object newValue)
attributeName
- the attribute namenewValue
- the new valuevoid propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
void read(String attributeName, Object value)
attributeName
- the attribute namevalue
- the valuevoid removePropertyChangeListener(PropertyChangeListener listener)
listener
- the listenervoid removeSubModel(Model model)
model
- the modelvoid setOwner(Model value)
value
- the new ownerObject write(String attributeName)
attributeName
- the attribute nameCopyright © 2010-2020 Toolsverse. All Rights Reserved.