title: Groovy: how to get properties declared in base class
body: <p>In the following code, I need all the properties available in <code>Child</code> class (i.e. <code>foo, bar</code>). I am not interested in all other properties added by groovy.</p>
  
  <pre><code>class Parent {def foo}
  class Child extends Parent {def bar}
  </code></pre>
  
  <p>So far none of these gets the result:</p>
  
  <pre><code>println Child.fields
  println Child.properties.each{k,v-&gt;println "$k -&gt; $v"}
  println Child.declaredFields.findAll { !it.synthetic }.collect {it.name}
  println Child.methods.findAll {it.name.startsWith("get")}.collect {it.name}
  </code></pre>
  
  <p>I am trying to find out some direct method which would give me this.</p>