本文整理汇总了Java中org.apache.maven.model.Contributor.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Contributor.getProperties方法的具体用法?Java Contributor.getProperties怎么用?Java Contributor.getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Contributor
的用法示例。
在下文中一共展示了Contributor.getProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitContributor
import org.apache.maven.model.Contributor; //导入方法依赖的package包/类
private void visitContributor( ModelVisitor visitor, Contributor contributor )
{
List<String> roles = contributor.getRoles();
if ( roles != null )
{
ListIterator<String> roleIterator = roles.listIterator();
while ( roleIterator.hasNext() )
{
String role = roleIterator.next();
visitor.visitContributorRole( role );
role = visitor.replaceContributorRole( role );
if ( role == null )
roleIterator.remove();
else
roleIterator.set( role );
}
}
Properties properties = contributor.getProperties();
if ( properties != null )
{
Iterator<Entry<Object, Object>> propertyIterator = properties.entrySet().iterator();
while ( propertyIterator.hasNext() )
{
Entry<Object, Object> property = propertyIterator.next();
String propertyKey = (String) property.getKey();
String propertyValue = (String) property.getKey();
visitor.visitContributorProperty( propertyKey, propertyValue );
propertyValue = visitor.replaceContributorProperty( propertyKey, propertyValue );
if ( propertyValue == null )
propertyIterator.remove();
else
property.setValue( propertyValue );
}
}
}
示例2: checkRequiredHeaders
import org.apache.maven.model.Contributor; //导入方法依赖的package包/类
/**
* @param units contributors and developers to check
* @return required headers
*/
private Map<String, Boolean> checkRequiredHeaders( List<? extends Contributor> units )
{
Map<String, Boolean> requiredHeaders = new HashMap<String, Boolean>();
requiredHeaders.put( IMAGE, Boolean.FALSE );
requiredHeaders.put( ID, Boolean.FALSE );
requiredHeaders.put( NAME, Boolean.FALSE );
requiredHeaders.put( EMAIL, Boolean.FALSE );
requiredHeaders.put( URL, Boolean.FALSE );
requiredHeaders.put( ORGANIZATION, Boolean.FALSE );
requiredHeaders.put( ORGANIZATION_URL, Boolean.FALSE );
requiredHeaders.put( ROLES, Boolean.FALSE );
requiredHeaders.put( TIME_ZONE, Boolean.FALSE );
requiredHeaders.put( PROPERTIES, Boolean.FALSE );
for ( Contributor unit : units )
{
if ( unit instanceof Developer )
{
Developer developer = (Developer) unit;
if ( StringUtils.isNotEmpty( developer.getId() ) )
{
requiredHeaders.put( ID, Boolean.TRUE );
}
}
if ( StringUtils.isNotEmpty( unit.getName() ) )
{
requiredHeaders.put( NAME, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getEmail() ) )
{
requiredHeaders.put( EMAIL, Boolean.TRUE );
requiredHeaders.put( IMAGE, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getUrl() ) )
{
requiredHeaders.put( URL, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getOrganization() ) )
{
requiredHeaders.put( ORGANIZATION, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getOrganizationUrl() ) )
{
requiredHeaders.put( ORGANIZATION_URL, Boolean.TRUE );
}
if ( !isEmpty( unit.getRoles() ) )
{
requiredHeaders.put( ROLES, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getTimezone() ) )
{
requiredHeaders.put( TIME_ZONE, Boolean.TRUE );
}
Properties properties = unit.getProperties();
boolean hasPicUrl = properties.containsKey( "picUrl" );
if ( hasPicUrl )
{
requiredHeaders.put( IMAGE, Boolean.TRUE );
}
boolean isJustAnImageProperty = properties.size() == 1 && hasPicUrl;
if ( !isJustAnImageProperty && !properties.isEmpty() )
{
requiredHeaders.put( PROPERTIES, Boolean.TRUE );
}
}
return requiredHeaders;
}