* @param element
*/
private Developer parseDeveloper(String tagName, Element element, boolean strict, String encoding)
throws IOException, DocumentException
{
Developer developer = new Developer();
developer.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( "id" ) )
{
if ( parsed.contains( "id" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "id" );
developer.setId( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "name" ) )
{
if ( parsed.contains( "name" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "name" );
developer.setName( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "email" ) )
{
if ( parsed.contains( "email" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "email" );
developer.setEmail( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "url" ) )
{
if ( parsed.contains( "url" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "url" );
developer.setUrl( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "organization" ) || childElement.getName().equals( "organisation" ) )
{
if ( parsed.contains( "organization" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "organization" );
developer.setOrganization( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "organizationUrl" ) || childElement.getName().equals( "organisationUrl" ) )
{
if ( parsed.contains( "organizationUrl" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "organizationUrl" );
developer.setOrganizationUrl( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "roles" ) )
{
if ( parsed.contains( "roles" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "roles" );
java.util.List roles = new java.util.ArrayList();
developer.setRoles( roles );
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( "role" ) )
{
roles.add( getTrimmedValue( listElement.getText() ) );
}
else
{
}
}
}
}
else if ( childElement.getName().equals( "timezone" ) )
{
if ( parsed.contains( "timezone" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "timezone" );
developer.setTimezone( getTrimmedValue( childElement.getText() ) );
}
else if ( childElement.getName().equals( "properties" ) )
{
if ( parsed.contains( "properties" ) )
{
throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
}
parsed.add( "properties" );
for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
{
Node n = (Node) j.next();
if ( n.getNodeType() != Node.ELEMENT_NODE )
{
}
else
{
Element listElement = (Element) n;
String key = listElement.getName();
String value = listElement.getText()
.trim()
;
developer.addProperty( key, value );
}
}
}
else
{