org.mentawai.ajax.renderer
Class MapAjaxRenderer
java.lang.Object
org.mentawai.ajax.renderer.MapAjaxRenderer
- All Implemented Interfaces:
- AjaxRenderer
public class MapAjaxRenderer
- extends Object
- implements AjaxRenderer
A AjaxRender that gets map from the action`s output
and creates a XML structure with the contents of this
map.
For example, a Map with this content:
| key | value |
| akey | avalue |
| yetAnotherKey | yetAnotherValue |
Would create the folowing XML structure:
<map>
<entry key="akey">avalue</entry>
<entry key="yetAnotherKey">yetAnotherValue</entry>
</map>
The tag names ("map" & "entry") may be changed.
Then you can use your favorite JavaScript parser (or use your own)
to parse the generated XML strucure and interact it in your code.
- Author:
- Rubem Azenha (rubem.azenha@gmail.com), Fernando Boaglio - update to jdom 1.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FATHER
public static final String FATHER
- See Also:
- Constant Field Values
CHILD
public static final String CHILD
- See Also:
- Constant Field Values
KEY
public static final String KEY
- See Also:
- Constant Field Values
MapAjaxRenderer
public MapAjaxRenderer(String root,
String child,
String key)
MapAjaxRenderer
public MapAjaxRenderer()
encode
public String encode(Object obj,
Locale loc,
boolean pretty)
throws Exception
- Specified by:
encode in interface AjaxRenderer
- Throws:
Exception
getContentType
public String getContentType()
- Specified by:
getContentType in interface AjaxRenderer
getCharset
public String getCharset()
- Specified by:
getCharset in interface AjaxRenderer
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2012. All Rights Reserved.