Skip to content
This repository has been archived by the owner. It is now read-only.

Commit e66f256

Browse files
committed
Add readers for ClassDefinition and TypeParam
The reason why we add the new `Modifiers` constructor is to have an efficient way to instantiate `Modifiers` without passing bit per bit which flags are set. The new constructor is `protected` and hence the user of it in `converters` (`InternalApiProxy`) is placed in the `xsbti.api` package. Comments and docs have been added to ensure that no downstream user depends on it.
1 parent c3e4721 commit e66f256

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/xsbti/api/Modifiers.java

+19
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@ public Modifiers(boolean isAbstract, boolean isOverride, boolean isFinal, boolea
3737
);
3838
}
3939

40+
/**
41+
* Allow to set the modifiers from a flags byte where:
42+
*
43+
* 1. The first bit tells if has an abstract modifier.
44+
* 2. The first bit tells if has an override modifier.
45+
* 3. The first bit tells if has an final modifier.
46+
* 4. The first bit tells if has an sealed modifier.
47+
* 5. The first bit tells if has an implicit modifier.
48+
* 6. The first bit tells if has an lazy modifier.
49+
* 7. The first bit tells if has an macro modifier.
50+
* 8. The first bit tells if has an super accessor modifier.
51+
*
52+
* This method is not part of the public API and it may be removed at any point.
53+
* @param flags An instance of byte encoding the modifiers.
54+
*/
55+
protected Modifiers(byte flags) {
56+
this.flags = flags;
57+
}
58+
4059
private final byte flags;
4160

4261
private boolean flag(int bit)

0 commit comments

Comments
 (0)