class CategorizedString extends CategorizedLegend<String> {

    public void setParameter(StringParameter param) {
        if(param instanceof StringLiteral){
            parameter = param;
            fireTypeChanged();
        } else if(param instanceof Categorize2String){
            RealParameter rp = ((Categorize2String) param).getLookupValue();
            if(rp instanceof RealAttribute){
                parameter = param;
                field = ((RealAttribute) rp).getColumnName();
                fireTypeChanged();
            } else {
                throw new IllegalArgumentException("The given StringParameter instance can't be recognized as a " +
                            "valid CategorizedString.");
            }
        } else {
                throw new IllegalArgumentException("The given StringParameter instance can't be recognized as a " +
                            "valid CategorizedString.");
        }
    }

    public  CategorizedString(StringParameter sp);

}