final String customType = artifactTypeMapping.getAttribute( TYPE_ATTRIBUTE );
final String mapping = artifactTypeMapping.getAttribute( MAPPING_ATTRIBUTE );
if ( customType == null )
{
throw new EarPluginException( "Invalid artifact type mapping, type attribute should be set." );
}
else if ( mapping == null )
{
throw new EarPluginException( "Invalid artifact type mapping, mapping attribute should be set." );
}
else if ( !EarModuleFactory.isStandardArtifactType( mapping ) )
{
throw new EarPluginException(
"Invalid artifact type mapping, mapping[" + mapping + "] must be a standard Ear artifact type["
+ EarModuleFactory.getStandardArtifactTypes() + "]" );
}
else if ( customMappings.containsKey( customType ) )
{
throw new EarPluginException(
"Invalid artifact type mapping, type[" + customType + "] is already registered." );
}
else
{
// Add the custom mapping