if ("badvalue".equals (pText)) { throw new IllegalArgumentException ("Bad value " + pText); } else { setValue (new Bean2 (pText)); }