Interface PropertyScanner

    • 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 null if 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:
        true if this scanner is responsible for bi-lingual files (like XLFIFF) and false if 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: