Class ContextDefCache

java.lang.Object
com.e1c.langtool.v8.dt.bsl.translator.ContextDefCache
All Implemented Interfaces:
SessionCache

public class ContextDefCache extends Object implements SessionCache
Methods and properties translation cache.
  • Constructor Details

    • ContextDefCache

      public ContextDefCache()
  • Method Details

    • clear

      public void clear()
      Description copied from interface: SessionCache
      Clear all holding cache
      Specified by:
      clear in interface SessionCache
    • getMethodOrPropertyName

      public String getMethodOrPropertyName(FeatureAccess featureAccess, Environments environments)
    • getPropertyName

      public String getPropertyName(String name, Environments environments, List<String> otherProperties)
      Return translation for property name in given environment. In case of ambiguous translation try to resolve ambiguity by analyzing other properties used along with property of interest. List of properties passed in otherProperties array.
      Parameters:
      name - Property name
      environments - Environments
      otherProperties - Other properties list used along with queried one
      Returns:
      Property name translation
    • getPropertyTranslations

      public Set<String> getPropertyTranslations(String name, Environments environments)
    • getMethodTranslations

      public Set<String> getMethodTranslations(String name, Environments environments)
    • getClarifiedTranslations

      public SortedSet<String> getClarifiedTranslations(String memberName, List<String> accessedMembers, boolean requiredToBeIterable, boolean requiredToBeIndexable)
      Try to clarify translation of methodName based on list of properties and methods invoked on the same object as the methodName. Note: Both in memberName and accessedMembers method names should be postfixed with "()".
      Parameters:
      memberName - Member name to be clarified
      accessedMembers - List of members accessed in the same method body as the methodName
      requiredToBeIterable - true if resulting type should be iterable
      requiredToBeIndexable - true if resulting type should support indexed access
      Returns:
      Set of possible translations
    • findContextSensitiveTranslations

      public SortedSet<String> findContextSensitiveTranslations(DynamicFeatureAccess featureAccess)
      Try to resolve feature access translation ambiguity by analyzing feature access parent expression usage inside method body.
      Parameters:
      featureAccess - Ambiguous dynamic feature access
      Returns:
      Set of translations found for given ambiguous feature access.
    • getDefiningTypes

      public Set<Type> getDefiningTypes(String memberName)
    • getTranslation

      public String getTranslation(Type type, String memberName)
    • initialize

      public void initialize(org.eclipse.emf.ecore.EObject context, boolean isRussian) throws DcsPathException
      Throws:
      DcsPathException