Safe cast to geotools expression, will return null if not possible.