Class JavaPropertyScanner
- java.lang.Object
-
- org.jabylon.properties.types.impl.AbstractPropertyScanner
-
- org.jabylon.properties.types.impl.JavaPropertyScanner
-
- All Implemented Interfaces:
PropertyScanner
- Direct Known Subclasses:
JavaPropertyScannerUTF8
@Service public class JavaPropertyScanner extends AbstractPropertyScanner implements PropertyScanner
-
-
Constructor Summary
Constructors Constructor Description JavaPropertyScanner()
-
Method Summary
All Methods Instance Methods Concrete 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()-
Methods inherited from class org.jabylon.properties.types.impl.AbstractPropertyScanner
isTemplate, isTranslation, matchesLocale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jabylon.properties.types.PropertyScanner
isTemplate, isTranslation
-
-
-
-
Field Detail
-
TYPE
@Property(name="TYPE", value="PROPERTIES_ENCODED") public static final String TYPE- See Also:
- Constant Field Values
-
-
Method Detail
-
findTemplate
public File findTemplate(File propertyFile, ScanConfiguration config)
Description copied from interface:PropertyScannerretrieves the translation template for the given translation (used for mono lingual resources)- Specified by:
findTemplatein interfacePropertyScanner- Returns:
- the template file or
nullif not available
-
getLocale
public Locale getLocale(File propertyFile)
Description copied from interface:PropertyScannerextracts the locale from the given file- Specified by:
getLocalein interfacePropertyScanner- Returns:
-
findTranslations
public Map<Locale,File> findTranslations(File template, ScanConfiguration config)
Description copied from interface:PropertyScannerfinds all existing translation files for the given template- Specified by:
findTranslationsin interfacePropertyScanner- Returns:
-
computeTranslationPath
public File computeTranslationPath(File template, Locale templateLocale, Locale translationLocale)
Description copied from interface:PropertyScannercomputes the location of the translation file for the given template and locale- Specified by:
computeTranslationPathin interfacePropertyScanner- Returns:
-
isBilingual
public boolean isBilingual()
- Specified by:
isBilingualin interfacePropertyScanner- Returns:
trueif this scanner is responsible for bi-lingual files (like XLFIFF) andfalseif is responsible for mono-lingual files like java properties
-
createConverter
public PropertyConverter createConverter(org.eclipse.emf.common.util.URI resource)
Description copied from interface:PropertyScannercreates a new PropertyConverter for the given file- Specified by:
createConverterin interfacePropertyScanner- Returns:
-
getDefaultIncludes
public String[] getDefaultIncludes()
Description copied from interface:PropertyScannerreturns the default includes for the file scan- Specified by:
getDefaultIncludesin interfacePropertyScanner- Returns:
-
getDefaultExcludes
public String[] getDefaultExcludes()
Description copied from interface:PropertyScannerreturns the default excludes for the file scan- Specified by:
getDefaultExcludesin interfacePropertyScanner- Returns:
-
getEncoding
public String getEncoding()
Description copied from interface:PropertyScannerdetermines which encoding should be used to write and write resources- Specified by:
getEncodingin interfacePropertyScanner- Returns:
-
-