Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/validators/String2ByteValidator.java
/* (non-Javadoc)
	 * @see org.eclipse.jface.databinding.validator.IValidator#isPartiallyValid(java.lang.Object)
	 */
	public String isPartiallyValid(Object fragment) {
		if (((String)fragment).matches("\\-?[0-9]*")) 
            return null;
        return getHint();
	}
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.databinding.validator.IValidator#isValid(java.lang.Object)
     */
    public String isValid(Object value) {
        try {
            Byte.parseByte((String)value);
            return null;
        } catch (Throwable t) {
            return getHint();
        }
    }
	private String getHint() {
		return BindingMessages.getString("Validate_RangeStart") + Byte.MIN_VALUE +  
			BindingMessages.getString("and") + Byte.MAX_VALUE + "."; 
	}
}