Package com.ibm.dbb.build
Class PropertyMappings
- java.lang.Object
-
- com.ibm.dbb.build.PropertyMappings
-
public class PropertyMappings extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PropertyMappings(java.lang.String key)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilePattern(java.lang.String value, java.lang.String filePattern)
Appends a file pattern to the list of associated file patterns for the script mappingvoid
addFilePatterns(java.lang.String value, java.util.List<java.lang.String> filePatterns)
Appends a list of file patterns to the list of associated file patterns for the script mappingjava.lang.String
getKeyName()
java.util.List<java.lang.String>
getMappedList(java.lang.String value, java.io.File file)
Returns a sublist of files that are mapped the value namejava.util.List<java.lang.String>
getMappedList(java.lang.String value, java.io.File file, java.lang.String encoding)
Returns a sublist of files that are mapped the valuejava.util.List<java.lang.String>
getMappedList(java.lang.String value, java.util.List<java.lang.String> files)
Returns a sublist of files that are mapped the value namejava.lang.String
getValue(java.lang.String file)
Returns the value associated to the relative path file orNULL
if no value is found for the file.java.util.Set<java.lang.String>
getValues()
Returns all the values of the mapboolean
isMapped(java.lang.String value, java.lang.String file)
Returnstrue
if the list contains the value mappingvoid
setKeyName(java.lang.String newKeyName)
void
setValue(java.lang.String value, java.util.List<java.lang.String> filePatterns)
Sets a value association.
-
-
-
Method Detail
-
getValue
public java.lang.String getValue(java.lang.String file)
Returns the value associated to the relative path file orNULL
if no value is found for the file.- Parameters:
file
- : The relative path of the file to search for.- Returns:
- The name of the value associated to the file or
NULL
if none found
-
setValue
public void setValue(java.lang.String value, java.util.List<java.lang.String> filePatterns)
Sets a value association. If the value already exists, the existing file pattern associations are replaced with the new file patterns- Parameters:
value
- : The name of the value to associatefilePatterns
- The list of file patterns to associate to this value
-
addFilePattern
public void addFilePattern(java.lang.String value, java.lang.String filePattern)
Appends a file pattern to the list of associated file patterns for the script mapping- Parameters:
value
- : The name of the valuefilePattern
- : The file pattern to add to the script mapping
-
addFilePatterns
public void addFilePatterns(java.lang.String value, java.util.List<java.lang.String> filePatterns)
Appends a list of file patterns to the list of associated file patterns for the script mapping- Parameters:
value
- : The name of the valuefilePatterns
- : The list of file patterns to add to the script mapping
-
isMapped
public boolean isMapped(java.lang.String value, java.lang.String file)
Returnstrue
if the list contains the value mapping- Parameters:
value
- : The name of the valuefile
- : The relative file associated to the value name- Returns:
true
if the list contains the value mapping
-
getMappedList
public java.util.List<java.lang.String> getMappedList(java.lang.String value, java.util.List<java.lang.String> files)
Returns a sublist of files that are mapped the value name- Parameters:
value
- : The name of the value be matchedfiles
- : The list of files to match- Returns:
- A list of relative path files that are associated to the value name
-
getMappedList
public java.util.List<java.lang.String> getMappedList(java.lang.String value, java.io.File file) throws java.io.IOException
Returns a sublist of files that are mapped the value name- Parameters:
value
- : The name of the value be matchedfile
- : An external file containing a list of files to match- Returns:
- A list of relative path files that are associated to the value name
- Throws:
java.io.IOException
- If an error occurred when reading the file.
-
getMappedList
public java.util.List<java.lang.String> getMappedList(java.lang.String value, java.io.File file, java.lang.String encoding) throws java.io.IOException
Returns a sublist of files that are mapped the value- Parameters:
value
- : The name of the value be matchedfile
- : An external file containing a list of files to matchencoding
- : The encoding of the input file- Returns:
- A list of relative path files that are associated to the value
- Throws:
java.io.IOException
- If an error occurred when reading the file.
-
getValues
public java.util.Set<java.lang.String> getValues()
Returns all the values of the map- Returns:
- A set of all values
-
setKeyName
public void setKeyName(java.lang.String newKeyName)
- Parameters:
newKeyName
- : the new name of the BuildProperties key
-
getKeyName
public java.lang.String getKeyName()
- Returns:
- the name of the BuildProperties key
-
-