*/
private PatternSet parsePatternSet( XmlPullParser parser, boolean strict, InputSource source )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
PatternSet patternSet = new PatternSet();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
patternSet.setLocation( "", _location );
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
{
String name = parser.getAttributeName( i );
String value = parser.getAttributeValue( i );
if ( name.indexOf( ':' ) >= 0 )
{
// just ignore attributes with non-default namespace (for example: xmlns:xsi)
}
else
{
checkUnknownAttribute( parser, name, tagName, strict );
}
}
java.util.Set parsed = new java.util.HashSet();
while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
{
java.util.List includes = new java.util.ArrayList/*<String>*/();
patternSet.setIncludes( includes );
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
patternSet.setLocation( "includes", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "include".equals( parser.getName() ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
_locations.setLocation( Integer.valueOf( includes.size() ), _location );
includes.add( getTrimmedValue( parser.nextText() ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
{
java.util.List excludes = new java.util.ArrayList/*<String>*/();
patternSet.setExcludes( excludes );
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
patternSet.setLocation( "excludes", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "exclude".equals( parser.getName() ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );