package util.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
//import inputNumberSpinner.*;

import util.data.Data;

public class inputNumberSpinnerConverter implements Converter {

	public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
		String [] str = arg2.split(":");
		System.out.println("str:" + str[0]);
		return new Data(Integer.parseInt(str[0]));
		
	}

	public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
		String s = (String)arg2;
		Integer val = Integer.parseInt(s);
		System.out.println("data:" + val);
		//InputNumberSpinner spinner = new InputNumberSpinner();
		return val.toString();		
	}

}
