Package com._1c.g5.v8.dt.bsl.resource
Class DynamicFeatureAccessComputer
- java.lang.Object
- 
- com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer
 
- 
 public class DynamicFeatureAccessComputer extends Object Special computer for BSL grammar elementDynamicFeatureAccess.
 Computes types and parts forDynamicFeatureAccess
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDynamicFeatureAccessComputer.DynamicPropertyTypeNameMapperSpecial provider for getting conformity between dynamic types name for collections of metaobject and their property type name
 - 
Constructor SummaryConstructors Constructor Description DynamicFeatureAccessComputer()Initialize dynamic type description
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCachedValues()Deleting all cached valuesList<org.eclipse.emf.ecore.EObject>dividedIntoParts(DynamicFeatureAccess featureAccess)Divides into partsDynamicFeatureAccessCollection<org.eclipse.xtext.util.Triple<Collection<Method>,Collection<Property>,TypeItem>>getAllMethodAndProperties(List<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets all properties and methods from allTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<Method>,TypeItem>>getAllMethods(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets all methods from allTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>>getAllMethodsFromRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets only methods from all reference contextDef ofTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>>getAllMethodsWithoutRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets all methods from allTypeItemwithout methods from reference contextDef of typeCollection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>>getAllMockMethodsFromRefContextDef(Collection<TypeItem> types, String methodName, org.eclipse.emf.ecore.resource.Resource res)Gets only methods from all reference contextDef ofTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>>getAllMockPropertiesFromRefContextDef(Collection<TypeItem> types, String propertyName, org.eclipse.emf.ecore.resource.Resource res)Gets only properties from all reference contextDef ofTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>>getAllProperties(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets all properties from allTypeItemCollection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>>getAllPropertiesFromRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res)Gets only properties from all reference contextDef ofTypeItemTypeItemgetCorrespondingType(Collection<TypeItem> neighbourTypes, Environments envs, String name, org.eclipse.emf.ecore.resource.Resource res)Gets corresponding type by name from properties, if we know parent types inDynamicFeatureAccessTypeItemgetCorrespondingType(List<TypeItem> neighbourTypes, Environments envs, String name, int numParam, org.eclipse.emf.ecore.resource.Resource res)Gets corresponding type by name from methods, if we know parent types inDynamicFeatureAccessList<FeatureEntry>getLastObject(DynamicFeatureAccess featureAccess, Environments envs)Gets last object inDynamicFeatureAccessand resolves itList<FeatureEntry>getLastObject(DynamicFeatureAccess featureAccess, Environments envs, boolean mockItemsAllowed)Gets last object inDynamicFeatureAccessand resolves itList<FeatureEntry>getLastObject(IndexAccess indexAccess, Environments envs, boolean mockItemsAllowed)Gets last object inIndexAccessand resolves itList<FeatureEntry>getObjectForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, boolean mockItemsAllowed, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets resolve part ofDynamicFeatureAccessby indexList<FeatureEntry>getObjectForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets resolve part ofDynamicFeatureAccessby indexList<FeatureEntry>getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, boolean mockItemsAllowed, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets corresponding by name, if we know parent types inDynamicFeatureAccessList<FeatureEntry>getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, int numParam, boolean mockItemsAllowed, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets corresponding by name, if we know parent types inDynamicFeatureAccessList<FeatureEntry>getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, int numParam, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets corresponding by name, if we know parent types inDynamicFeatureAccessTypeItemgetTypeOfPreviousElementForMethod(FeatureAccess feature, int numParam, TypesComputer computer, Environmental envs, org.eclipse.emf.ecore.resource.Resource res)Gets corresponding type of previous element forfeatureTypeItemgetTypeOfPreviousElementForProperty(FeatureAccess feature, TypesComputer computer, Environmental envs, org.eclipse.emf.ecore.resource.Resource res)Gets corresponding type of previous element forfeatureList<TypeItem>getTypes(DynamicFeatureAccess featureAccess, Environments envs)Gets type of last expression inDynamicFeatureAccessList<TypeItem>getTypesForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, org.eclipse.xtext.util.CancelIndicator cancelIndicator)Gets types for part ofDynamicFeatureAccessby indexstatic booleanisServerCall(Method method)Checks that server method can be called on client codestatic List<FeatureEntry>resolveDynamicFeatureAccess(org.eclipse.emf.ecore.EObject object, DynamicFeatureAccessComputer dynamicComputer)Gets actual model object by grammar objectstatic List<FeatureEntry>resolveDynamicFeatureAccess(org.eclipse.emf.ecore.EObject object, DynamicFeatureAccessComputer dynamicComputer, boolean mockItemsAllowed)Gets actual model object by grammar objectstatic EventresolveEvent(DynamicFeatureAccess feature, TypesComputer computer)Try to resolveDynamicFeatureAccessasEventList<FeatureEntry>resolveObject(FeatureAccess featureAccess, Environments envs)Gets object fromFeatureAccessand resolves itList<FeatureEntry>resolveObject(FeatureAccess featureAccess, Environments envs, boolean mockItemsAllowed)Gets object fromFeatureAccessand resolves it
 
- 
- 
- 
Method Detail- 
resolveDynamicFeatureAccesspublic static List<FeatureEntry> resolveDynamicFeatureAccess(org.eclipse.emf.ecore.EObject object, DynamicFeatureAccessComputer dynamicComputer) Gets actual model object by grammar object- Parameters:
- object- BSL grammar object
- dynamicComputer- actual- DynamicFeatureAccessComputer
- Returns:
- list of model object in FeatureEntry(Type,Method,Property)
 
 - 
resolveDynamicFeatureAccesspublic static List<FeatureEntry> resolveDynamicFeatureAccess(org.eclipse.emf.ecore.EObject object, DynamicFeatureAccessComputer dynamicComputer, boolean mockItemsAllowed) Gets actual model object by grammar object- Parameters:
- object- BSL grammar object
- dynamicComputer- actual- DynamicFeatureAccessComputer
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- Returns:
- list of model object in FeatureEntry(Type,Method,Property)
 
 - 
resolveEventpublic static Event resolveEvent(DynamicFeatureAccess feature, TypesComputer computer) Try to resolveDynamicFeatureAccessasEvent- Parameters:
- feature-- DynamicFeatureAccessfor resolving
- computer- actual- TypesComputer
- Returns:
- Eventif it was resolved or- null
 
 - 
isServerCallpublic static boolean isServerCall(Method method) Checks that server method can be called on client code- Parameters:
- method- checking method, cannot be- null
- Returns:
- trueif that sever call,- falseotherwise
 
 - 
getObjectFromContextDefOfTypespublic List<FeatureEntry> getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, int numParam, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets corresponding by name, if we know parent types inDynamicFeatureAccess- Parameters:
- neighbourTypes- types of left neighbors
- envs- current environments, cannot be- null
- name- name of object
- numParam- matters for method objects @see Method (for properties value should be -1)
- res- for resolving proxy, cannot be- null
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- corresponding list of FeatureEntryor empty list
 
 - 
getObjectFromContextDefOfTypespublic List<FeatureEntry> getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, int numParam, boolean mockItemsAllowed, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets corresponding by name, if we know parent types inDynamicFeatureAccess- Parameters:
- neighbourTypes- types of left neighbors
- envs- current environments, cannot be- null
- name- name of object
- numParam- matters for method objects @see Method (for properties value should be -1)
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- res- for resolving proxy, cannot be- null
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- corresponding list of FeatureEntryor empty list
 
 - 
getObjectFromContextDefOfTypespublic List<FeatureEntry> getObjectFromContextDefOfTypes(Collection<TypeItem> neighbourTypes, Environments envs, String name, boolean mockItemsAllowed, org.eclipse.emf.ecore.resource.Resource res, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets corresponding by name, if we know parent types inDynamicFeatureAccess- Parameters:
- neighbourTypes- types of left neighbors
- envs- current environments, cannot be- null
- name- name of object, cannot be- null
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- res- for resolving proxy, cannot be- null
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- corresponding list of FeatureEntryor empty list
 
 - 
dividedIntoPartspublic List<org.eclipse.emf.ecore.EObject> dividedIntoParts(DynamicFeatureAccess featureAccess) Divides into partsDynamicFeatureAccess- Parameters:
- featureAccess- grammar element
- Returns:
- list of parts EObjectfrom right to left, nevernull
 
 - 
getTypespublic List<TypeItem> getTypes(DynamicFeatureAccess featureAccess, Environments envs) Gets type of last expression inDynamicFeatureAccess- Parameters:
- featureAccess- grammar element
- envs- corresponding- Environments
- Returns:
- list of TypeItem, nevernull
 
 - 
getAllMethodAndPropertiespublic Collection<org.eclipse.xtext.util.Triple<Collection<Method>,Collection<Property>,TypeItem>> getAllMethodAndProperties(List<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets all properties and methods from allTypeItem- Parameters:
- list- of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of properties and methods with corresponding type, never null
 
 - 
getAllMethodspublic Collection<org.eclipse.xtext.util.Pair<Collection<Method>,TypeItem>> getAllMethods(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets all methods from allTypeItem- Parameters:
- list- of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of methods with corresponding type, never null
 
 - 
getAllMethodsWithoutRefContextDefpublic Collection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>> getAllMethodsWithoutRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets all methods from allTypeItemwithout methods from reference contextDef of type- Parameters:
- types- list of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of methods with corresponding type, never null
 
 - 
getAllMethodsFromRefContextDefpublic Collection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>> getAllMethodsFromRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets only methods from all reference contextDef ofTypeItem- Parameters:
- types- list of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of methods with corresponding type, never null
 
 - 
getAllMockMethodsFromRefContextDefpublic Collection<org.eclipse.xtext.util.Pair<Collection<com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer.IMethodProvider>,TypeItem>> getAllMockMethodsFromRefContextDef(Collection<TypeItem> types, String methodName, org.eclipse.emf.ecore.resource.Resource res) Gets only methods from all reference contextDef ofTypeItem- Parameters:
- types- list of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of methods with corresponding type, never null
 
 - 
getAllMockPropertiesFromRefContextDefpublic Collection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>> getAllMockPropertiesFromRefContextDef(Collection<TypeItem> types, String propertyName, org.eclipse.emf.ecore.resource.Resource res) Gets only properties from all reference contextDef ofTypeItem- Parameters:
- types- list of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of properties with corresponding type, never null
 
 - 
getAllPropertiespublic Collection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>> getAllProperties(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets all properties from allTypeItem- Parameters:
- types- list of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of properties with corresponding type, never null
 
 - 
getAllPropertiesFromRefContextDefpublic Collection<org.eclipse.xtext.util.Pair<Collection<Property>,TypeItem>> getAllPropertiesFromRefContextDef(Collection<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets only properties from all reference contextDef ofTypeItem- Parameters:
- list- of types, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- list of properties with corresponding type, never null
 
 - 
resolveObjectpublic List<FeatureEntry> resolveObject(FeatureAccess featureAccess, Environments envs) Gets object fromFeatureAccessand resolves it- Parameters:
- featureAccess- current- FeatureAccess, cannot be- null
- envs- current- Environments, cannot be- null
- Returns:
- list of resolve FeatureEntryor empty list, nevernull
 
 - 
resolveObjectpublic List<FeatureEntry> resolveObject(FeatureAccess featureAccess, Environments envs, boolean mockItemsAllowed) Gets object fromFeatureAccessand resolves it- Parameters:
- featureAccess- current- FeatureAccess, cannot be- null
- envs- current- Environments, cannot be- null
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- Returns:
- list of resolve FeatureEntryor empty list, nevernull
 
 - 
getLastObjectpublic List<FeatureEntry> getLastObject(DynamicFeatureAccess featureAccess, Environments envs) Gets last object inDynamicFeatureAccessand resolves it- Parameters:
- featureAccess- current- DynamicFeatureAccess, cannot be- null
- envs- current- Environments, cannot be- null
- Returns:
- list of resolve FeatureEntryor empty list, nevernull
 
 - 
getLastObjectpublic List<FeatureEntry> getLastObject(DynamicFeatureAccess featureAccess, Environments envs, boolean mockItemsAllowed) Gets last object inDynamicFeatureAccessand resolves it- Parameters:
- featureAccess- current- DynamicFeatureAccess, cannot be- null
- envs- current- Environments, cannot be- null
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- Returns:
- list of resolve FeatureEntryor empty list, nevernull
 
 - 
getLastObjectpublic List<FeatureEntry> getLastObject(IndexAccess indexAccess, Environments envs, boolean mockItemsAllowed) Gets last object inIndexAccessand resolves it- Parameters:
- indexAccess- current- IndexAccess, cannot be- null
- envs- current- Environments, cannot be- null
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- Returns:
- list of resolve FeatureEntryor empty list, nevernull
 
 - 
getObjectForPartByIndexpublic List<FeatureEntry> getObjectForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets resolve part ofDynamicFeatureAccessby index- Parameters:
- parts- all parts of- DynamicFeatureAccess
- index- number of part (left to right)
- envs- corresponding- Environments
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- resolve list of FeatureEntry, nevernull
 
 - 
getObjectForPartByIndexpublic List<FeatureEntry> getObjectForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, boolean mockItemsAllowed, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets resolve part ofDynamicFeatureAccessby index- Parameters:
- parts- all parts of- DynamicFeatureAccess
- index- number of part (left to right)
- envs- corresponding- Environments
- mockItemsAllowed-- trueif allowed for- FeatureEntry.getFeature()return mock of exported user methods and properties. Mock exported user methods is special- Methodwithout resource and container, which contains right name of the export method, right properties: isRetval, isDeprecated, isServerCall, source uri to the real method in module, min parameters count and information about each parameter - out or not Mock exported user properties is special- Propertywithout resource and container, which contains right name of the export property, right properties: environments source uri to the real property in module
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- resolve list of FeatureEntry, nevernull
 
 - 
getTypesForPartByIndexpublic List<TypeItem> getTypesForPartByIndex(List<org.eclipse.emf.ecore.EObject> parts, int index, Environments envs, org.eclipse.xtext.util.CancelIndicator cancelIndicator) Gets types for part ofDynamicFeatureAccessby index- Parameters:
- parts- all parts of- DynamicFeatureAccess
- index- number of part (left to right)
- envs- corresponding- Environments
- cancelIndicator- cancel indicator that allows early interruption of the computation. May not be- null
- Returns:
- list of corresponding TypeItem
 
 - 
getTypeOfPreviousElementForMethodpublic TypeItem getTypeOfPreviousElementForMethod(FeatureAccess feature, int numParam, TypesComputer computer, Environmental envs, org.eclipse.emf.ecore.resource.Resource res) Gets corresponding type of previous element forfeature- Parameters:
- feature- must be- DynamicFeatureAccess, if it's not true- nullwill be returned
- numParam- matters for method objects @see Method
- computer-- TypesComputer
- envs- actual- Environments
- res- actual- Resource
- Returns:
- found TypeItemornull
 
 - 
getTypeOfPreviousElementForPropertypublic TypeItem getTypeOfPreviousElementForProperty(FeatureAccess feature, TypesComputer computer, Environmental envs, org.eclipse.emf.ecore.resource.Resource res) Gets corresponding type of previous element forfeature- Parameters:
- feature- must be- DynamicFeatureAccess, if it's not true- nullwill be returned
- computer-- TypesComputer, cannot be- null
- envs- actual- Environments, cannot be- null
- res- actual- Resource, cannot be- null
- Returns:
- found TypeItemornull
 
 - 
getCorrespondingTypepublic TypeItem getCorrespondingType(List<TypeItem> neighbourTypes, Environments envs, String name, int numParam, org.eclipse.emf.ecore.resource.Resource res) Gets corresponding type by name from methods, if we know parent types inDynamicFeatureAccess- Parameters:
- neighbourTypes- types of left neighbors
- envs- actual- Environments, cannot be- null
- name- name of object, cannot be- null
- numParam- matters for method objects @see Method
- res- actual resource for resolving objects, cannot be- null
- Returns:
- corresponding list TypeItem
 
 - 
getCorrespondingTypepublic TypeItem getCorrespondingType(Collection<TypeItem> neighbourTypes, Environments envs, String name, org.eclipse.emf.ecore.resource.Resource res) Gets corresponding type by name from properties, if we know parent types inDynamicFeatureAccess- Parameters:
- neighbourTypes- types of left neighbors
- envs- actual- Environments, cannot be- null
- name- name of object, cannot be- null
- res- actual resource for resolving objects, cannot be- null
- Returns:
- corresponding TypeItem, can benull
 
 - 
clearCachedValuespublic void clearCachedValues() Deleting all cached values
 
- 
 
-