Bug 127861 [DataBinding] Mark API provisional
examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/model/PhoneConverter.java
public Object convertTargetToModel(Object targetObject) {
		
		return removeFormatting((String)targetObject);
	}
	public Object convertModelToTarget(Object modelObject) {
		String unformattedPhone = (String)modelObject;
		if(unformattedPhone == null || unformattedPhone.length() != 10){
			return unformattedPhone;
		} else {
			StringBuffer sb = new StringBuffer(13);
			sb.append(unformattedPhone.substring(0,3));
			sb.append('-');
			sb.append(unformattedPhone.subSequence(3,6));
			sb.append('-');
			sb.append(unformattedPhone.subSequence(6,10));
			return sb.toString();
		}
	}
	static String removeFormatting(String formattedPhone){
		StringBuffer sb = new StringBuffer(9);
		for (int i = 0; i < formattedPhone.length(); i++) {
			char c = formattedPhone.charAt(i);
			if('0' <= c && '9' >= c){
				sb.append(c);
			}
		}
		return sb.toString();		
	}
}