I am working with Spring Roo for a web project.

I am implementing a Clothes management system that tracks sizes. Because there are different ways of measuring size: Small-Medium-Large, 00-0-2-4-6, Petite-Small Petite-etc, I decided to create an Abstract SizeType class.

Java Code:
public abstract class SizeType {

    private String noteCode;

    private Date dateCreated;
}
I then have subclasses extend it with their own measurement fields. For example, the small medium large type looks like this:

Java Code:
public class SizeSML extends SizeType {

    private SizeRange sizeS;

    private SizeRange sizeM;

    private SizeRange sizeL;
}
The Size Range is a class that just holds a couple of floats for expressing a range:

Java Code:
public class SizeRange {

    @NotNull
    private Float minVal;

    private Float maxVal;
}
The problem I am now getting into is creating the JSP interface for populating this object. The SizeChart class contains the SizeType and that is the entry point.

My JSP populates all of the SizeChart fields, accesses the SizeType field... and then what? I was originally trying using getClass() on the instance to find out what type of size chart, then using getFields to find out which SizeRange variables were there, but it is just turning into a big mess.

I want some way to enforce the integrity of the chart without hard-coding the values into the JSP. If I create extra subclasses of SizeType I'd like this uniform JSP to be able to populate a form for entering the measurements in dynamically.

Is Abstract the wrong way to go here? Should I instead create an Interface that provides an Iterator across the different data types maybe?

Any thoughts are appreciated.