/** * {@inheritDoc} * @see grails.validation.Constraint#setOwningClass(java.lang.Class) */ @SuppressWarnings("rawtypes") public void setOwningClass(Class constraintOwningClass) { this.constraintOwningClass = constraintOwningClass; classShortName = GrailsNameUtils.getPropertyNameRepresentation(constraintOwningClass); }
/** * Shorter version of getPropertyNameRepresentation. * @param clazz The clazz to convert * @return The property name version */ public static String getPropertyName(Class<?> clazz) { return getPropertyNameRepresentation(clazz); }
/** * Shorter version of getPropertyNameRepresentation. * @param name The name to convert * @return The property name version */ public static String getPropertyName(String name) { return getPropertyNameRepresentation(name); }
public String getTypePropertyName() { return GrailsNameUtils.getPropertyNameRepresentation(type); }
/** * Returns the property name equivalent for the specified class. * * @param targetClass The class to get the property name for * @return A property name reperesentation of the class name (eg. MyClass becomes myClass) */ public static String getPropertyNameRepresentation(Class<?> targetClass) { return getPropertyNameRepresentation(getShortName(targetClass)); }