* @param element
*/
private FileSet parseFileSet(String tagName, Element element, boolean strict, String encoding)
throws IOException, DocumentException
{
FileSet fileSet = new FileSet();
fileSet.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( "directory" ) )
{
if ( parsed.contains( "directory" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "directory" );
fileSet.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();
fileSet.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();
fileSet.setExcludes( excludes );
for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
{
Node n = (Node) j.next();
if ( n.getNodeType() != Node.ELEMENT_NODE )
{