Class AbstractV8FileNameConverter

java.lang.Object
com.e1c.langtool.v8.dt.resourcestorage.AbstractV8FileNameConverter
All Implemented Interfaces:
IV8FileNameConverter
Direct Known Subclasses:
ProjectCommonFileNameConverter, V8FileNameConverter

public abstract class AbstractV8FileNameConverter extends Object implements IV8FileNameConverter
  • Field Details

  • Constructor Details

    • AbstractV8FileNameConverter

      public AbstractV8FileNameConverter()
  • Method Details

    • getTranslationFile

      public org.eclipse.core.resources.IFile getTranslationFile(org.eclipse.core.resources.IFile v8File, boolean isLocalizable, TranslateLanguage language)
      Description copied from interface: IV8FileNameConverter
      Gets the translation file.
      Specified by:
      getTranslationFile in interface IV8FileNameConverter
      Parameters:
      v8File - the v8 file, cannot be null.
      isLocalizable - the is localizable
      language - the language, cannot be null.
      Returns:
      the translation file. It can return null when it's impossible to get translation file from the given file.
    • getTranslationFile

      public org.eclipse.core.resources.IFile getTranslationFile(org.eclipse.core.runtime.IPath v8Path, boolean isLocalizable, TranslateLanguage language)
      Description copied from interface: IV8FileNameConverter
      Gets the translation file.
      Specified by:
      getTranslationFile in interface IV8FileNameConverter
      Parameters:
      v8Path - the v8 path, cannot be null.
      isLocalizable - the is localizable
      language - the language , cannot be null.
      Returns:
      the translation file. It can return null when it's impossible to get translation file from the given path.
    • getTranslationPath

      public org.eclipse.core.runtime.IPath getTranslationPath(org.eclipse.core.resources.IFile v8File, boolean isLocalizable, TranslateLanguage language)
      Description copied from interface: IV8FileNameConverter
      Gets the translation file path.
      Specified by:
      getTranslationPath in interface IV8FileNameConverter
      Parameters:
      v8File - the v8 file, cannot be null.
      isLocalizable - the is localizable
      language - the language, cannot be null.
      Returns:
      the translation path. It can return null when it's impossible to get a path to translation file from the given file.
    • getV8File

      public Set<org.eclipse.core.resources.IFile> getV8File(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Gets the v8 files by the given translation file. Caller could not to check that given file is translation file.
      Specified by:
      getV8File in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file
      Returns:
      all possible v8 files converted from translation file
    • getV8File

      public Set<org.eclipse.core.resources.IFile> getV8File(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Gets the v8 files by the given translation file path. Caller could not to check that given file path is translation file.
      Specified by:
      getV8File in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation path
      Returns:
      all possible v8 files converted from translation file
    • getV8Path

      public Set<org.eclipse.core.runtime.IPath> getV8Path(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Gets the v8 file path by the given translation file path. Caller could not to check that given file path is translation file.
      Specified by:
      getV8Path in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation path
      Returns:
      all possible v8 files converted from translation file. Can return null or empty Set.
    • getV8Path

      public Set<org.eclipse.core.runtime.IPath> getV8Path(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Gets the v8 file path by the given translation file. Caller could not to check that given file is translation file.
      Specified by:
      getV8Path in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file
      Returns:
      all possible v8 files converted from translation file
    • isInterface

      public boolean isInterface(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Checks if the given file path is interface translation file. Caller must check first that the file is translation file via IV8FileNameConverter.isTranslation(IPath).
      Specified by:
      isInterface in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation path, cannot be null.
      Returns:
      true, if the file path is interface translation file.
    • isInterface

      public boolean isInterface(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Checks if the given file is interface translation file. Caller must check first that the file is translation file via IV8FileNameConverter.isTranslation(IFile).
      Specified by:
      isInterface in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file, cannot be null.
      Returns:
      true, if the file is interface translation file.
    • getLanguage

      public TranslateLanguage getLanguage(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Gets the translate language from file path.
      Specified by:
      getLanguage in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation path
      Returns:
      the translate language
    • getLanguageCode

      public String getLanguageCode(org.eclipse.core.runtime.IPath translationPath)
    • getLanguage

      public TranslateLanguage getLanguage(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Gets the translate language file.
      Specified by:
      getLanguage in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file
      Returns:
      the translate language
    • isTranslation

      public boolean isTranslation(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Checks if the given file path is translation file.
      Specified by:
      isTranslation in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation path, can be null.
      Returns:
      true, if it is translation file
    • isTranslation

      public boolean isTranslation(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Checks if the give file is translation file.
      Specified by:
      isTranslation in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file, can be null.
      Returns:
      true, if it is translation file
    • getSegment

      public String getSegment(org.eclipse.core.runtime.IPath translationPath)
      Description copied from interface: IV8FileNameConverter
      Gets the segment of translation file name.
      Specified by:
      getSegment in interface IV8FileNameConverter
      Parameters:
      translationPath - the translation file path, cannot be null.
      Returns:
      the segment or null if it is not translation file.
    • getSegment

      public String getSegment(org.eclipse.core.resources.IFile translationFile)
      Description copied from interface: IV8FileNameConverter
      Gets the segment of translation file name.
      Specified by:
      getSegment in interface IV8FileNameConverter
      Parameters:
      translationFile - the translation file, cannot be null.
      Returns:
      the segment or null if it is not translation file.
    • hasRootFolder

      protected static boolean hasRootFolder(org.eclipse.core.runtime.IPath path)