def getProperty()

in plugin-ui/plugin/grails-app/services/grails/plugin/springsecurity/ui/SpringSecurityUiService.groovy [506:542]


	def getProperty(instance, String paramName) {
		if (!instance) return

		if (paramName.endsWith('.id')) {
			paramName = paramName[0..-4]
		}

		def value = instance
		String currentPath = ''
		for (String paramNamePart in paramName.split('\\.')) {
			currentPath += paramNamePart

			String classPropertyName = GrailsNameUtils.getPropertyName(
				unproxy(value.getClass()).name)

			String propertyName = uiPropertiesStrategy.paramNameToPropertyName(
				paramNamePart, classPropertyName)

			try {
				if (instance.metaClass.getMetaProperty(propertyName)?.getter) {
					value = value[propertyName]
					if (value == null) return
				}
				else {
					log.error 'Attempted to read non-existent property {} in {}', currentPath as String, instance as String
					return
				}
			}
			catch (e) {
				throw new InvalidValueException(propertyName, paramNamePart, value, e)
			}

			currentPath += '.'
		}

		value
	}