org.codehaus.groovy.grails.web.converters.marshaller.json
Class DomainClassMarshaller
java.lang.Object
org.codehaus.groovy.grails.web.converters.marshaller.json.DomainClassMarshaller
- All Implemented Interfaces:
- ObjectMarshaller<JSON>
- Direct Known Subclasses:
- DeepDomainClassMarshaller
public class DomainClassMarshaller
- extends java.lang.Object
- implements ObjectMarshaller<JSON>
- Since:
- 1.1
|
Constructor Summary |
DomainClassMarshaller(boolean includeVersion,
org.codehaus.groovy.grails.commons.GrailsApplication application)
|
DomainClassMarshaller(boolean includeVersion,
org.codehaus.groovy.grails.support.proxy.ProxyHandler proxyHandler,
org.codehaus.groovy.grails.commons.GrailsApplication application)
|
|
Method Summary |
protected void |
asShortObject(java.lang.Object refObj,
JSON json,
org.codehaus.groovy.grails.commons.GrailsDomainClassProperty idProperty,
org.codehaus.groovy.grails.commons.GrailsDomainClass referencedDomainClass)
|
protected java.lang.Object |
extractValue(java.lang.Object domainObject,
org.codehaus.groovy.grails.commons.GrailsDomainClassProperty property)
|
boolean |
isIncludeVersion()
|
protected boolean |
isRenderDomainClassRelations()
|
void |
marshalObject(java.lang.Object value,
JSON json)
Performs the conversion |
void |
setIncludeVersion(boolean includeVersion)
|
boolean |
supports(java.lang.Object object)
Checks wheter the ObjectMarshaller is able/intended to support the given Object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DomainClassMarshaller
public DomainClassMarshaller(boolean includeVersion,
org.codehaus.groovy.grails.commons.GrailsApplication application)
DomainClassMarshaller
public DomainClassMarshaller(boolean includeVersion,
org.codehaus.groovy.grails.support.proxy.ProxyHandler proxyHandler,
org.codehaus.groovy.grails.commons.GrailsApplication application)
isIncludeVersion
public boolean isIncludeVersion()
setIncludeVersion
public void setIncludeVersion(boolean includeVersion)
supports
public boolean supports(java.lang.Object object)
- Description copied from interface:
ObjectMarshaller
- Checks wheter the ObjectMarshaller is able/intended to support the given Object
- Specified by:
supports in interface ObjectMarshaller<JSON>
- Parameters:
object - the object which is about getting converted
- Returns:
true if the marshaller can/should perform the marshalling, false otherwise
marshalObject
public void marshalObject(java.lang.Object value,
JSON json)
throws ConverterException
- Description copied from interface:
ObjectMarshaller
- Performs the conversion
- Specified by:
marshalObject in interface ObjectMarshaller<JSON>
- Parameters:
value - the object which is about getting convertedjson - the Converter to use
- Throws:
ConverterException - on failure
asShortObject
protected void asShortObject(java.lang.Object refObj,
JSON json,
org.codehaus.groovy.grails.commons.GrailsDomainClassProperty idProperty,
org.codehaus.groovy.grails.commons.GrailsDomainClass referencedDomainClass)
throws ConverterException
- Throws:
ConverterException
extractValue
protected java.lang.Object extractValue(java.lang.Object domainObject,
org.codehaus.groovy.grails.commons.GrailsDomainClassProperty property)
isRenderDomainClassRelations
protected boolean isRenderDomainClassRelations()