Class ContextDefCache
java.lang.Object
com.e1c.langtool.v8.dt.bsl.translator.ContextDefCache
- All Implemented Interfaces:
SessionCache
Methods and properties translation cache.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all holding cachefindContextSensitiveTranslations(DynamicFeatureAccess featureAccess) Try to resolve feature access translation ambiguity by analyzing feature access parent expression usage inside method body.getClarifiedTranslations(String memberName, List<String> accessedMembers, boolean requiredToBeIterable, boolean requiredToBeIndexable) Try to clarify translation ofmethodNamebased on list of properties and methods invoked on the same object as themethodName.getDefiningTypes(String memberName) getMethodOrPropertyName(FeatureAccess featureAccess, Environments environments) getMethodTranslations(String name, Environments environments) getPropertyName(String name, Environments environments, List<String> otherProperties) Return translation for propertynamein givenenvironment.getPropertyTranslations(String name, Environments environments) getTranslation(Type type, String memberName) voidinitialize(org.eclipse.emf.ecore.EObject context, boolean isRussian) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.v8.dt.translator.SessionCache
init
-
Constructor Details
-
ContextDefCache
public ContextDefCache()
-
-
Method Details
-
clear
public void clear()Description copied from interface:SessionCacheClear all holding cache- Specified by:
clearin interfaceSessionCache
-
getMethodOrPropertyName
-
getPropertyName
Return translation for propertynamein givenenvironment. In case of ambiguous translation try to resolve ambiguity by analyzing other properties used along with property of interest. List of properties passed inotherPropertiesarray.- Parameters:
name- Property nameenvironments- EnvironmentsotherProperties- Other properties list used along with queried one- Returns:
- Property name translation
-
getPropertyTranslations
-
getMethodTranslations
-
getClarifiedTranslations
public SortedSet<String> getClarifiedTranslations(String memberName, List<String> accessedMembers, boolean requiredToBeIterable, boolean requiredToBeIndexable) Try to clarify translation ofmethodNamebased on list of properties and methods invoked on the same object as themethodName. Note: Both inmemberNameandaccessedMembersmethod names should be postfixed with "()".- Parameters:
memberName- Member name to be clarifiedaccessedMembers- List of members accessed in the same method body as themethodNamerequiredToBeIterable-trueif resulting type should be iterablerequiredToBeIndexable-trueif resulting type should support indexed access- Returns:
- Set of possible translations
-
findContextSensitiveTranslations
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
-
getTranslation
-
initialize
public void initialize(org.eclipse.emf.ecore.EObject context, boolean isRussian) throws DcsPathException - Throws:
DcsPathException
-