* @param element
*/
private Repository parseRepository(String tagName, Element element, boolean strict, String encoding)
throws IOException, DocumentException
{
Repository repository = new Repository();
repository.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( "connection" ) )
{
if ( parsed.contains( "connection" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "connection" );
repository.setConnection( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "developerConnection" ) )
{
if ( parsed.contains( "developerConnection" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "developerConnection" );
repository.setDeveloperConnection( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "url" ) )
{
if ( parsed.contains( "url" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "url" );
repository.setUrl( getTrimmedValue( childElement.getText() ) );
}
else
{
if ( strict )
{