org.springframework.extensions.surf.render
Class AbstractRenderableModelObject

java.lang.Object
  extended by org.springframework.extensions.surf.types.AbstractModelObject
      extended by org.springframework.extensions.surf.render.AbstractRenderableModelObject
All Implemented Interfaces:
Serializable, ModelObject, Renderable, ResourceProvider
Direct Known Subclasses:
ChromeImpl, ComponentTypeImpl, TemplateTypeImpl

public abstract class AbstractRenderableModelObject
extends AbstractModelObject
implements Renderable

Abstract base class for a renderable model object. A renderable model object is one that has renderer processors defined on it for one or more render modes.

Author:
muzquiano
See Also:
Serialized Form

Field Summary
static String ATTR_RENDER_MODE
           
static String PROP_PROCESSOR
           
 
Fields inherited from class org.springframework.extensions.surf.types.AbstractModelObject
CONTAINER_PROPERTIES, CONTAINER_RESOURCES, customProperties, description, descriptionId, document, id, info, modelProperties, modelVersion, modificationTime, resourceContainer, title, titleId
 
Fields inherited from interface org.springframework.extensions.surf.ModelObject
PROP_DESCRIPTION, PROP_DESCRIPTION_ID, PROP_ID, PROP_TITLE, PROP_TITLE_ID
 
Constructor Summary
AbstractRenderableModelObject(String id, ModelPersisterInfo info, org.dom4j.Document document)
          Constructs a new model object
 
Method Summary
 String getProcessorId()
          Gets the default 'view' processor id
 String getProcessorId(RenderMode mode)
          Gets the processor id
 Map<String,String> getProcessorProperties()
          Gets a map of default 'view' processor properties
 Map<String,String> getProcessorProperties(RenderMode renderMode)
          Gets a map of processor properties for the given mode
 String getProcessorProperty(RenderMode mode, String propertyName)
          Gets a processor property
 String getProcessorProperty(String propertyName)
          Gets a default 'view' processor property
 RenderMode[] getRenderModes()
          The list of defined render modes
 void removeProcessor()
          Removes the default processor
 void removeProcessor(RenderMode renderMode)
          Removes the processor for the given render mode
 void setProcessorProperty(RenderMode renderMode, String propertyName, String propertyValue)
          Sets a processor property for a given render mode
 void setProcessorProperty(String propertyName, String propertyValue)
          Sets a property on the default 'view' processor
 
Methods inherited from class org.springframework.extensions.surf.types.AbstractModelObject
addResource, addResource, getBooleanProperty, getCustomProperties, getCustomProperty, getDescription, getDescriptionId, getDocument, getId, getKey, getModelProperties, getModelProperty, getModelVersion, getModificationTime, getPersisterId, getProperties, getProperty, getResource, getResourceContainer, getResources, getResourcesMap, getStoragePath, getTitle, getTitleId, getTypeId, isCustomProperty, isModelProperty, isSaved, removeCustomProperty, removeModelProperty, removeProperty, removeResource, setCustomProperty, setDescription, setDescriptionId, setId, setModelProperty, setModificationTime, setProperty, setTitle, setTitleId, toString, touch, toXML, updateResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_PROCESSOR

public static String PROP_PROCESSOR

ATTR_RENDER_MODE

public static String ATTR_RENDER_MODE
Constructor Detail

AbstractRenderableModelObject

public AbstractRenderableModelObject(String id,
                                     ModelPersisterInfo info,
                                     org.dom4j.Document document)
Constructs a new model object

Parameters:
document - the document
Method Detail

getProcessorId

public String getProcessorId()
Description copied from interface: Renderable
Gets the default 'view' processor id

Specified by:
getProcessorId in interface Renderable
Returns:
the processor id

getProcessorId

public String getProcessorId(RenderMode mode)
Description copied from interface: Renderable
Gets the processor id

Specified by:
getProcessorId in interface Renderable
Returns:
the processor id

getProcessorProperty

public String getProcessorProperty(String propertyName)
Description copied from interface: Renderable
Gets a default 'view' processor property

Specified by:
getProcessorProperty in interface Renderable
Returns:
the processor property value

getProcessorProperty

public String getProcessorProperty(RenderMode mode,
                                   String propertyName)
Description copied from interface: Renderable
Gets a processor property

Specified by:
getProcessorProperty in interface Renderable
Returns:
the processor property value

getProcessorProperties

public Map<String,String> getProcessorProperties()
Description copied from interface: Renderable
Gets a map of default 'view' processor properties

Specified by:
getProcessorProperties in interface Renderable
Returns:
the map

getProcessorProperties

public Map<String,String> getProcessorProperties(RenderMode renderMode)
Description copied from interface: Renderable
Gets a map of processor properties for the given mode

Specified by:
getProcessorProperties in interface Renderable
Parameters:
renderMode - the render mode
Returns:
the map

setProcessorProperty

public void setProcessorProperty(String propertyName,
                                 String propertyValue)
Description copied from interface: Renderable
Sets a property on the default 'view' processor

Specified by:
setProcessorProperty in interface Renderable

setProcessorProperty

public void setProcessorProperty(RenderMode renderMode,
                                 String propertyName,
                                 String propertyValue)
Description copied from interface: Renderable
Sets a processor property for a given render mode

Specified by:
setProcessorProperty in interface Renderable
Parameters:
renderMode - the render mode

removeProcessor

public void removeProcessor()
Description copied from interface: Renderable
Removes the default processor

Specified by:
removeProcessor in interface Renderable

removeProcessor

public void removeProcessor(RenderMode renderMode)
Description copied from interface: Renderable
Removes the processor for the given render mode

Specified by:
removeProcessor in interface Renderable
Parameters:
renderMode - the renderer mode

getRenderModes

public RenderMode[] getRenderModes()
Description copied from interface: Renderable
The list of defined render modes

Specified by:
getRenderModes in interface Renderable
Returns:
an array of render modes


Copyright © 2009 SpringSource, Inc. All Rights Reserved.