org.progeeks.meta.xml
Class LongStringXmlRenderer

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

public class LongStringXmlRenderer
extends AbstractXmlPropertyRenderer

Renders long strings as nested elements instead of attributes.

Version:
$Revision: 1.7 $
Author:
Paul Speed

Constructor Summary
LongStringXmlRenderer()
           
LongStringXmlRenderer(boolean useDataBlock)
           
 
Method Summary
 boolean getUseDataBlock()
          Returns true if this renderer will wrap all strings in a CDATA section (startDataBlock), false otherwise.
 void render(java.lang.Object value, PropertyType type, boolean forceWrap, XmlRenderContext context)
          Renders the specified Mutator's value to the specified writer.
 void setUseDataBlock(boolean f)
          Set to true if the strings should be wrapped in CDATA delimiters, false to treat it as straight text.
 
Methods inherited from class org.progeeks.meta.xml.AbstractXmlPropertyRenderer
canRenderAsAttribute, findEm, getAsAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongStringXmlRenderer

public LongStringXmlRenderer()

LongStringXmlRenderer

public LongStringXmlRenderer(boolean useDataBlock)
Method Detail

setUseDataBlock

public void setUseDataBlock(boolean f)
Set to true if the strings should be wrapped in CDATA delimiters, false to treat it as straight text. Defaults to true if not set.


getUseDataBlock

public boolean getUseDataBlock()
Returns true if this renderer will wrap all strings in a CDATA section (startDataBlock), false otherwise. Defaults to true if not set.


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
Specified by:
render in class AbstractXmlPropertyRenderer
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.