final StringSearchInterpolator interpolator = new StringSearchInterpolator();
if ( moduleArtifact != null )
{
// 1A
interpolator.addValueSource( new PrefixedObjectValueSource( "module.", moduleArtifact ) );
// 1B
interpolator.addValueSource( new PrefixedObjectValueSource( "module.", moduleArtifact.getArtifactHandler() ) );
interpolator.addValueSource( new PrefixedObjectValueSource( "module.handler.",
moduleArtifact.getArtifactHandler() ) );
}
// 1C
if ( moduleProject != null )
{
interpolator.addValueSource( new PrefixedObjectValueSource( "module.", moduleProject ) );
interpolator.addValueSource( new PrefixedPropertiesValueSource( "module.properties.",
moduleProject.getProperties() ) );
if ( moduleProject.getArtifact() != null )
{
interpolator.addValueSource( new PrefixedObjectValueSource( "module.", moduleProject.getArtifact() ) );
}
}
// 2A
interpolator.addValueSource( new PrefixedObjectValueSource( "artifact.", artifact ) );
// 2B
interpolator.addValueSource( new PrefixedObjectValueSource( "artifact.", artifact.getArtifactHandler() ) );
interpolator.addValueSource( new PrefixedObjectValueSource( "artifact.handler.", artifact.getArtifactHandler() ) );
// 2C
if ( artifactProject != null )
{
interpolator.addValueSource( new PrefixedObjectValueSource( "artifact.", artifactProject ) );
interpolator.addValueSource( new PrefixedPropertiesValueSource( "artifact.properties.",
artifactProject.getProperties() ) );
if ( artifactProject.getArtifact() != null )
{
interpolator.addValueSource( new PrefixedObjectValueSource( "artifact.", artifactProject.getArtifact() ) );
}
}
if ( mainProject != null )
{
// 3
// 4
interpolator.addValueSource( new PrefixedObjectValueSource( InterpolationConstants.PROJECT_PREFIXES,
mainProject, true ) );
}
final Properties specialRules = new Properties();