Groovy Documentation

grails.converters
[Java] Class XML

java.lang.Object
  org.codehaus.groovy.grails.web.converters.AbstractConverter
      grails.converters.XML
All Implemented Interfaces:
Converter

public class XML
extends AbstractConverter

A converter that converts domain classes to XML.

Authors:
Siegfried Puchbauer
Graeme Rocher


Nested Class Summary
class XML.Builder

 
Field Summary
static org.apache.commons.logging.Log log

 
Constructor Summary
XML()

XML(java.lang.Object target)

 
Method Summary
XML attribute(java.lang.String name, java.lang.String value)

void build(groovy.lang.Closure c)

XML chars(java.lang.String chars)

void convertAnother(java.lang.Object o)

static void createNamedConfig(java.lang.String name, groovy.lang.Closure callable)

XML end()

int getDepth()

java.lang.String getElementName(java.lang.Object o)

static ConverterConfiguration getNamedConfig(java.lang.String configName)

StreamingMarkupWriter getStream()

XMLStreamWriter getWriter()

protected void handleCircularRelationship(java.lang.Object o)

protected ConverterConfiguration initConfig()

ObjectMarshaller lookupObjectMarshaller(java.lang.Object target)

static java.lang.Object parse(java.lang.String source)

Parses the given XML

static java.lang.Object parse(java.io.InputStream is, java.lang.String encoding)

Parses the given XML

static java.lang.Object parse(javax.servlet.http.HttpServletRequest request)

Parses the give XML (read from the POST Body of the Request)

static void registerObjectMarshaller(java.lang.Class clazz, groovy.lang.Closure callable)

static void registerObjectMarshaller(java.lang.Class clazz, int priority, groovy.lang.Closure callable)

static void registerObjectMarshaller(ObjectMarshaller om)

static void registerObjectMarshaller(ObjectMarshaller om, int priority)

void render(java.io.Writer out)

void render(javax.servlet.http.HttpServletResponse response)

void setTarget(java.lang.Object target)

XML startNode(java.lang.String tagName)

java.lang.String toString()

static java.lang.Object use(java.lang.String configName, groovy.lang.Closure callable)

static void use(java.lang.String cfgName)

static void withDefaultConfiguration(groovy.lang.Closure callable)

 
Methods inherited from class AbstractConverter
createBeanWrapper, setTarget, toString
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

log

public static final org.apache.commons.logging.Log log


 
Constructor Detail

XML

public XML()


XML

public XML(java.lang.Object target)


 
Method Detail

attribute

public XML attribute(java.lang.String name, java.lang.String value)


build

public void build(@SuppressWarnings("rawtypes") groovy.lang.Closure c)


chars

public XML chars(java.lang.String chars)


convertAnother

public void convertAnother(java.lang.Object o)


createNamedConfig

public static void createNamedConfig(java.lang.String name, groovy.lang.Closure callable)


end

public XML end()


getDepth

public int getDepth()


getElementName

public java.lang.String getElementName(java.lang.Object o)


getNamedConfig

public static ConverterConfiguration getNamedConfig(java.lang.String configName)


getStream

public StreamingMarkupWriter getStream()


getWriter

public XMLStreamWriter getWriter()


handleCircularRelationship

@SuppressWarnings("incomplete-switch")
protected void handleCircularRelationship(java.lang.Object o)


initConfig

protected ConverterConfiguration initConfig()


lookupObjectMarshaller

public ObjectMarshaller lookupObjectMarshaller(@SuppressWarnings("hiding") java.lang.Object target)


parse

public static java.lang.Object parse(java.lang.String source)
Parses the given XML
throws:
ConverterException
Parameters:
source - a String containing some XML
Returns:
a groovy.util.XmlSlurper


parse

public static java.lang.Object parse(java.io.InputStream is, java.lang.String encoding)
Parses the given XML
throws:
ConverterException
Parameters:
is - an InputStream to read from
encoding - the Character Encoding to use
Returns:
a groovy.util.XmlSlurper


parse

public static java.lang.Object parse(javax.servlet.http.HttpServletRequest request)
Parses the give XML (read from the POST Body of the Request)
throws:
ConverterException
Parameters:
request - an HttpServletRequest
Returns:
a groovy.util.XmlSlurper


registerObjectMarshaller

public static void registerObjectMarshaller(java.lang.Class clazz, groovy.lang.Closure callable)


registerObjectMarshaller

public static void registerObjectMarshaller(java.lang.Class clazz, int priority, groovy.lang.Closure callable)


registerObjectMarshaller

public static void registerObjectMarshaller(ObjectMarshaller om)


registerObjectMarshaller

public static void registerObjectMarshaller(ObjectMarshaller om, int priority)


render

public void render(java.io.Writer out)


render

public void render(javax.servlet.http.HttpServletResponse response)


setTarget

@Override
public void setTarget(java.lang.Object target)


startNode

public XML startNode(java.lang.String tagName)


toString

@Override
public java.lang.String toString()


use

public static java.lang.Object use(java.lang.String configName, groovy.lang.Closure callable)


use

public static void use(java.lang.String cfgName)


withDefaultConfiguration

public static void withDefaultConfiguration(groovy.lang.Closure callable)


 

Groovy Documentation