public interface Transformer
Transformer is the basic building block for transforming entries read from a JAR file.
Transformers can be registered to a Renamer.Builder to run over all entries.| Modifier and Type | Interface and Description |
|---|---|
static interface |
Transformer.ClassEntry
A
ClassEntry represents a class file entry in a JAR file. |
static interface |
Transformer.Context
Context providing renamer state when creating a transformer.
|
static interface |
Transformer.Entry
A
Entry is a single entry representing an entry in a JAR file. |
static interface |
Transformer.Factory
A factory to create transformers using
Renamer instance-specific information. |
static interface |
Transformer.JavadoctorEntry
A
JavadoctorEntry represents a javadoctor.json entry in a JAR file. |
static interface |
Transformer.ManifestEntry
A
ManifestEntry represents a manifest entry in a JAR file. |
static interface |
Transformer.ResourceEntry
A
ResourceEntry represents a generic resource entry in a JAR file
that is not a class file, manifest or javadoctor.json file. |
| Modifier and Type | Method and Description |
|---|---|
static Transformer.Factory |
fernFlowerLineFixerFactory(java.io.File sourceJar)
Create a transformer that applies line number corrections from Fernflower.
|
default java.util.Collection<? extends Transformer.Entry> |
getExtras()
Returns extra entries to add to the JAR file.
|
static Transformer.Factory |
identifierFixerFactory(IdentifierFixerConfig config)
Create a transformer that renames any local variables that are not valid java identifiers.
|
static Transformer.Factory |
parameterAnnotationFixerFactory()
Create a transformer that fixes misaligned parameter annotations caused by Proguard.
|
default Transformer.ClassEntry |
process(Transformer.ClassEntry entry)
Processes a class entry and returns the transformed entry.
|
default Transformer.JavadoctorEntry |
process(Transformer.JavadoctorEntry entry)
Processes a javadoctor entry and returns the transformed entry.
|
default Transformer.ManifestEntry |
process(Transformer.ManifestEntry entry)
Processes a manifest entry and returns the transformed entry.
|
default Transformer.ResourceEntry |
process(Transformer.ResourceEntry entry)
Processes a resource entry and returns the transformed entry.
|
static Transformer.Factory |
recordFixerFactory()
Create a transformer that restores record component data stripped by ProGuard.
|
static Transformer.Factory |
renamerFactory(net.minecraftforge.srgutils.IMappingFile map)
Deprecated.
use
renamerFactory(IMappingFile, boolean) insteead |
static Transformer.Factory |
renamerFactory(net.minecraftforge.srgutils.IMappingFile map,
boolean collectAbstractParams)
Create a transformer that applies mappings as a transformation.
|
static Transformer.Factory |
signatureStripperFactory(SignatureStripperConfig config)
Create a transformer that strips invalid code signing signatures from a manifest.
|
static Transformer.Factory |
sourceFixerFactory(SourceFixerConfig config)
Create a transformer that fixes the
SourceFile attribute of classes. |
default Transformer.ClassEntry process(Transformer.ClassEntry entry)
entry - the original entrydefault Transformer.ManifestEntry process(Transformer.ManifestEntry entry)
entry - the original entrydefault Transformer.ResourceEntry process(Transformer.ResourceEntry entry)
entry - the original entrydefault Transformer.JavadoctorEntry process(Transformer.JavadoctorEntry entry)
entry - the original entrydefault java.util.Collection<? extends Transformer.Entry> getExtras()
static Transformer.Factory renamerFactory(net.minecraftforge.srgutils.IMappingFile map, boolean collectAbstractParams)
map - the mapping information to remap withcollectAbstractParams - whether to collect abstract parameter names for FernFlower@Deprecated static Transformer.Factory renamerFactory(net.minecraftforge.srgutils.IMappingFile map)
renamerFactory(IMappingFile, boolean) insteeadmap - the mapping information to remap withstatic Transformer.Factory identifierFixerFactory(IdentifierFixerConfig config)
config - option for which local variables to renamestatic Transformer.Factory parameterAnnotationFixerFactory()
static Transformer.Factory fernFlowerLineFixerFactory(java.io.File sourceJar)
sourceJar - the source jarstatic Transformer.Factory recordFixerFactory()
static Transformer.Factory sourceFixerFactory(SourceFixerConfig config)
SourceFile attribute of classes.
This attempts to infer a file name based on the supplied language information.
config - the method to use to generate a source file name.SourceFile informationstatic Transformer.Factory signatureStripperFactory(SignatureStripperConfig config)
config - the variants of signatures to strip