@ Override public final void pcdata ( char [ ] ch , int start , int length ) throws IllegalStateException , IllegalArgumentException , IndexOutOfBoundsException , InvalidXMLException , IOException { // Check state if ( _state != XMLEventListenerStates . START_TAG_OPEN && _state != XMLEventListenerStates . WITHIN_ELEMENT ) { throw new IllegalStateException ( "getState() == " + _state ) ; // Check arguments } else if ( ch == null ) { throw new IllegalArgumentException ( "ch == null" ) ; } else if ( start < 0 ) { throw new IllegalArgumentException ( "start (" + start + ") < 0" ) ; } else if ( start >= ch . length ) { throw new IllegalArgumentException ( "start (" + start + ") >= ch.length (" + ch . length + ' ' ) ; } else if ( length < 0 ) { throw new IllegalArgumentException ( "length < 0" ) ; } // 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 ( ) ; } _encoder . text ( _out , ch , start , length , _escapeAmpersands ) ; // Change the state _state = XMLEventListenerStates . WITHIN_ELEMENT ; // State has changed, check checkInvariants ( ) ; }
Writes the specified character array as PCDATA .