code: public static void assertIdentifier( String id) throws IllegalArgumentException
      {
      if( !isIdentifier( id))
        {
        throw
          new IllegalArgumentException
          ( (id==null? "null" : ("\"" + String.valueOf( id) + "\""))
            + " is not a valid identifier");
        }
      }
docs: Throws an exception if the given string is not a valid identifier.