Skip to content

Commit 48e2f04

Browse files
committed
javadoc
1 parent 87e5c99 commit 48e2f04

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed

class-match/src/main/java/datadog/instrument/classmatch/ClassFile.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,22 @@ public final class ClassFile {
3838

3939
private ClassFile() {}
4040

41-
/** Extracts a {@link ClassHeader} from the given class-file content. */
41+
/**
42+
* Extracts a {@link ClassHeader} from the given class-file content.
43+
*
44+
* @param bytecode the class-file content to parse
45+
* @return class header containing class-name, super-name, interfaces
46+
*/
4247
public static ClassHeader header(byte[] bytecode) {
4348
return parse(bytecode, true);
4449
}
4550

46-
/** Extracts a {@link ClassOutline} from the given class-file content. */
51+
/**
52+
* Extracts a {@link ClassOutline} from the given class-file content.
53+
*
54+
* @param bytecode the class-file content to parse
55+
* @return class outline containing header, fields, methods, annotations
56+
*/
4757
public static ClassOutline outline(byte[] bytecode) {
4858
return (ClassOutline) parse(bytecode, false);
4959
}
@@ -52,6 +62,8 @@ public static ClassOutline outline(byte[] bytecode) {
5262
* Flags the given annotation as interesting; to be included in outlines.
5363
*
5464
* <p>Example: {@code ClassFile.annotationOfInterest("javax/ws/rs/Path");}
65+
*
66+
* @param internalName the name of the annotation type in internal form
5567
*/
5668
public static synchronized void annotationOfInterest(String internalName) {
5769
if (annotationKeys.containsKey(internalName)) {
@@ -70,6 +82,8 @@ public static synchronized void annotationOfInterest(String internalName) {
7082
* Flags the given annotations as interesting; to be included in outlines.
7183
*
7284
* <p>Example: {@code ClassFile.annotationsOfInterest("javax/ws/rs/Path", "jakarta/ws/rs/Path");}
85+
*
86+
* @param internalNames the names of the annotation types in internal form
7387
*/
7488
public static synchronized void annotationsOfInterest(Collection<String> internalNames) {
7589
if (annotationKeys.keySet().containsAll(internalNames)) {

class-match/src/main/java/datadog/instrument/classmatch/ClassHeader.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@
1313
/** Minimal class header that describes its access flags and immediate class hierarchy. */
1414
public class ClassHeader {
1515

16+
/** Access modifiers for this class. */
1617
public final int access;
18+
19+
/** Internal name of this class. */
1720
public final String className;
21+
22+
/** Internal name of the super-class declared by this class. */
1823
public final String superName;
24+
25+
/** Internal names of the interfaces declared by this class. */
1926
final String[] interfaces;
2027

28+
/**
29+
* @return internal names of the interfaces declared by this class.
30+
*/
2131
public List<String> interfaces() {
2232
return asList(interfaces);
2333
}

class-match/src/main/java/datadog/instrument/classmatch/ClassOutline.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,32 @@
1313
/** Outlines a class; access flags, immediate class hierarchy, field, methods, annotations. */
1414
public final class ClassOutline extends ClassHeader {
1515

16+
/** Outlines of fields declared by this class. */
1617
final FieldOutline[] fields;
18+
19+
/** Outlines of methods declared by this class. */
1720
final MethodOutline[] methods;
21+
22+
/** Internal names of annotations declared on this class. */
1823
final String[] annotations;
1924

25+
/**
26+
* @return outlines of fields declared by this class
27+
*/
2028
public List<FieldOutline> fields() {
2129
return asList(fields);
2230
}
2331

32+
/**
33+
* @return outlines of methods declared by this class
34+
*/
2435
public List<MethodOutline> methods() {
2536
return asList(methods);
2637
}
2738

39+
/**
40+
* @return internal names of annotations declared on this class
41+
*/
2842
public List<String> annotations() {
2943
return asList(annotations);
3044
}

class-match/src/main/java/datadog/instrument/classmatch/FieldOutline.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
/** Outlines a field; access flags, field name, descriptor. */
1010
public final class FieldOutline {
1111

12+
/** Access modifiers for this field. */
1213
public final int access;
14+
15+
/** Name of this field. */
1316
public final String fieldName;
17+
18+
/** Descriptor containing the raw field type. */
1419
public final String descriptor;
1520

1621
FieldOutline(int access, String fieldName, String descriptor) {

class-match/src/main/java/datadog/instrument/classmatch/MethodOutline.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@
1414
/** Outlines a method; access flags, method name, descriptor, annotations. */
1515
public final class MethodOutline {
1616

17+
/** Access modifiers for this method. */
1718
public final int access;
19+
20+
/** Name of this method. */
1821
public final String methodName;
22+
23+
/** Descriptor containing the raw parameter types and return type. */
1924
public final String descriptor;
25+
26+
/** Internal names of annotations declared on this method. */
2027
final String[] annotations;
2128

2229
private int[] descriptorBoundaries;
2330

31+
/**
32+
* @return internal names of annotations declared on this method
33+
*/
2434
public List<String> annotations() {
2535
return asList(annotations);
2636
}

0 commit comments

Comments
 (0)