org.progeeks.meta.xml
Interface XmlPropertyRenderer

All Known Implementing Classes:
AbstractXmlPropertyRenderer, ClassPropertyTypeXmlRenderer, ContainerXmlRenderer, DefaultXmlPropertyRenderer, GraphXmlRenderer, ListXmlPropertyRenderer, LongStringXmlRenderer, MapXmlRenderer, ReferenceXmlRenderer, Repository.ListPropertyTypeRenderer, Repository.MetaClassPropertyTypeRenderer, Repository.PropertyInfoRenderer, StringXmlPropertyRenderer, XmlMetaObjectRenderer

public interface XmlPropertyRenderer

Renders a single XML property

Version:
$Revision: 1.5 $
Author:
Paul Speed

Method Summary
 boolean canRenderAsAttribute(java.lang.Object value, PropertyType type)
          Returns true if the property value can be rendered as an attribute.
 java.lang.String getAsAttribute(java.lang.Object value, PropertyType type, XmlRenderContext context)
          Returns the string representation of the specified object as an attribute.
 void render(java.lang.Object value, PropertyType type, boolean forceWrap, XmlRenderContext context)
          Renders the specified value to the session defined by the render context.
 

Method Detail

canRenderAsAttribute

boolean canRenderAsAttribute(java.lang.Object value,
                             PropertyType type)
Returns true if the property value can be rendered as an attribute.


getAsAttribute

java.lang.String getAsAttribute(java.lang.Object value,
                                PropertyType type,
                                XmlRenderContext context)
Returns the string representation of the specified object as an attribute. This can be used instead of render() when the value can be represented as an XML attribute value.


render

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

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.