Package org.jabylon.properties.types
Interface PropertyScanner
-
- All Known Implementing Classes:
AbstractPropertyScanner,JavaPropertyScanner,JavaPropertyScannerUTF8
public interface PropertyScannercontributes a new kind of translatable resource- Author:
- jutzig.dev@googlemail.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FilecomputeTranslationPath(File template, Locale templateLocale, Locale translationLocale)computes the location of the translation file for the given template and localePropertyConvertercreateConverter(org.eclipse.emf.common.util.URI resource)creates a new PropertyConverter for the given fileFilefindTemplate(File propertyFile, ScanConfiguration config)retrieves the translation template for the given translation (used for mono lingual resources)Map<Locale,File>findTranslations(File template, ScanConfiguration config)finds all existing translation files for the given templateString[]getDefaultExcludes()returns the default excludes for the file scanString[]getDefaultIncludes()returns the default includes for the file scanStringgetEncoding()determines which encoding should be used to write and write resourcesLocalegetLocale(File propertyFile)extracts the locale from the given filebooleanisBilingual()booleanisTemplate(File propertyFile, String masterLocale)checks if the given file is a translation templatebooleanisTranslation(File propertyFile, ScanConfiguration config)checks if the given file is a translation file
-
-
-
Field Detail
-
TYPE
static final String TYPE
the unique id of the type of resources that this scanner is responsible for- See Also:
- Constant Field Values
-
-
Method Detail
-
isTemplate
boolean isTemplate(File propertyFile, String masterLocale)
checks if the given file is a translation template- Parameters:
propertyFile-config-- Returns:
-
isTranslation
boolean isTranslation(File propertyFile, ScanConfiguration config)
checks if the given file is a translation file- Parameters:
propertyFile-config-- Returns:
-
findTemplate
File findTemplate(File propertyFile, ScanConfiguration config)
retrieves the translation template for the given translation (used for mono lingual resources)- Parameters:
propertyFile-config-- Returns:
- the template file or
nullif not available
-
findTranslations
Map<Locale,File> findTranslations(File template, ScanConfiguration config)
finds all existing translation files for the given template- Parameters:
template-config-- Returns:
-
computeTranslationPath
File computeTranslationPath(File template, Locale templateLocale, Locale translationLocale)
computes the location of the translation file for the given template and locale- Parameters:
template-templateLocale-translationLocale-- Returns:
-
getLocale
Locale getLocale(File propertyFile)
extracts the locale from the given file- Parameters:
propertyFile-- Returns:
-
isBilingual
boolean isBilingual()
- Returns:
trueif this scanner is responsible for bi-lingual files (like XLFIFF) andfalseif is responsible for mono-lingual files like java properties
-
createConverter
PropertyConverter createConverter(org.eclipse.emf.common.util.URI resource)
creates a new PropertyConverter for the given file- Parameters:
file-- Returns:
-
getDefaultIncludes
String[] getDefaultIncludes()
returns the default includes for the file scan- Returns:
-
getDefaultExcludes
String[] getDefaultExcludes()
returns the default excludes for the file scan- Returns:
-
getEncoding
String getEncoding()
determines which encoding should be used to write and write resources- Returns:
-
-