blacklistFields.addAll( INTERPOLATION_BLACKLIST );
@SuppressWarnings( "unchecked" )
final Set<String> blacklistPkgs = FieldBasedObjectInterpolator.DEFAULT_BLACKLISTED_PACKAGE_PREFIXES;
final FieldBasedObjectInterpolator objectInterpolator =
new FieldBasedObjectInterpolator( blacklistFields, blacklistPkgs );
final Interpolator interpolator = buildInterpolator( project, configSource );
// TODO: Will this adequately detect cycles between prefixed property references and prefixed project
// references??
final RecursionInterceptor interceptor =
new PrefixAwareRecursionInterceptor( InterpolationConstants.PROJECT_PREFIXES, true );
try
{
objectInterpolator.interpolate( assembly, interpolator, interceptor );
}
catch ( final InterpolationException e )
{
throw new AssemblyInterpolationException( "Failed to interpolate assembly with ID: " + assembly.getId()
+ ". Reason: " + e.getMessage(), e );
}
finally
{
interpolator.clearAnswers();
}
if ( objectInterpolator.hasWarnings() && getLogger().isDebugEnabled() )
{
final StringBuilder sb = new StringBuilder();
sb.append( "One or more minor errors occurred while interpolating the assembly with ID: "
+ assembly.getId() + ":\n" );
@SuppressWarnings( "unchecked" )
final List<ObjectInterpolationWarning> warnings = objectInterpolator.getWarnings();
for ( final Iterator<ObjectInterpolationWarning> it = warnings.iterator(); it.hasNext(); )
{
final ObjectInterpolationWarning warning = it.next();
sb.append( '\n' ).append( warning );