org.zkoss.zk.ui.sys
Interface ContentRenderer

All Known Implementing Classes:
JsContentRenderer, XmlContentRenderer

public interface ContentRenderer

Used with AbstractComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer) to generate the component content that will be sent to the client.

Since:
5.0.0
Author:
tomyeh

Method Summary
 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 an integer 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 arbitrary 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 directly without encapsulation or conversion.
 void renderWidgetListeners(java.util.Map listeners)
          Renders the client code snippet for event listeners registered for the peer widget.
 void renderWidgetOverrides(java.util.Map values)
          Renders the client code snippet to override the methods and values of the peer widget.
 

Method Detail

render

void render(java.lang.String name,
            java.lang.String value)
            throws java.io.IOException
Renders a string property.

Throws:
java.io.IOException

render

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

Throws:
java.io.IOException

render

void render(java.lang.String name,
            java.lang.Object value)
            throws java.io.IOException
Renders an arbitrary object property. What type of suppoted objects depends on the implementation. However, the following types are always supported: null, String, Date, the wrapper of primitives, an array of the above types, and a map of the above types.

If the object is an instance of JSONAware, JSONAware.toJSONString() will be called to convert the value to a string. Otherwise, Object.toString() will be called. It the client's job to convert the string back to the correct object.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            int value)
            throws java.io.IOException
Renders an integer property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            short value)
            throws java.io.IOException
Renders a short property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            long value)
            throws java.io.IOException
Renders a long property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            byte value)
            throws java.io.IOException
Renders a byte property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            boolean value)
            throws java.io.IOException
Renders a boolean property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            double value)
            throws java.io.IOException
Renders a double property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            float value)
            throws java.io.IOException
Renders a float property.

Throws:
java.io.IOException

render

void render(java.lang.String name,
            char value)
            throws java.io.IOException
Renders a char property.

Throws:
java.io.IOException

renderDirectly

void renderDirectly(java.lang.String name,
                    java.lang.Object value)
Renders the value directly without encapsulation or conversion. It depends on the implementation. For JsContentRenderer, value must be a valid JavaScript snippet.


renderWidgetListeners

void renderWidgetListeners(java.util.Map listeners)
Renders the client code snippet for event listeners registered for the peer widget.

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

void renderWidgetOverrides(java.util.Map values)
Renders the client code snippet to override the methods and values of the peer widget.

Parameters:
values - the map of methods or values 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. In fact, the map will be generated as: {name1: value1, name2: value2}.


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