All Downloads are FREE. Search and download functionalities are using the official Maven repository.

grails.plugin.json.view.api.jsonapi.DefaultJsonApiIdRenderer.groovy Maven / Gradle / Ivy

Go to download

Provides additional view technologies to the Grails framework, including JSON and Markup views.

The newest version!
package grails.plugin.json.view.api.jsonapi

import groovy.transform.CompileStatic
import org.grails.datastore.mapping.model.PersistentProperty

@CompileStatic
class DefaultJsonApiIdRenderer implements JsonApiIdRenderStrategy {

    @Override
    Object render(Object object, PersistentProperty property) {
        final String propertyName = property.name
        if (object && object.hasProperty(propertyName)) {
            return object.getAt(propertyName).toString()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy