this will throw a ClassCastException if the user has an error in their rule. You need to explicitly check this case and handle it with a friendly error message.