* @param parser
*/
private MailingList parseMailingList(String tagName, XmlPullParser parser, boolean strict, String encoding)
throws IOException, XmlPullParserException
{
MailingList mailingList = new MailingList();
mailingList.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "name" ) )
{
if ( parsed.contains( "name" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "name" );
mailingList.setName( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "subscribe" ) )
{
if ( parsed.contains( "subscribe" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "subscribe" );
mailingList.setSubscribe( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "unsubscribe" ) )
{
if ( parsed.contains( "unsubscribe" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "unsubscribe" );
mailingList.setUnsubscribe( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "post" ) )
{
if ( parsed.contains( "post" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "post" );
mailingList.setPost( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "archive" ) )
{
if ( parsed.contains( "archive" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "archive" );
mailingList.setArchive( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "otherArchives" ) )
{
if ( parsed.contains( "otherArchives" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "otherArchives" );
java.util.List otherArchives = new java.util.ArrayList();
mailingList.setOtherArchives( otherArchives );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "otherArchive" ) )
{
otherArchives.add( getTrimmedValue( parser.nextText()) );