public String getElementName(Object o) { return GrailsNameUtils.getPropertyName(unwrap(o).getClass().getName()); } }
/** * Converts foo-bar into fooBar. * * @param name The lower case hyphen separated name * @return The property name equivalent */ public static String getPropertyNameForLowerCaseHyphenSeparatedName(String name) { return getPropertyName(getClassNameForLowerCaseHyphenSeparatedName(name)); }
Class<?> type = object.getClass(); if (type.isArray()) { return getPropertyName(type.getComponentType()) + suffix + "Array"; return getPropertyName(first.getClass()) + suffix + "List"; return getPropertyName(first.getClass()) + suffix + "Set"; return getPropertyName(first.getClass()) + suffix + "Collection"; return getPropertyName(entry.getClass()) + suffix + "Map"; return getPropertyName(object.getClass()) + suffix;
public static String getLogicalPropertyName(String className, String trailingName) { if (!isBlank(className) && !isBlank(trailingName)) { if (className.length() == trailingName.length() + 1 && className.endsWith(trailingName)) { return className.substring(0, 1).toLowerCase(); } } return getLogicalName(getPropertyName(className), trailingName); }
public String getElementName(Object o) { ObjectMarshaller<XML> om = config.getMarshaller(o); if (om instanceof NameAwareMarshaller) { return ((NameAwareMarshaller) om).getElementName(o); } final ProxyHandler proxyHandler = config.getProxyHandler(); if (proxyHandler.isProxy(o) && (proxyHandler instanceof EntityProxyHandler)) { EntityProxyHandler entityProxyHandler = (EntityProxyHandler) proxyHandler; final Class<?> cls = entityProxyHandler.getProxiedClass(o); return GrailsNameUtils.getPropertyName(cls); } return GrailsNameUtils.getPropertyName(o.getClass()); }
Object it = iterator.next(); if (key == null && GrailsStringUtils.isBlank(var) && it != null) { key = GrailsNameUtils.getPropertyName(it.getClass());
final String classAsPropertyName = GrailsNameUtils.getPropertyName(constrainedClass);
boolean shouldApplyPluginPrefix = false; if (!shortName.toLowerCase().startsWith(pluginName.toLowerCase())) { final String pluginSpecificConfigProperty = "grails.gorm." + GrailsNameUtils.getPropertyName(pluginName) + ".table.prefix.enabled"; final Map<String, Object> flatConfig = grailsApplication.getFlatConfig(); if (flatConfig.containsKey(pluginSpecificConfigProperty)) {
final ClassNode returnType = value.getReturnType(); final String restOfMethodName = methodName.substring(3); final String propertyName = GrailsNameUtils.getPropertyName(restOfMethodName);
final String fieldName = '$' + GrailsNameUtils.getPropertyName(mixinClassNode.getName());
protected MethodNode addClassUnderTestMethod(ClassNode classNode, ClassExpression targetClass, String type) { String fieldName = GrailsNameUtils.getPropertyName(type); String getterName = GrailsNameUtils.getGetterName(fieldName); fieldName = '$' +fieldName;