
org.grails.scaffolding.model.property.DomainPropertyFactoryImpl.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fields Show documentation
Show all versions of fields Show documentation
Fields integration for Grails
The newest version!
package org.grails.scaffolding.model.property
import groovy.transform.CompileStatic
import org.grails.datastore.mapping.model.MappingContext
import org.grails.datastore.mapping.model.PersistentProperty
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
/**
* @see {@link DomainPropertyFactory}
* @author James Kleeh
*/
@CompileStatic
class DomainPropertyFactoryImpl implements DomainPropertyFactory {
@Value('${grails.databinding.convertEmptyStringsToNull:true}')
Boolean convertEmptyStringsToNull
@Value('${grails.databinding.trimStrings:true}')
Boolean trimStrings
@Autowired
MappingContext grailsDomainClassMappingContext
DomainProperty build(PersistentProperty persistentProperty) {
DomainPropertyImpl domainProperty = new DomainPropertyImpl(persistentProperty, grailsDomainClassMappingContext)
init(domainProperty)
domainProperty
}
DomainProperty build(PersistentProperty rootProperty, PersistentProperty persistentProperty) {
DomainPropertyImpl domainProperty = new DomainPropertyImpl(rootProperty, persistentProperty, grailsDomainClassMappingContext)
init(domainProperty)
domainProperty
}
private init(DomainPropertyImpl domainProperty) {
domainProperty.convertEmptyStringsToNull = convertEmptyStringsToNull
domainProperty.trimStrings = trimStrings
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy