|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.types.AbstractModelObject
public abstract class AbstractModelObject
Abstract base class that can be extended to introduce custom model objects into the framework. Custom model objects must be registered with the configuration file. Once done, they can be loaded and persisted along with other model objects. All model classes extending from this class are expected to have "id", "title" and "description" fields.
Field Summary | |
---|---|
static String |
CONTAINER_PROPERTIES
|
static String |
CONTAINER_RESOURCES
|
protected Map<String,Serializable> |
customProperties
|
protected String |
description
|
protected String |
descriptionId
|
protected org.dom4j.Document |
document
|
protected String |
id
|
protected ModelPersisterInfo |
info
|
protected Map<String,Serializable> |
modelProperties
|
protected String |
modelVersion
|
protected long |
modificationTime
|
protected ResourceProvider |
resourceContainer
|
protected String |
title
|
protected String |
titleId
|
Fields inherited from interface org.springframework.extensions.surf.ModelObject |
---|
PROP_DESCRIPTION, PROP_DESCRIPTION_ID, PROP_ID, PROP_TITLE, PROP_TITLE_ID |
Constructor Summary | |
---|---|
protected |
AbstractModelObject()
Constructor used by sentinel object |
|
AbstractModelObject(String id,
ModelPersisterInfo info,
org.dom4j.Document document)
Constructs a new model object |
Method Summary | |
---|---|
Resource |
addResource(String name,
String resourceId)
Adds/Creates a resource with the given name and resource id |
Resource |
addResource(String name,
String protocolId,
String endpointId,
String objectId)
Adds/Creates a resource with the given name, object id and endpoint id |
boolean |
getBooleanProperty(String propertyName)
|
Map<String,Serializable> |
getCustomProperties()
|
String |
getCustomProperty(String propertyName)
|
String |
getDescription()
Returns the description property of the model object |
String |
getDescriptionId()
Returns the description id property of the model object |
org.dom4j.Document |
getDocument()
|
String |
getId()
Returns the id of the model object. |
ModelPersisterInfo |
getKey()
Returns the model object key instance |
Map<String,Serializable> |
getModelProperties()
|
String |
getModelProperty(String propertyName)
|
String |
getModelVersion()
|
long |
getModificationTime()
|
String |
getPersisterId()
Returns the ModelObjectPersister id that this object is bound to |
Map<String,Serializable> |
getProperties()
|
String |
getProperty(String propertyName)
|
Resource |
getResource(String name)
Looks up a resource with the given name |
protected ResourceProvider |
getResourceContainer()
|
Resource[] |
getResources()
Returns the set of all resources |
Map<String,Resource> |
getResourcesMap()
Returns the map of resources |
String |
getStoragePath()
Returns the persistence storage path of this object |
String |
getTitle()
Returns the title property of the model object. |
String |
getTitleId()
Returns the title id property of the model object. |
abstract String |
getTypeId()
Returns the type id of the model object. |
protected boolean |
isCustomProperty(String propertyName)
Uses reflection to determine whether the given property name is a custom property. |
protected boolean |
isModelProperty(String propertyName)
Uses reflection to determine whether the given property name is a model property. |
boolean |
isSaved()
Indicates whether the object is currently persisted (saved) or not. |
void |
removeCustomProperty(String propertyName)
|
void |
removeModelProperty(String propertyName)
|
void |
removeProperty(String propertyName)
|
void |
removeResource(String name)
Removes a resource with the given name |
void |
setCustomProperty(String propertyName,
String propertyValue)
|
void |
setDescription(String value)
Sets the description property of the model object |
void |
setDescriptionId(String value)
Sets the description id property of the model object |
void |
setId(String id)
Allows for reassignment of the id of the object |
void |
setModelProperty(String propertyName,
String propertyValue)
|
void |
setModificationTime(long modificationTime)
|
void |
setProperty(String propertyName,
String propertyValue)
|
void |
setTitle(String title)
Sets the title property of the model object |
void |
setTitleId(String titleId)
Sets the title id property of the model object |
String |
toString()
|
void |
touch()
|
String |
toXML()
Serializes the object to XML. |
void |
updateResource(String name,
Resource resource)
Updates a resource for the given name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String CONTAINER_PROPERTIES
public static String CONTAINER_RESOURCES
protected final org.dom4j.Document document
protected final ModelPersisterInfo info
protected String id
protected long modificationTime
protected String modelVersion
protected Map<String,Serializable> modelProperties
protected Map<String,Serializable> customProperties
protected String title
protected String titleId
protected String description
protected String descriptionId
protected ResourceProvider resourceContainer
Constructor Detail |
---|
public AbstractModelObject(String id, ModelPersisterInfo info, org.dom4j.Document document)
document
- the documentprotected AbstractModelObject()
Method Detail |
---|
public final ModelPersisterInfo getKey()
ModelObject
getKey
in interface ModelObject
public final String getModelVersion()
getModelVersion
in interface ModelObject
public final String getId()
ModelObject
getId
in interface ModelObject
public final String getTitle()
ModelObject
getTitle
in interface ModelObject
public final String getTitleId()
ModelObject
getTitleId
in interface ModelObject
public final void setTitle(String title)
ModelObject
setTitle
in interface ModelObject
public final void setTitleId(String titleId)
ModelObject
setTitleId
in interface ModelObject
public final String getDescription()
ModelObject
getDescription
in interface ModelObject
public final String getDescriptionId()
ModelObject
getDescriptionId
in interface ModelObject
public final void setDescription(String value)
ModelObject
setDescription
in interface ModelObject
public final void setDescriptionId(String value)
ModelObject
setDescriptionId
in interface ModelObject
public final boolean isSaved()
ModelObject
isSaved
in interface ModelObject
public final org.dom4j.Document getDocument()
getDocument
in interface ModelObject
public final String toXML()
ModelObject
toXML
in interface ModelObject
public final boolean getBooleanProperty(String propertyName)
getBooleanProperty
in interface ModelObject
public final String getProperty(String propertyName)
getProperty
in interface ModelObject
public final void setProperty(String propertyName, String propertyValue)
setProperty
in interface ModelObject
public final void removeProperty(String propertyName)
removeProperty
in interface ModelObject
protected final boolean isCustomProperty(String propertyName)
propertyName
- the property name
protected final boolean isModelProperty(String propertyName)
propertyName
- the property name
public final String getModelProperty(String propertyName)
getModelProperty
in interface ModelObject
public final void setModelProperty(String propertyName, String propertyValue)
setModelProperty
in interface ModelObject
public final void removeModelProperty(String propertyName)
removeModelProperty
in interface ModelObject
public final String getCustomProperty(String propertyName)
getCustomProperty
in interface ModelObject
public final void setCustomProperty(String propertyName, String propertyValue)
setCustomProperty
in interface ModelObject
public final void removeCustomProperty(String propertyName)
removeCustomProperty
in interface ModelObject
public final Map<String,Serializable> getProperties()
getProperties
in interface ModelObject
public final Map<String,Serializable> getModelProperties()
getModelProperties
in interface ModelObject
public final Map<String,Serializable> getCustomProperties()
getCustomProperties
in interface ModelObject
public final long getModificationTime()
getModificationTime
in interface ModelObject
public final void setModificationTime(long modificationTime)
public final void touch()
touch
in interface ModelObject
public abstract String getTypeId()
ModelObject
getTypeId
in interface ModelObject
public String toString()
toString
in class Object
public final String getPersisterId()
getPersisterId
in interface ModelObject
public final String getStoragePath()
getStoragePath
in interface ModelObject
public Resource getResource(String name)
ResourceProvider
getResource
in interface ResourceProvider
public Resource[] getResources()
ResourceProvider
getResources
in interface ResourceProvider
public Map<String,Resource> getResourcesMap()
ResourceProvider
getResourcesMap
in interface ResourceProvider
public Resource addResource(String name, String resourceId)
ResourceProvider
addResource
in interface ResourceProvider
public Resource addResource(String name, String protocolId, String endpointId, String objectId)
ResourceProvider
addResource
in interface ResourceProvider
public void updateResource(String name, Resource resource)
ResourceProvider
updateResource
in interface ResourceProvider
public void removeResource(String name)
ResourceProvider
removeResource
in interface ResourceProvider
protected ResourceProvider getResourceContainer()
public void setId(String id)
id
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |