protected char requireNextS() throws XmlPullParserException, IOException { final char ch = more(); if ( !isS( ch ) ) { throw new XmlPullParserException( "white space is required and not " + printable( ch ), this, null ); } return skipS( ch ); }
/** * @deprecated Use the generic <code>getCause()</code> method * @return */ public Throwable getDetail() { return getCause(); }
/** * Method nextTag. * * @param parser * @throws IOException * @throws XmlPullParserException * @return int */ private int nextTag( XmlPullParser parser ) throws IOException, XmlPullParserException { int eventType = parser.next(); if ( eventType == XmlPullParser.TEXT ) { eventType = parser.next(); } if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG ) { throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null ); } return eventType; } //-- int nextTag( XmlPullParser )
/** * @see ReaderFactory#newXmlReader * * @param reader * @param strict * @throws IOException * @throws XmlPullParserException * @return LifecycleConfiguration */ public LifecycleConfiguration read( Reader reader, boolean strict ) throws IOException, XmlPullParserException { XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( ); parser.setInput( reader ); return read( parser, strict ); } //-- LifecycleConfiguration read( Reader, boolean )
public boolean isEmptyElementTag() throws XmlPullParserException { if ( eventType != START_TAG ) throw new XmlPullParserException( "parser must be on START_TAG to check for empty element", this, null ); return emptyElementTag; }
public int nextTag() throws XmlPullParserException, IOException { next(); if ( eventType == TEXT && isWhitespace() ) { // skip whitespace next(); } if ( eventType != START_TAG && eventType != END_TAG ) { throw new XmlPullParserException( "expected START_TAG or END_TAG not " + TYPES[getEventType()], this, null ); } return eventType; }
protected char requireInput( char ch, char[] input ) throws XmlPullParserException, IOException { for ( char anInput : input ) { if ( ch != anInput ) { throw new XmlPullParserException( "expected " + printable( anInput ) + " in " + new String( input ) + " and not " + printable( ch ), this, null ); } ch = more(); } return ch; }
public XmlPullParserException( String msg, XmlPullParser parser, Throwable chain ) { super( ( msg == null ? "" : msg + " " ) + ( parser == null ? "" : "(position:" + parser.getPositionDescription() + ") " ) + ( chain == null ? "" : "caused by: " + chain ), chain ); if ( parser != null ) { this.row = parser.getLineNumber(); this.column = parser.getColumnNumber(); } this.detail = chain; }
public XmlSerializer text( char[] buf, int start, int len ) throws IOException { if ( startTagIncomplete || setPrefixCalled ) closeStartTag(); if ( doIndent && seenTag ) seenTag = false; writeElementContent( buf, start, len, out ); return this; }
public int next() throws XmlPullParserException, IOException { tokenize = false; return nextImpl(); }
private static final void setNameStart( char ch ) // { lookupNameStartChar[ (int)ch / 32 ] |= (1 << (ch % 32)); setName(ch); } { lookupNameStartChar[ch] = true; setName( ch ); }
public void setInput( Reader in ) throws XmlPullParserException { reset(); reader = in; }
public void setOutput( Writer writer ) { reset(); out = writer; }
protected String lookupOrDeclarePrefix( String namespace ) { return getPrefix( namespace, true ); }
public EntityReplacementMap( String[][] replacements ) { int length = replacements.length; entityName = new String[length]; entityNameBuf = new char[length][]; entityReplacement = new String[length]; entityReplacementBuf = new char[length][]; entityNameHash = new int[length]; for ( String[] replacement : replacements ) { defineEntityReplacementText( replacement[0], replacement[1] ); } }
public String getNamespaceUri( int pos ) throws XmlPullParserException { // int end = eventType == END_TAG ? elNamespaceCount[ depth + 1 ] : namespaceEnd; // if(pos < end) { if ( pos < namespaceEnd ) { return namespaceUri[pos]; } else { throw new XmlPullParserException( "position " + pos + " exceeded number of available namespaces " + namespaceEnd ); } }
public XmlSerializer text( String text ) throws IOException { // assert text != null; if ( startTagIncomplete || setPrefixCalled ) closeStartTag(); if ( doIndent && seenTag ) seenTag = false; writeElementContent( text, out ); return this; }
public int nextToken() throws XmlPullParserException, IOException { tokenize = true; return nextImpl(); }
public String getNamespacePrefix( int pos ) throws XmlPullParserException { // int end = eventType == END_TAG ? elNamespaceCount[ depth + 1 ] : namespaceEnd; // if(pos < end) { if ( pos < namespaceEnd ) { return namespacePrefix[pos]; } else { throw new XmlPullParserException( "position " + pos + " exceeded number of available namespaces " + namespaceEnd ); } }