* @param element
*/
private SourceModification parseSourceModification(String tagName, Element element, boolean strict, String encoding)
throws IOException, DocumentException
{
SourceModification sourceModification = new SourceModification();
sourceModification.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
for ( Iterator i = element.nodeIterator(); i.hasNext(); )
{
Node node = (Node) i.next();
if ( node.getNodeType() != Node.ELEMENT_NODE )
{
}
else
{
Element childElement = (Element) node;
if ( childElement.getName().equals( "className" ) )
{
if ( parsed.contains( "className" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "className" );
sourceModification.setClassName( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "property" ) )
{
if ( parsed.contains( "property" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "property" );
sourceModification.setProperty( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "directory" ) )
{
if ( parsed.contains( "directory" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "directory" );
sourceModification.setDirectory( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "includes" ) )
{
if ( parsed.contains( "includes" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "includes" );
java.util.List includes = new java.util.ArrayList();
sourceModification.setIncludes( includes );
for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
{
Node n = (Node) j.next();
if ( n.getNodeType() != Node.ELEMENT_NODE )
{
}
else
{
Element listElement = (Element) n;
if ( listElement.getName().equals( "include" ) )
{
includes.add( getTrimmedValue( listElement.getText() ) );
}
else
{
}
}
}
}
else if ( childElement.getName().equals( "excludes" ) )
{
if ( parsed.contains( "excludes" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "excludes" );
java.util.List excludes = new java.util.ArrayList();
sourceModification.setExcludes( excludes );
for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
{
Node n = (Node) j.next();
if ( n.getNodeType() != Node.ELEMENT_NODE )
{