FileDocCategorySizeDatePackage
FilterCfg.javaAPI DocAndroid 1.5 API6435Wed May 06 22:41:16 BST 2009com.vladium.emma.instr

FilterCfg

public class FilterCfg extends Object
author
Vlad Roubtsov, (C) 2003

Fields Summary
protected static final String
COMMA
protected static final String
COMMA_DELIMITERS
protected static final String
PATH_DELIMITERS
private final org.apache.tools.ant.Task
m_task
private final List
m_filterList
private transient String[]
m_specs
Constructors Summary
public FilterCfg(org.apache.tools.ant.Task task)

        if (task == null) throw new IllegalArgumentException ("null input: task");
        
        m_task = task;
        m_filterList = new ArrayList ();
    
Methods Summary
public com.vladium.emma.instr.FilterCfg$filterElementcreateFilter()

        final filterElement result = new filterElement (m_task);
        m_filterList.add (result);
        
        return result;
    
public java.lang.String[]getFilterSpecs()

        if (m_specs != null)
            return m_specs;
        else
        {           
            if ((m_filterList == null) || m_filterList.isEmpty ())
            {
                m_specs = IConstants.EMPTY_STRING_ARRAY;
            }
            else
            {
                final String [] values = new String [m_filterList.size ()];
                
                int j = 0;
                for (Iterator i = m_filterList.iterator (); i.hasNext (); ++ j)
                    values [j] = ((StringValue) i.next ()).getValue ();
                                
                try
                {
                    m_specs = Strings.mergeAT (values, COMMA_DELIMITERS, true);
                }
                catch (IOException ioe)
                {
                    throw (BuildException) SuppressableTask.newBuildException (m_task.getTaskName ()
                        + ": I/O exception while processing input" , ioe, m_task.getLocation ()).fillInStackTrace ();
                }
            }
            
            return m_specs;
        }
    
public voidsetFilter(java.lang.String filter)

        createFilter ().appendValue (filter, COMMA);