package com.mathworks;

import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;

public class PatientDataBeanInfo extends SimpleBeanInfo
{
    @Override
    public PropertyDescriptor[] getPropertyDescriptors()
    {
        PropertyDescriptor[] props = new  PropertyDescriptor[7];
        try
        {
            //MATLAB expects property names with first letter capitalized. Since the property names are camel cased automatically,
			//we do need to explicitly specify the accessor names.

            props[0] = new PropertyDescriptor("Age",PatientData.class,
                    "getAge","setAge");
            props[1] = new PropertyDescriptor("Diastolic",PatientData.class,
                    "getDiastolic","setDiastolic");
            props[2] = new PropertyDescriptor("Gender",PatientData.class,
                    "getGender","setGender");
            props[3] = new PropertyDescriptor("Height",PatientData.class,
                    "getHeight","setHeight");
            props[4] = new PropertyDescriptor("SelfAssessedHealthStatus",PatientData.class,
                    "getSelfAssessedHealthStatus","setSelfAssessedHealthStatus");
            props[5] = new PropertyDescriptor("Systolic",PatientData.class,
                    "getSystolic","setSystolic");
            props[6] = new PropertyDescriptor("Weight",PatientData.class,
                    "getWeight","setWeight");

            return props;
        }
        catch (IntrospectionException e)
        {
            e.printStackTrace();
        }

        return null;
    }
}
