Class DuallyNamedElementNameProvider

java.lang.Object
com.e1c.langtool.v8.dt.translator.DuallyNamedElementNameProvider
All Implemented Interfaces:
INamedEObjectNameProvider, INamedEObjectNameProviderDelegate
Direct Known Subclasses:
BslContextDefMethodOrPropertyNamedProvider, DbViewElementNameProvider, ParameterNameProvider

public class DuallyNamedElementNameProvider extends Object implements INamedEObjectNameProviderDelegate
The delegate provide name for DuallyNamedElement whitch gets NamedElement.getName() or DuallyNamedElement.getNameRu() depending on project ScriptVariant. Delegate must be sorted bofore NamedElement.
See Also:
  • Field Details

  • Constructor Details

    • DuallyNamedElementNameProvider

      @Inject public DuallyNamedElementNameProvider(IV8ProjectManager v8ProjectManager)
  • Method Details

    • getTranslatedName

      public @Nullable Pair<String,String> getTranslatedName(@Nullable org.eclipse.emf.ecore.EObject object, @NonNull IProjectTranslationProvider translationProvider)
      Description copied from interface: INamedEObjectNameProvider
      Gets the pair of source and translated name for specified project.
      Specified by:
      getTranslatedName in interface INamedEObjectNameProvider
      Parameters:
      object - the object to get translation of the name
      translationProvider - the translation provider for the target (translated) project
      Returns:
      the pair of source name as key and translated name as value, or returns null if cannot provide
    • getName

      public @Nullable String getName(org.eclipse.emf.ecore.EObject object)
      Description copied from interface: INamedEObjectNameProvider
      Gets the source name of object that uses in current project.
      Specified by:
      getName in interface INamedEObjectNameProvider
      Parameters:
      object - the object to get the name
      Returns:
      the name of object, can return null if object has no "name" feature provided by delegate
    • order

      public int order()
      Description copied from interface: INamedEObjectNameProviderDelegate
      Order of applying this delegate if it can provide name with other delegates for the object. If delegates has equal order then order of #hashCode() will apply. Default value is 100.
      Specified by:
      order in interface INamedEObjectNameProviderDelegate
      Returns:
      the order
      See Also:
    • getSupportEClass

      public Collection<org.eclipse.emf.ecore.EClass> getSupportEClass()
      Description copied from interface: INamedEObjectNameProviderDelegate
      Gets the support EClass that can provide name. The EObject will be checked that it's EClass is implementation of one of collection of classes returned by delegate.
      Specified by:
      getSupportEClass in interface INamedEObjectNameProviderDelegate
      Returns:
      the collection of support EClass that can provide name, cannot return null.
    • orderBeforeEClass

      public Collection<org.eclipse.emf.ecore.EClass> orderBeforeEClass()
      Description copied from interface: INamedEObjectNameProviderDelegate
      Order of this delegate goes before delegates supported returning EClass when specific EObject provided to service to get names. Each EClass must be super type of supported class of this delegate and cannot be equal to supported class.
      Specified by:
      orderBeforeEClass in interface INamedEObjectNameProviderDelegate
      Returns:
      the collection of classes that this delegate goes before other delegates supported them.
      See Also: