FileDocCategorySizeDatePackage
SuppressableTask.javaAPI DocAndroid 1.5 API4020Wed May 06 22:41:16 BST 2009com.vladium.emma.ant

SuppressableTask

public abstract class SuppressableTask extends org.apache.tools.ant.Task
author
Vlad Roubtsov, (C) 2003

Fields Summary
private VerbosityCfg
m_verbosityCfg
private GenericCfg
m_genericCfg
private boolean
m_enabled
Constructors Summary
protected SuppressableTask()

        m_enabled = true; // by default, all tasks are enabled
    
Methods Summary
public final PropertyElementcreateProperty()

        return m_genericCfg.createProperty ();
    
protected com.vladium.util.IPropertiesgetTaskSettings()

        // (1) by default, generic settings are always more specific than any file settings
        
        // (2) verbosity settings use dedicated attributes and hence are more specific
        // than anything generic
        
        final IProperties fileSettings = m_genericCfg.getFileSettings ();
        final IProperties genericSettings = m_genericCfg.getGenericSettings (); 
        final IProperties verbositySettings = m_verbosityCfg.getSettings ();
        
        return IProperties.Factory.combine (verbositySettings,
               IProperties.Factory.combine (genericSettings,
                                            fileSettings));
    
public voidinit()

        super.init ();
        
        m_verbosityCfg = new VerbosityCfg ();
        m_genericCfg = new GenericCfg (this);
    
public final booleanisEnabled()

        return m_enabled;
    
public static org.apache.tools.ant.BuildExceptionnewBuildException(java.lang.String msg, org.apache.tools.ant.Location location)

        final String prefixedMsg = ((msg == null) || (msg.length () == 0))
            ? msg
            : IAppConstants.APP_THROWABLE_BUILD_ID + " " + msg;
       
        return new BuildException (prefixedMsg, location); 
    
public static org.apache.tools.ant.BuildExceptionnewBuildException(java.lang.String msg, java.lang.Throwable cause, org.apache.tools.ant.Location location)

        final String prefixedMsg = ((msg == null) || (msg.length () == 0))
            ? msg
            : IAppConstants.APP_THROWABLE_BUILD_ID + " " + msg;
       
        return new BuildException (prefixedMsg, cause, location); 
    
public final voidsetEnabled(boolean enabled)
Set the optional 'enabled' attribute [defaults to 'true'].

        m_enabled = enabled;
    
public final voidsetProperties(java.io.File file)

        m_genericCfg.setProperties (file);
    
public voidsetVerbosity(VerbosityCfg.VerbosityAttribute verbosity)

        m_verbosityCfg.setVerbosity (verbosity);
    
public voidsetVerbosityfilter(java.lang.String filter)

        m_verbosityCfg.setVerbosityfilter (filter);