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

public class DocCommentCollector extends DocCommentProcessor implements FeatureValueCollector
  • Field Details

  • 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 be null.
      featureKeyPreffix - the feature key preffix, cannot be null.
      rootObject - the root object of doc-comment model to collect features from, cannot be null.
      parameters - the collecting parameters, cannot be null.
      addAction - the add action, cannot be null.
      context - the context object, cannot be null.
      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 module
      method - the method
      featureKeyPreffix - the feature key preffix, the key of the method
      object - the Method Doc Comment of newly created collector
      Returns:
      the doc comment collector
      Throws:
      IllegalArgumentException - if the object is null
    • setAddAction

      protected void setAddAction(BiConsumer<Object,FeatureValue> addAction)
      Sets the collector add action.
      Parameters:
      addAction - the add action, cannot be null.
    • doProcess

      protected <T> void doProcess(DocCommentProcessor.Parent parent, T object, Class<T> clazz)
      Description copied from class: DocCommentProcessor
      Processes concrete object of Bsl comment
      Specified by:
      doProcess in class DocCommentProcessor
      object - processing object, can't be null
    • 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 be null.
      object - the description object to collect, cannot be null.
    • isSkipTextPart

      protected boolean isSkipTextPart(BslDocumentationComment.Description object, TextPart part)
      Checks if this text part need to skip while collecting the text.
      Parameters:
      object - the description object, cannot be null.
      part - the text part, cannot be null.
      Returns:
      true, if it is need to skip the text part
    • doProcess

      protected void doProcess(DocCommentProcessor.Parent parent, TypeSection.FieldDefinition object)
      Process field defenition object to collect translatable features.
      Parameters:
      parent - the parent doc-comment object, cannot be null.
      object - the field defenition object to collect, cannot be null.
    • isRealLink

      protected boolean isRealLink(LinkPart link)
    • 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 structure
      object - 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 be null.
      object - the field definition object, cannot be null.
      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 be null.
      types - the returning types of the function, cannot be null.
      res - the resource context, cannot be null.
      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 be null.
      object - the field definition object to find all parent fields from doc-comment, cannot be null.
      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

      protected BmOperationContext getTypeComputationContext()
      Gets a type computation context associated with this collector
      Returns:
      The type computation context. May not be null