You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/inspectit-ocelot-configdocsgenerator/src/main/java/inspectit/ocelot/configdocsgenerator/ConfigDocsGenerator.java
+43-1Lines changed: 43 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@
21
21
importjava.io.IOException;
22
22
importjava.lang.reflect.Field;
23
23
importjava.util.*;
24
+
importjava.util.regex.Matcher;
25
+
importjava.util.regex.Pattern;
24
26
importjava.util.stream.Collectors;
25
27
26
28
/**
@@ -29,6 +31,26 @@
29
31
*/
30
32
publicclassConfigDocsGenerator {
31
33
34
+
/**
35
+
* Map of descriptions for special input parameters.
put("_methodName", "The name of the instrumented method within which this action is getting executed.");
39
+
put("_class", "The class declaring the instrumented method within which this action is getting executed.");
40
+
put("_parameterTypes", "The types of the parameters which the instrumented method declares for which the action is executed.");
41
+
put("_this", "The this-instance in the context of the instrumented method within which this action is getting executed.");
42
+
put("_args", "The arguments with which the instrumented method was called within which this action is getting executed. The arguments are boxed if necessary and packed into an array.");
43
+
put("_returnValue", "The value returned by the instrumented method within which this action is getting executed. If the method terminated with an exception or the action is executed in the entry phase this is null.");
44
+
put("_thrown", "The exception thrown by the instrumented method within which this action is getting executed. If the method returned normally or the action is executed in the entry phase this is null.");
45
+
put("_context", "Gives direct read and write access to the current context. Can be used to implement custom data propagation.");
46
+
put("_attachments", "Allows you to attach values to objects instead of to the control flow, as done via _context.");
47
+
}};
48
+
49
+
/**
50
+
* Map of descriptions for special input parameters that can have different names matching a regex.
51
+
*/
52
+
Map<String, String> specialInputDescriptionsRegex = Collections.singletonMap("_arg\\d", "The _argN-th argument with which the instrumented method was called within which this action is getting executed.");
53
+
32
54
/**
33
55
* Generates a ConfigDocumentation from a YAML String describing an {@link InspectitConfig}.
34
56
*
@@ -163,7 +185,27 @@ private List<ActionDocs> generateActionDocs(Map<String, GenericActionSettings> a
Copy file name to clipboardExpand all lines: components/inspectit-ocelot-configdocsgenerator/src/test/java/inspectit/ocelot/configdocsgenerator/ConfigDocsGeneratorTest.java
when(actionInputDocsMock1.getDescription()).thenReturn("The _argN-th argument with which the instrumented method was called within which this action is getting executed.");
when(actionInputDocsMock2.getDescription()).thenReturn("Allows you to attach values to objects instead of to the control flow, as done via _context.");
Copy file name to clipboardExpand all lines: components/inspectit-ocelot-configdocsgenerator/src/test/resources/ConfigDocGeneratorTest/actionWithDocInYaml.yml
Copy file name to clipboardExpand all lines: components/inspectit-ocelot-configdocsgenerator/src/test/resources/ConfigDocGeneratorTest/multipleActions.yml
0 commit comments