Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] DSL - propertyMissing question

Martin McFly

2010-03-05


Author LoginPost Reply

Hi,

i try to explain my problem:

I have a dsl like

something {
active = true
}

I have also a InterpretationScript (extends Script) with

def validation = new ActiveValidation()
def something(Closure c) {
c.delegate = validation
c.resolveStrategy = Closure.DELEGATE_ONLY
c()
}

How (or is it at all) is it possible to store in the ActiveValidation class
the information active = true

The words used are arbitrary, so I dont know which words will be used.

Running this results in:

Caused by: groovy.lang.MissingPropertyException: No such property: active
for class:

also when I define

def propertyMissing(String name) {
 name
}

Is it in general possible to have such dsl structure ? and if, how do I
store a) the variable name 'active' and b) and its value 'true' ?

Thanks
--
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.