Ah, like seltar, I initially misunderstood the question...
For what it is worth, I did something similar in a version of my (unpublished yet) fern drawing sketch: I made a generic code to draw ferns using trunk, branches, leaves, with variations on angles, lengths, colors.
The base drawing unit of my sketch is a line segment.
So, in a .java file, I defined an abstract class Segment, base class of Trunk, Branch, Leaf classes, each instance holding a Genotype reference.
Genotype is an interface (that's why I had to make a .java file, interfaces cannot be internal to a class).
interface Genotype
{
float GetBaseLength(Segment seg);
float GetLength(Segment seg);
float GetBaseWidth(Segment seg);
float GetWidth(Segment seg);
float GetAbsoluteAngle(Segment seg, boolean bIsLeft);
float GetAngle(Segment seg, boolean bIsLeft);
int GetBaseColor(Segment seg);
int GetColor(Segment seg);
boolean ShouldAddSegment(Segment seg);
}
Then I have a number of genotype .pde files, currently unimaginatively named Genotype01 to Genotype09, implementing Genotype, where I can make more or less convoluted variations on these parameters.
Advantage: no need for reflection, natural OO approach, .pde files act as script files (although you need Processing to add them and they have to be known by the final sketch).
Hope it will give you some ideas.