Package net.fabricmc.accesswidener
Class AccessWidenerWriter
java.lang.Object
net.fabricmc.accesswidener.AccessWidenerWriter
- All Implemented Interfaces:
AccessWidenerVisitor
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a writer that writes using the latest version.AccessWidenerWriter
(int version) Constructs a writer that writes an access widener in the given version. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visitClass
(String name, AccessWidenerReader.AccessType access, boolean transitive) Visits a widened class.void
visitField
(String owner, String name, String descriptor, AccessWidenerReader.AccessType access, boolean transitive) Visits a widened field.void
visitHeader
(String namespace) Visits the header data.void
visitMethod
(String owner, String name, String descriptor, AccessWidenerReader.AccessType access, boolean transitive) Visits a widened method.byte[]
write()
-
Constructor Details
-
AccessWidenerWriter
public AccessWidenerWriter(int version) Constructs a writer that writes an access widener in the given version. If features not supported by the version are used, an exception is thrown. -
AccessWidenerWriter
public AccessWidenerWriter()Constructs a writer that writes using the latest version.
-
-
Method Details
-
visitHeader
Description copied from interface:AccessWidenerVisitor
Visits the header data.- Specified by:
visitHeader
in interfaceAccessWidenerVisitor
- Parameters:
namespace
- the access widener's mapping namespace
-
visitClass
Description copied from interface:AccessWidenerVisitor
Visits a widened class.- Specified by:
visitClass
in interfaceAccessWidenerVisitor
- Parameters:
name
- the name of the classaccess
- the access type (AccessWidenerReader.AccessType.ACCESSIBLE
orAccessWidenerReader.AccessType.EXTENDABLE
)transitive
- whether this widener should be applied across mod boundaries
-
visitMethod
public void visitMethod(String owner, String name, String descriptor, AccessWidenerReader.AccessType access, boolean transitive) Description copied from interface:AccessWidenerVisitor
Visits a widened method.- Specified by:
visitMethod
in interfaceAccessWidenerVisitor
- Parameters:
owner
- the name of the containing classname
- the name of the methoddescriptor
- the method descriptoraccess
- the access type (AccessWidenerReader.AccessType.ACCESSIBLE
orAccessWidenerReader.AccessType.EXTENDABLE
)transitive
- whether this widener should be applied across mod boundaries
-
visitField
public void visitField(String owner, String name, String descriptor, AccessWidenerReader.AccessType access, boolean transitive) Description copied from interface:AccessWidenerVisitor
Visits a widened field.- Specified by:
visitField
in interfaceAccessWidenerVisitor
- Parameters:
owner
- the name of the containing classname
- the name of the fielddescriptor
- the type of the field as a type descriptoraccess
- the access type (AccessWidenerReader.AccessType.ACCESSIBLE
orAccessWidenerReader.AccessType.MUTABLE
)transitive
- whether this widener should be applied across mod boundaries
-
write
public byte[] write() -
writeString
-