44import com .igormaznitsa .jcp .exceptions .FilePositionInfo ;
55
66/**
7- * Custom processor to detect and process uncommenting text line or text block
8- * defined through //$ and //$$ directives. It can return the same value or
9- * changed one. The processor is called after ext prepared for injection into preprocessed source.
10- * If activated merge block mode for preprocessor so sequentially
11- * situated lines started with """ will be merged into single text block (and """ will be removed)
7+ * A custom processor for detecting and handling uncommenting directives in source text.
8+ * This processor recognizes lines or blocks marked with `//$` and `//$$` and can either
9+ * return them unchanged or modify them as needed. It is invoked after the external text
10+ * is prepared for injection into the preprocessed source.
11+ * If block merging is enabled, consecutive lines beginning with `"""` will be merged
12+ * into a single text block, and the `"""` markers will be removed.
1213 *
1314 * @since 7.2.0
1415 */
1516public interface CommentTextProcessor extends PreprocessorContextListener {
1617
1718 /**
18- * Process uncommented text detected in //$ or //$$ sections. If processing not needed then the provided text must be returned.
19+ * Processes uncommented text detected in `//$` or `//$$` sections.
20+ * If no transformation is needed, the original text must be returned unchanged.
1921 *
20- * @param recommendedIndent indent to be recommended for the processed text if it will be processed
21- * @param uncommentedText the text which was uncommented and needs processing, must not be null
22- * @param fileContainer the source file info container calling the processor, must not be null
23- * @param positionInfo position of the uncommented line or the first line of the uncommented text block, must not be null
24- * @param context the current preprocessor context, must not be null
25- * @param state the current preprocess state, must not be null
26- * @return must return value as the same text or as the changed one.
22+ * @param recommendedIndent the suggested indentation level for the processed text, if any modifications are applied
23+ * @param uncommentedText the text that was uncommented and is subject to processing; must not be null
24+ * @param fileContainer the container holding metadata about the source file invoking the processor; must not be null
25+ * @param positionInfo the position of the uncommented line or the first line of the uncommented block; must not be null
26+ * @param context the current preprocessor context; must not be null
27+ * @param state the current preprocessor state; must not be null
28+ * @return the processed text, which may be unchanged or modified
2729 * @since 7.2.1
2830 */
2931 String processUncommentedText (
@@ -35,10 +37,16 @@ String processUncommentedText(
3537 PreprocessingState state );
3638
3739 /**
38- * Returns flag that the preprocessor is allowed and can be called. It gets full info about current context and file so can make decision on fly.
39- * It will be called before every processor call.
40+ * Indicates whether the preprocessor is allowed to run in the current context.
41+ * This method is invoked before each call to the processor and receives complete
42+ * information about the current context and source file, enabling it to make a
43+ * dynamic decision.
4044 *
41- * @return true if the preprocessor allowed, false if not
45+ * @param fileContainer the container holding metadata about the source file invoking the processor; must not be null
46+ * @param positionInfo the position of the uncommented line or the first line of the uncommented block; must not be null
47+ * @param context the current preprocessor context; must not be null
48+ * @param state the current preprocessor state; must not be null
49+ * @return {@code true} if the preprocessor is permitted to run; {@code false} otherwise
4250 * @since 7.2.1
4351 */
4452 boolean isAllowed (
0 commit comments