de.enough.polish.ant.build
Class ResourceSetting

java.lang.Object
  extended by de.enough.polish.ant.ConditionalElement
      extended by de.enough.polish.ant.Setting
          extended by de.enough.polish.ant.build.ResourceSetting

public class ResourceSetting
extends Setting

Stores all settings made in the <resources>-element.

Copyright Enough Software 2004 - 2011

 history
        10-Sep-2004 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Constructor Summary
ResourceSetting(File baseDir)
          Creates a new empty Resource Setting.
 
Method Summary
 void addConfiguredCopier(ResourceCopierSetting setting)
           
 void addConfiguredFileset(ResourcesFileSet fileSet)
           
 void addConfiguredFilter(ResourceFilterSetting setting)
           
 void addConfiguredLocalization(LocalizationSetting setting)
           
 void addConfiguredRoot(RootSetting setting)
           
 boolean filterZeroLengthFiles()
           
 ResourceCopierSetting getCopier(Environment env)
           
 ResourceCopierSetting[] getCopiers(Environment env)
           
 String[] getExcludes()
           
 ResourcesFileSet[] getFileSets(Environment env)
          Retrieves an array of file-sets which should either include or exclude files.
 ResourceFilterSetting[] getFilters(Environment env)
           
 LocalizationSetting getLocalizationSetting(Environment env)
          Retrieves the first active localization setting or null when none was found.
 RootSetting[] getRootDirectories(Environment env)
           
 boolean isForceUpdate()
          Determines whether resources should be copied in any case.
 void setDefaultexcludes(boolean useExcludes)
           
 void setDir(File dir)
           
 void setExcludes(String excludes)
           
 void setFilterZeroLengthFiles(boolean filter)
           
 void setForceUpdate(boolean forceUpdate)
          Sets whether resources should be copied in any case.
 void setLocale(String locale)
           
 void setLocales(String locales)
           
 boolean useDefaultExcludes()
           
 
Methods inherited from class de.enough.polish.ant.Setting
addConfiguredParameter, getAllParameters, getParameters, hasParameters
 
Methods inherited from class de.enough.polish.ant.ConditionalElement
getCondition, getIf, getUnless, isActive, isActive, isActive, isActive, setIf, setUnless
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceSetting

public ResourceSetting(File baseDir)
Creates a new empty Resource Setting.

Parameters:
baseDir - the base directory of the corresponding project
Method Detail

addConfiguredLocalization

public void addConfiguredLocalization(LocalizationSetting setting)

addConfiguredFileset

public void addConfiguredFileset(ResourcesFileSet fileSet)

addConfiguredCopier

public void addConfiguredCopier(ResourceCopierSetting setting)

addConfiguredRoot

public void addConfiguredRoot(RootSetting setting)

addConfiguredFilter

public void addConfiguredFilter(ResourceFilterSetting setting)

setDir

public void setDir(File dir)

getRootDirectories

public RootSetting[] getRootDirectories(Environment env)

setDefaultexcludes

public void setDefaultexcludes(boolean useExcludes)

useDefaultExcludes

public boolean useDefaultExcludes()

setExcludes

public void setExcludes(String excludes)

getExcludes

public String[] getExcludes()

setLocales

public void setLocales(String locales)

setLocale

public void setLocale(String locale)

getLocalizationSetting

public LocalizationSetting getLocalizationSetting(Environment env)
Retrieves the first active localization setting or null when none was found.

Parameters:
env - the environment
Returns:
the first active localization setting or null when none was found.

getFileSets

public ResourcesFileSet[] getFileSets(Environment env)
Retrieves an array of file-sets which should either include or exclude files.

Parameters:
env - the environment
Returns:
an array of the appropriate ResourcesFileSet, can be empty but not null

getCopier

public ResourceCopierSetting getCopier(Environment env)

getCopiers

public ResourceCopierSetting[] getCopiers(Environment env)

getFilters

public ResourceFilterSetting[] getFilters(Environment env)

setFilterZeroLengthFiles

public void setFilterZeroLengthFiles(boolean filter)

filterZeroLengthFiles

public boolean filterZeroLengthFiles()

isForceUpdate

public boolean isForceUpdate()
Determines whether resources should be copied in any case. This can make sense, for example, when a binary library file contains resources that should be overwritten by normal project specific resources.

Returns:
true when resources should be copied even when newer resources already exist at the target destination

setForceUpdate

public void setForceUpdate(boolean forceUpdate)
Sets whether resources should be copied in any case. This can make sense, for example, when a binary library file contains resources that should be overwritten by normal project specific resources.

Parameters:
forceUpdate - true when resources should be copied even when newer resources already exist at the target destination