I am trying to dynamically populate the static constraint ={} at run time. Is there a way to do this. Example code:
Normal statement:
static constraint = { lastName(blank:false, maxSize: 100) }
What I am trying to do:
static constraint = {
call to an XMLSlurper that returns a HashMap of lastName as a key and (blank: false, maxSize: 100) as a value. // This part works.
have the HashMap executed as if it where hard coded information to validate the fields. //This part does not work.
} I hope this explains my problem well enough.