code: @Override
      public final void pcdata(String text) throws IllegalStateException, IllegalArgumentException, InvalidXMLException, IOException {
  
          // Check state
          if (_state != XMLEventListenerStates.START_TAG_OPEN && _state != XMLEventListenerStates.WITHIN_ELEMENT) {
              throw new IllegalStateException("getState() == " + _state);
  
              // Check arguments
          } else if (text == null) {
              throw new IllegalArgumentException("text == null");
          }
  
          // Temporarily set the state to ERROR_STATE. Unless an exception is
          // thrown in the write methods, it will be reset to a valid state.
          XMLEventListenerState oldState = _state;
          _state = XMLEventListenerStates.ERROR_STATE;
  
          // Write output
          if (oldState == XMLEventListenerStates.START_TAG_OPEN) {
              closeStartTag();
              _out.write(_lineBreakChars);
          }
          _encoder.text(_out, text, _escapeAmpersands);
  
          // Change the state
          _state = XMLEventListenerStates.WITHIN_ELEMENT;
  
          // State has changed, check
          checkInvariants();
      }
docs: Writes the specified <code>String</code> as PCDATA.
  
  @param text the PCDATA text to be written, not <code>null</code>.
  @throws IllegalStateException    if <code>getState() != {@link #START_TAG_OPEN} &amp;&amp;
  getState() != {@link #WITHIN_ELEMENT}</code>
  @throws IllegalArgumentException if <code>text == null</code>.
  @throws InvalidXMLException      if the specified text contains an invalid character.
  @throws IOException              if an I/O error occurs; this will set the state to {@link #ERROR_STATE}.