org.zkoss.zk.ui.sys
Class XmlContentRenderer

java.lang.Object
  extended by org.zkoss.zk.ui.sys.XmlContentRenderer
All Implemented Interfaces:
ContentRenderer

public class XmlContentRenderer
extends java.lang.Object
implements ContentRenderer

An implementation of ContentRenderer that renders the content as a Xml attribute (i.e., name="value").

Since:
5.0.0
Author:
tomyeh

Constructor Summary
XmlContentRenderer()
           
 
Method Summary
 java.lang.StringBuffer getBuffer()
          Returns the content being rendered.
 void render(java.lang.String name, boolean value)
          Renders a boolean property.
 void render(java.lang.String name, byte value)
          Renders a byte property.
 void render(java.lang.String name, char value)
          Renders a char property.
 void render(java.lang.String name, java.util.Date value)
          Renders a Date property.
 void render(java.lang.String name, double value)
          Renders a double property.
 void render(java.lang.String name, float value)
          Renders a float property.
 void render(java.lang.String name, int value)
          Renders a date property.
 void render(java.lang.String name, long value)
          Renders a long property.
 void render(java.lang.String name, java.lang.Object value)
          Renders an Object property.
 void render(java.lang.String name, short value)
          Renders a short property.
 void render(java.lang.String name, java.lang.String value)
          Renders a String property.
 void renderDirectly(java.lang.String name, java.lang.Object value)
          Renders the value by converting it to string.
 void renderWidgetAttributes(java.util.Map<java.lang.String,java.lang.String> attrs)
          Renders every entry in attrs by use of render(String, Object).
 void renderWidgetListeners(java.util.Map<java.lang.String,java.lang.String> listeners)
          Renders every entry in listeners by use of render(String, Object).
 void renderWidgetOverrides(java.util.Map<java.lang.String,java.lang.String> overrides)
          Renders every entry in overrides by use of render(String, Object).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlContentRenderer

public XmlContentRenderer()
Method Detail

getBuffer

public java.lang.StringBuffer getBuffer()
Returns the content being rendered.


render

public void render(java.lang.String name,
                   java.lang.String value)
Renders a String property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   java.util.Date value)
Renders a Date property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   java.lang.Object value)
Renders an Object property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   int value)
Renders a date property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   long value)
Renders a long property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   short value)
Renders a short property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   byte value)
Renders a byte property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   boolean value)
Renders a boolean property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal JavaScript variable name.

render

public void render(java.lang.String name,
                   double value)
Renders a double property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   float value)
Renders a float property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

render

public void render(java.lang.String name,
                   char value)
Renders a char property.

Specified by:
render in interface ContentRenderer
Parameters:
name - the property name. Note: it must be a legal XML attribute name.

renderDirectly

public void renderDirectly(java.lang.String name,
                           java.lang.Object value)
Renders the value by converting it to string.

Specified by:
renderDirectly in interface ContentRenderer

renderWidgetListeners

public void renderWidgetListeners(java.util.Map<java.lang.String,java.lang.String> listeners)
Renders every entry in listeners by use of render(String, Object).

Specified by:
renderWidgetListeners in interface ContentRenderer
Parameters:
listeners - the map of listeners to register at the peer widget. The key is the event name (such as onClick), and the value the code snippet (such as this.getFellow('inf').setValue('new')). They are both String instances.

renderWidgetOverrides

public void renderWidgetOverrides(java.util.Map<java.lang.String,java.lang.String> overrides)
Renders every entry in overrides by use of render(String, Object).

Specified by:
renderWidgetOverrides in interface ContentRenderer
Parameters:
overrides - the map of methods or properties to override the peer widget. The key is the method name (such as setValue), and the value must be a valid JavaScript snippet that can be evaluated to a value. They are both instances of String. For example, the map will be generated as follows by JsContentRenderer:
{name1: value1, name2: value2}.

renderWidgetAttributes

public void renderWidgetAttributes(java.util.Map<java.lang.String,java.lang.String> attrs)
Renders every entry in attrs by use of render(String, Object).

Specified by:
renderWidgetAttributes in interface ContentRenderer
Parameters:
attrs - the map of attributes. The key is the attribute's name, while the value is the attribute's value. They are both instances of String.
Since:
5.0.3


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo