org.progeeks.meta.xml
Class StringXmlPropertyRenderer

java.lang.Object
  extended by org.progeeks.meta.xml.AbstractXmlPropertyRenderer
      extended by org.progeeks.meta.xml.DefaultXmlPropertyRenderer
          extended by org.progeeks.meta.xml.StringXmlPropertyRenderer
All Implemented Interfaces:
XmlPropertyRenderer

public class StringXmlPropertyRenderer
extends DefaultXmlPropertyRenderer

Renders a single String XML property.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Constructor Summary
StringXmlPropertyRenderer()
           
 
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 Mutator's value to the specified writer.
 
Methods inherited from class org.progeeks.meta.xml.DefaultXmlPropertyRenderer
getAlwaysWrap, setAlwaysWrap
 
Methods inherited from class org.progeeks.meta.xml.AbstractXmlPropertyRenderer
findEm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringXmlPropertyRenderer

public StringXmlPropertyRenderer()
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 true.

Specified by:
canRenderAsAttribute in interface XmlPropertyRenderer
Overrides:
canRenderAsAttribute in class DefaultXmlPropertyRenderer

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.

Specified by:
getAsAttribute in interface XmlPropertyRenderer
Overrides:
getAsAttribute in class DefaultXmlPropertyRenderer

render

public void render(java.lang.Object value,
                   PropertyType type,
                   boolean forceWrap,
                   XmlRenderContext context)
Renders the specified Mutator's value to the specified writer.

Specified by:
render in interface XmlPropertyRenderer
Overrides:
render in class DefaultXmlPropertyRenderer
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.