7 messages in org.codehaus.groovy.userRe: [groovy-user] ordered bean proper...
FromSent OnAttachments
David Durham, Jr.Oct 8, 2008 1:27 pm 
Guillaume LaforgeOct 8, 2008 1:39 pm 
Guillaume LaforgeOct 8, 2008 2:09 pm 
David Durham, Jr.Oct 8, 2008 4:32 pm 
Jose NohedaOct 9, 2008 12:16 am 
David Durham, Jr.Oct 9, 2008 7:38 am 
Guillaume LaforgeOct 9, 2008 7:42 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [groovy-user] ordered bean propertiesActions...
From:Guillaume Laforge (glaf@gmail.com)
Date:Oct 8, 2008 1:39:00 pm
List:org.codehaus.groovy.user

There are ways to get the list of properties, for instance with Customer.metaClass.properties, but it's not necessarily in order. Then, there may be a way to visit the AST to visit the properties in order, but it's a bit more complicated, and you need to have the source code of your classes available. Out of curiosity, what do you need to find properties with their order?

On Wed, Oct 8, 2008 at 10:28 PM, David Durham, Jr. <davi@gmail.com> wrote:

Hi all,

I've got a bean with properties like so:

class Customer extends Model { def name def phone def address1 def address2 }

And I'd like to retrieve them in the order they are declared in with something like this:

properties.each { property -> it}

Is there a known easy way to do this?