validate if a String value is of the attribute type