org.progeeks.meta.xml
Class AbstractXmlPropertyRenderer

java.lang.Object
  extended by org.progeeks.meta.xml.AbstractXmlPropertyRenderer
All Implemented Interfaces:
XmlPropertyRenderer
Direct Known Subclasses:
ClassPropertyTypeXmlRenderer, ContainerXmlRenderer, DefaultXmlPropertyRenderer, LongStringXmlRenderer, MapXmlRenderer, ReferenceXmlRenderer, Repository.ListPropertyTypeRenderer, Repository.MetaClassPropertyTypeRenderer, Repository.PropertyInfoRenderer, XmlMetaObjectRenderer

public abstract class AbstractXmlPropertyRenderer
extends java.lang.Object
implements XmlPropertyRenderer

Base class implementation for the XmlPropertyRenderer interface.

Version:
$Revision: 1.1 $
Author:
Paul Speed

Constructor Summary
AbstractXmlPropertyRenderer()
           
 
Method Summary
 boolean canRenderAsAttribute(java.lang.Object value, PropertyType type)
          Returns true if the property value can be rendered as an attribute.
 void findEm()
           
 java.lang.String getAsAttribute(java.lang.Object value, PropertyType type, XmlRenderContext context)
          Returns the string representation of the specified object as an attribute.
abstract  void render(java.lang.Object value, PropertyType type, boolean forceWrap, XmlRenderContext context)
          Renders the specified value to the session defined by the render context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXmlPropertyRenderer

public AbstractXmlPropertyRenderer()
Method Detail

canRenderAsAttribute

public boolean canRenderAsAttribute(java.lang.Object value,
                                    PropertyType type)
Returns true if the property value can be rendered as an attribute. Default implementation always returns false.

Specified by:
canRenderAsAttribute in interface XmlPropertyRenderer

findEm

public void findEm()

getAsAttribute

public java.lang.String getAsAttribute(java.lang.Object value,
                                       PropertyType type,
                                       XmlRenderContext context)
Returns the string representation of the specified object as an attribute. Default implementation throws an UnsupportedOperationException.

Specified by:
getAsAttribute in interface XmlPropertyRenderer

render

public abstract void render(java.lang.Object value,
                            PropertyType type,
                            boolean forceWrap,
                            XmlRenderContext context)
Renders the specified value to the session defined by the render context.

Specified by:
render in interface XmlPropertyRenderer
Parameters:
value - The value to be rendered.
type - The specific type that was used to lookup this renderer.
forceWrap - Set to true if the renderer should wrap the value in its own style of start/end tags. False indicates that the renderer can optionally leave them out. This is usually used by renderers that support types that can be defined as strings directly.
context - Contains the rendering output information for this session.


Copyright © 2002-2003 Paul Speed. All Rights Reserved.