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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetName(org.eclipse.emf.ecore.EObject object) Gets the source name of object that uses in current project.Collection<org.eclipse.emf.ecore.EClass>Gets the supportEClassthat can provide name.getTranslatedName(@Nullable org.eclipse.emf.ecore.EObject object, @NonNull IProjectTranslationProvider translationProvider) Gets the pair of source and translated name for specified project.intorder()Order of applying this delegate if it can provide name with other delegates for the object.Collection<org.eclipse.emf.ecore.EClass>Order of this delegate goes before delegates supported returningEClasswhen specificEObjectprovided to service to get names.
-
Field Details
-
v8ProjectManager
-
-
Constructor Details
-
DuallyNamedElementNameProvider
-
-
Method Details
-
getTranslatedName
public @Nullable Pair<String,String> getTranslatedName(@Nullable org.eclipse.emf.ecore.EObject object, @NonNull IProjectTranslationProvider translationProvider) Description copied from interface:INamedEObjectNameProviderGets the pair of source and translated name for specified project.- Specified by:
getTranslatedNamein interfaceINamedEObjectNameProvider- Parameters:
object- the object to get translation of the nametranslationProvider- the translation provider for the target (translated) project- Returns:
- the pair of source name as key and translated name as value, or returns
nullif cannot provide
-
getName
Description copied from interface:INamedEObjectNameProviderGets the source name of object that uses in current project.- Specified by:
getNamein interfaceINamedEObjectNameProvider- Parameters:
object- the object to get the name- Returns:
- the name of object, can return
nullif object has no "name" feature provided bydelegate
-
order
public int order()Description copied from interface:INamedEObjectNameProviderDelegateOrder 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:
orderin interfaceINamedEObjectNameProviderDelegate- Returns:
- the order
- See Also:
-
getSupportEClass
Description copied from interface:INamedEObjectNameProviderDelegateGets the supportEClassthat can provide name. TheEObjectwill be checked that it'sEClassis implementation of one of collection of classes returned by delegate.- Specified by:
getSupportEClassin interfaceINamedEObjectNameProviderDelegate- Returns:
- the collection of support
EClassthat can provide name, cannot returnnull.
-
orderBeforeEClass
Description copied from interface:INamedEObjectNameProviderDelegateOrder of this delegate goes before delegates supported returningEClasswhen specificEObjectprovided to service to get names. EachEClassmust be super type of supported class of this delegate and cannot be equal to supported class.- Specified by:
orderBeforeEClassin interfaceINamedEObjectNameProviderDelegate- Returns:
- the collection of classes that this delegate goes before other delegates supported them.
- See Also:
-