Access Wideners
Creating the file
The first step is to create a file called [your project name].accessWidener
. This normally goes in the same directory as your fabric.mod.json
.
On the first line of your new file, put the following:
Then on any of the following lines, you can put a description of a class, method, or field that you wish to widen access to.
Class Access
To widen access to a class, the following format must be used:
<access>
can be either extendable or accessible. <className>
should be the full name of the class. If the class is a subclass of another class, then the format of the name should follow <outerClass>$<innerClass>
. Here's a couple examples:
Method Access
To widen access to a method, the following format must be used:
Like classes, method <access>
can either be extendable or accessible. <className>
should be the full name of the class which contains the method. <methodName>
should be the full name of the method to widen access to. <methodDesc>
should be the descriptor for the method's arguments. Here's an example:
Field Access
To widen access to a field, the following format must be used:
<access>
can either be accessible or mutable. <className>
should be the full name of the class which contains the method. <fieldName>
should be the full name of the field to widen access to. <fieldDesc>
should be the descriptor for the type of the field. Here's an example:
Examples
Last updated
Was this helpful?