Class DocCommentCollector
java.lang.Object
com.e1c.langtool.v8.dt.bsl.comment.DocCommentProcessor
com.e1c.langtool.v8.dt.bsl.comment.DocCommentCollector
- All Implemented Interfaces:
FeatureValueCollector,IBasicProcessor
- Direct Known Subclasses:
AbstractBslCommentTextProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from class com.e1c.langtool.v8.dt.bsl.comment.DocCommentProcessor
DocCommentProcessor.Parent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ITranslationFeatureKeyProviderprotected final BmOperationContextThe type computation context.Fields inherited from class com.e1c.langtool.v8.dt.bsl.comment.DocCommentProcessor
monitor, rootObject -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDocCommentCollector(org.eclipse.core.resources.IFile file, FeatureKey featureKeyPreffix, Object rootObject, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Instantiates a new doc comment collector. -
Method Summary
Modifier and TypeMethodDescriptionstatic DocCommentCollectorcreate(org.eclipse.core.resources.IFile file, FeatureKey featureKeyPreffix, BslDocumentationComment object, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Low-level factory method.protected voiddoProcess(DocCommentProcessor.Parent parent, BslDocumentationComment.Description object) Process description object to collect translatable features.protected voiddoProcess(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object) Process field defenition object to collect translatable features.protected <T> voiddoProcess(DocCommentProcessor.Parent parent, T object, Class<T> clazz) Processes concrete object of Bsl commentprotected Collection<Property>getFieldProperty(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object) Gets the one or several properties for the field definition in any position level of return section of the doc-comment.protected Collection<Property>getFieldPropertyByOrder(List<org.eclipse.xtext.util.Pair<String, String>> typeFieldOrder, List<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets the one or several properties for the last field of the given order of fields.getFunctionReturnTypeFieldOrder(DocCommentProcessor.Parent currentParent, TypeSection.FieldDefinition object) Gets the function return type field order from doc-comment.protected BmOperationContextGets a type computation context associated with this collectorprotected booleanisComputedValue(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object) Checks if field defenition name is computed value from function return property.protected booleanisRealLink(LinkPart link) protected booleanisSkipTextPart(BslDocumentationComment.Description object, TextPart part) Checks if this text part need to skip while collecting the text.protected voidsetAddAction(BiConsumer<Object, FeatureValue> addAction) Sets the collector add action.Methods inherited from class com.e1c.langtool.v8.dt.bsl.comment.DocCommentProcessor
isCanceled, processMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.IBasicProcessor
isCanceled, process
-
Field Details
-
featureKeyProvider
-
typeComputationContext
The type computation context.
-
-
Constructor Details
-
DocCommentCollector
protected DocCommentCollector(org.eclipse.core.resources.IFile file, FeatureKey featureKeyPreffix, Object rootObject, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Instantiates a new doc comment collector.- Parameters:
file- the file of module where doc-comment is, cannot benull.featureKeyPreffix- the feature key preffix, cannot benull.rootObject- the root object of doc-comment model to collect features from, cannot benull.parameters- the collecting parameters, cannot benull.addAction- the add action, cannot benull.context- the context object, cannot benull.typeComputationContext- the BM operation type computation context, cannot be {@code null
-
-
Method Details
-
create
public static DocCommentCollector create(org.eclipse.core.resources.IFile file, FeatureKey featureKeyPreffix, BslDocumentationComment object, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Low-level factory method.- Parameters:
file- the file of the modulemethod- the methodfeatureKeyPreffix- the feature key preffix, the key of the methodobject- the Method Doc Comment of newly created collector- Returns:
- the doc comment collector
- Throws:
IllegalArgumentException- if the object is null
-
setAddAction
Sets the collector add action.- Parameters:
addAction- the add action, cannot benull.
-
doProcess
Description copied from class:DocCommentProcessorProcesses concrete object of Bsl comment- Specified by:
doProcessin classDocCommentProcessorobject- processing object, can't benull
-
doProcess
protected void doProcess(DocCommentProcessor.Parent parent, BslDocumentationComment.Description object) Process description object to collect translatable features.- Parameters:
parent- the parent doc-comment object, cannot benull.object- the description object to collect, cannot benull.
-
isSkipTextPart
Checks if this text part need to skip while collecting the text.- Parameters:
object- the description object, cannot benull.part- the text part, cannot benull.- Returns:
- true, if it is need to skip the text part
-
doProcess
Process field defenition object to collect translatable features.- Parameters:
parent- the parent doc-comment object, cannot benull.object- the field defenition object to collect, cannot benull.
-
isRealLink
-
isComputedValue
protected boolean isComputedValue(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object) Checks if field defenition name is computed value from function return property.- Parameters:
parent- the parent object of doc-comment structureobject- the field defenition object- Returns:
- true, if it is computed value
-
getFieldProperty
protected Collection<Property> getFieldProperty(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object) Gets the one or several properties for the field definition in any position level of return section of the doc-comment.- Parameters:
parent- the parent doc-comment object, cannot benull.object- the field definition object, cannot benull.- Returns:
- the field property one or more that matches current field, cannot return
null.
-
getFieldPropertyByOrder
protected Collection<Property> getFieldPropertyByOrder(List<org.eclipse.xtext.util.Pair<String, String>> typeFieldOrder, List<TypeItem> types, org.eclipse.emf.ecore.resource.Resource res) Gets the one or several properties for the last field of the given order of fields.- Parameters:
typeFieldOrder- the type field order, cannot benull.types- the returning types of the function, cannot benull.res- the resource context, cannot benull.- Returns:
- the field property by order, cannot return
null.
-
getFunctionReturnTypeFieldOrder
protected List<org.eclipse.xtext.util.Pair<String,String>> getFunctionReturnTypeFieldOrder(DocCommentProcessor.Parent currentParent, TypeSection.FieldDefinition object) Gets the function return type field order from doc-comment.- Parameters:
currentParent- the current parent doc-comment object, cannot benull.object- the field definition object to find all parent fields from doc-comment, cannot benull.- Returns:
- the function return type field order, each list item is a pair of type name and field name from the type,
cannot return
null.
-
getTypeComputationContext
Gets a type computation context associated with this collector- Returns:
- The type computation context. May not be
null
-