|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.ide.common.res2.AssetSet
public class AssetSet
Represents a set of Assets.
Constructor Summary | |
---|---|
AssetSet(java.lang.String configName)
Creates an asset set with a given configName. |
Method Summary | |
---|---|
protected void |
addItem(I item,
java.lang.String key)
|
void |
addSource(java.io.File file)
Adds a new source file |
void |
addSources(java.util.Collection<java.io.File> files)
Adds a collection of source files. |
protected boolean |
checkFileForAndroidRes(java.io.File file)
Checks a file to make sure it is a valid file in the android res/asset folders. |
protected void |
checkItems()
Checks for duplicate items across all source files. |
protected com.android.ide.common.res2.AssetFile |
createFileAndItems(java.io.File sourceFolder,
java.io.File file,
com.android.utils.ILogger logger)
|
protected com.android.ide.common.res2.AssetFile |
createFileAndItems(java.io.File file,
org.w3c.dom.Node fileNode)
Creates a DataFile and associated DataItems from an XML node from a file created with DataSet.appendToXml(org.w3c.dom.Node, org.w3c.dom.Document, MergeConsumer) |
protected com.android.ide.common.res2.DataSet<com.android.ide.common.res2.AssetItem,com.android.ide.common.res2.AssetFile> |
createSet(java.lang.String name)
|
java.io.File |
findMatchingSourceFile(java.io.File file)
Returns a matching Source file that contains a given file. |
java.lang.String |
getConfigName()
Returns the config name. |
protected F |
getDataFile(java.io.File file)
|
com.google.common.collect.ListMultimap<java.lang.String,I> |
getDataMap()
Returns a map of the items. |
java.util.List<java.io.File> |
getSourceFiles()
Get the list of source files. |
protected boolean |
handleChangedFile(java.io.File sourceFolder,
java.io.File changedFile)
|
protected boolean |
handleNewFile(java.io.File sourceFolder,
java.io.File file,
com.android.utils.ILogger logger)
|
boolean |
isEmpty()
Returns whether the set is empty of items. |
protected boolean |
isValidSourceFile(java.io.File sourceFolder,
java.io.File file)
|
void |
loadFromFiles(com.android.utils.ILogger logger)
Loads the DataSet from the files its source folders contain. |
protected void |
processNewDataFile(java.io.File sourceFolder,
F dataFile,
boolean setTouched)
|
protected void |
readSourceFolder(java.io.File sourceFolder,
com.android.utils.ILogger logger)
Reads the content of a data folders and loads the DataItem. |
int |
size()
Returns the number of items. |
java.lang.String |
toString()
|
boolean |
updateWith(java.io.File sourceFolder,
java.io.File changedFile,
FileStatus fileStatus,
com.android.utils.ILogger logger)
Update the DataSet with a given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AssetSet(java.lang.String configName)
configName
- the name of the config this set is associated with.Method Detail |
---|
protected com.android.ide.common.res2.DataSet<com.android.ide.common.res2.AssetItem,com.android.ide.common.res2.AssetFile> createSet(java.lang.String name)
protected com.android.ide.common.res2.AssetFile createFileAndItems(java.io.File sourceFolder, java.io.File file, com.android.utils.ILogger logger)
protected com.android.ide.common.res2.AssetFile createFileAndItems(@NonNull java.io.File file, @NonNull org.w3c.dom.Node fileNode)
DataSet.appendToXml(org.w3c.dom.Node, org.w3c.dom.Document, MergeConsumer)
file
- the file represented by the DataFilefileNode
- the XML node.
protected boolean isValidSourceFile(@NonNull java.io.File sourceFolder, @NonNull java.io.File file)
protected void readSourceFolder(java.io.File sourceFolder, com.android.utils.ILogger logger) throws MergingException
processNewDataFile(java.io.File, DataFile, boolean)
.
sourceFolder
- the source folder to load the resources from.
MergingException
- if something goes wrongpublic void addSources(java.util.Collection<java.io.File> files)
files
- the source files to add.public void addSource(java.io.File file)
file
- the source file.@NonNull public java.util.List<java.io.File> getSourceFiles()
getSourceFiles
in interface SourceSet
public java.lang.String getConfigName()
public java.io.File findMatchingSourceFile(java.io.File file)
findMatchingSourceFile
in interface SourceSet
file
- the file to search for
public int size()
DataMap
public boolean isEmpty()
@NonNull public com.google.common.collect.ListMultimap<java.lang.String,I> getDataMap()
DataMap
public void loadFromFiles(com.android.utils.ILogger logger) throws MergingException
MergingException
- if something goes wrongprotected void checkItems() throws DuplicateDataException
DuplicateDataException
- if a duplicated item is found.public boolean updateWith(java.io.File sourceFolder, java.io.File changedFile, FileStatus fileStatus, com.android.utils.ILogger logger) throws MergingException
sourceFolder
- the sourceFile containing the changedFilechangedFile
- The changed filefileStatus
- the change state
MergingException
- if something goes wrongprotected boolean handleNewFile(java.io.File sourceFolder, java.io.File file, com.android.utils.ILogger logger) throws MergingException
MergingException
protected void processNewDataFile(@NonNull java.io.File sourceFolder, @NonNull F dataFile, boolean setTouched)
protected boolean handleChangedFile(@NonNull java.io.File sourceFolder, @NonNull java.io.File changedFile) throws MergingException
MergingException
protected void addItem(I item, java.lang.String key)
protected F getDataFile(java.io.File file)
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean checkFileForAndroidRes(java.io.File file)
file
- the file to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |