com.android.ide.common.res2
Interface MergeConsumer<I extends com.android.ide.common.res2.DataItem>

All Known Implementing Classes:
MergedAssetWriter, MergedResourceWriter, MergeWriter

public interface MergeConsumer<I extends com.android.ide.common.res2.DataItem>

A consumer of merges. Used with DataMerger.mergeData(MergeConsumer, boolean).


Nested Class Summary
static class MergeConsumer.ConsumerException
          An exception thrown during by the consumer.
 
Method Summary
 void addItem(I item)
          Adds an item.
 void end()
          Called after the merge ends.
 boolean ignoreItemInMerge(I item)
           
 void removeItem(I removedItem, I replacedBy)
          Removes an item.
 void start()
          Called before the merge starts.
 

Method Detail

start

void start()
           throws MergeConsumer.ConsumerException
Called before the merge starts.

Throws:
MergeConsumer.ConsumerException

end

void end()
         throws MergeConsumer.ConsumerException
Called after the merge ends.

Throws:
MergeConsumer.ConsumerException

addItem

void addItem(@NonNull
             I item)
             throws MergeConsumer.ConsumerException
Adds an item. The item may already be existing. Calling DataItem.isTouched() will indicate whether the item actually changed.

Parameters:
item - the new item.
Throws:
MergeConsumer.ConsumerException

removeItem

void removeItem(@NonNull
                I removedItem,
                @Nullable
                I replacedBy)
                throws MergeConsumer.ConsumerException
Removes an item. Optionally pass the item that will replace this one. This methods does not do the replacement. The replaced item is just there in case the removal can be optimized when it's a replacement vs. a removal.

Parameters:
removedItem - the removed item.
replacedBy - the optional item that replaces the removed item.
Throws:
MergeConsumer.ConsumerException

ignoreItemInMerge

boolean ignoreItemInMerge(I item)