mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-24 10:34:32 +00:00
Add all missing class javadoc
This commit is contained in:
1 parent
83a9f4fb02
commit
9cd453cd63
42 files changed
+413
-11
No files matched your search
@@ -44,6 +44,10 @@ import org.spongepowered.tools.MirrorUtils;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IObfuscationManager;
|
||||
|
||||
/**
|
||||
* Base class for module for {@link AnnotatedMixin} which handle different
|
||||
* aspects of mixin target classes
|
||||
*/
|
||||
abstract class AnnotatedMixinElementHandler {
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,6 +42,9 @@ import org.spongepowered.tools.MirrorUtils;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
import org.spongepowered.tools.obfuscation.struct.Message;
|
||||
|
||||
/**
|
||||
* A module for {@link AnnotatedMixin} whic handles injectors
|
||||
*/
|
||||
class AnnotatedMixinInjectorHandler extends AnnotatedMixinElementHandler {
|
||||
|
||||
AnnotatedMixinInjectorHandler(IMixinAnnotationProcessor ap, AnnotatedMixin mixin) {
|
||||
|
||||
@@ -34,6 +34,9 @@ import org.spongepowered.asm.obfuscation.SrgMethod;
|
||||
import org.spongepowered.tools.MirrorUtils;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
|
||||
/**
|
||||
* A module for {@link AnnotatedMixin} which handles method overwrites
|
||||
*/
|
||||
class AnnotatedMixinOverwriteHandler extends AnnotatedMixinElementHandler {
|
||||
|
||||
AnnotatedMixinOverwriteHandler(IMixinAnnotationProcessor ap, AnnotatedMixin mixin) {
|
||||
|
||||
@@ -33,6 +33,9 @@ import org.spongepowered.asm.obfuscation.SrgMethod;
|
||||
import org.spongepowered.tools.MirrorUtils;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
|
||||
/**
|
||||
* A module for {@link AnnotatedMixin} which handles shadowed fields and methods
|
||||
*/
|
||||
class AnnotatedMixinShadowHandler extends AnnotatedMixinElementHandler {
|
||||
|
||||
AnnotatedMixinShadowHandler(IMixinAnnotationProcessor ap, AnnotatedMixin mixin) {
|
||||
|
||||
@@ -75,6 +75,10 @@ class AnnotatedMixins implements IMixinAnnotationProcessor, ITokenProvider, ITyp
|
||||
|
||||
private static final String MAPID_SYSTEM_PROPERTY = "mixin.target.mapid";
|
||||
|
||||
/**
|
||||
* Detected compiler argument, specifies the behaviour of some operations
|
||||
* for compatibility purposes.
|
||||
*/
|
||||
static enum CompilerEnvironment {
|
||||
/**
|
||||
* Default environment
|
||||
|
||||
@@ -37,6 +37,9 @@ import javax.tools.Diagnostic.Kind;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
/**
|
||||
* Base class for mixin annotation processor modules
|
||||
*/
|
||||
public abstract class MixinProcessor extends AbstractProcessor {
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,23 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.spongepowered.asm.obfuscation.SrgMethod;
|
||||
|
||||
/**
|
||||
* Return value struct for various obfuscation queries performed by the mixin
|
||||
* annotation processor.
|
||||
*
|
||||
* <p>When obfuscation queries are performed by the AP, the returned data are
|
||||
* encapsulated in an <tt>ObfuscationData</tt> object which contains a mapping
|
||||
* of the different obfuscation types to the respective remapped value of the
|
||||
* original entry for that environment.</p>
|
||||
*
|
||||
* <p>The returned data are iterable over the keys, consumers should call
|
||||
* {@link #get} to retrieve the remapped entries for each key.</p>
|
||||
*
|
||||
* @param <T> Contained type of the data, usually {@link String} for field
|
||||
* and type obfuscations, and {@link SrgMethod} for methods.
|
||||
*/
|
||||
public class ObfuscationData<T> implements Iterable<ObfuscationType> {
|
||||
|
||||
private final Map<ObfuscationType, T> data = new HashMap<ObfuscationType, T>();
|
||||
|
||||
@@ -43,6 +43,9 @@ import org.spongepowered.asm.util.Constants;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IObfuscationManager;
|
||||
|
||||
/**
|
||||
* Obfuscation Manager for mixin Annotation Processor
|
||||
*/
|
||||
public class ObfuscationManager implements IObfuscationManager {
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,14 +31,43 @@ import org.spongepowered.tools.obfuscation.interfaces.IOptionProvider;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
|
||||
/**
|
||||
* Obfuscation types supported by the annotation processor
|
||||
*/
|
||||
enum ObfuscationType {
|
||||
|
||||
/**
|
||||
* "SEARGE" mappings, these are unique mappings used by MCP and derived
|
||||
* projects
|
||||
*/
|
||||
SRG("searge", SupportedOptions.REOBF_SRG_FILE, SupportedOptions.REOBF_EXTRA_SRG_FILES, SupportedOptions.OUT_SRG_SRG_FILE),
|
||||
|
||||
/**
|
||||
* "NOTCH" mappings, internal to minecraft only
|
||||
*/
|
||||
NOTCH("notch", SupportedOptions.REOBF_NOTCH_FILE, SupportedOptions.REOBF_EXTRA_NOTCH_FILES, SupportedOptions.OUT_NOTCH_SRG_FILE);
|
||||
|
||||
/**
|
||||
* Refmap key for this mapping type
|
||||
*/
|
||||
private final String key;
|
||||
|
||||
/**
|
||||
* The name of the Annotation Processor argument which contains the file
|
||||
* name to read the SRGs for this obfuscation type from
|
||||
*/
|
||||
private final String srgFileArgName;
|
||||
|
||||
/**
|
||||
* The name of the Annotation Processor argument which contains the file
|
||||
* name to read the extra SRGs for this obfuscation type from
|
||||
*/
|
||||
private final String extraSrgFilesArgName;
|
||||
|
||||
/**
|
||||
* The name of the Annotation Processor argument which contains the file
|
||||
* name to write generated SRG mappings to
|
||||
*/
|
||||
private final String outSrgFileArgName;
|
||||
|
||||
private ObfuscationType(String displayName, String srgFileArgName, String extraSrgFilesArgName, String outSrgFileArgName) {
|
||||
|
||||
@@ -28,6 +28,10 @@ import java.util.Set;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* Supported options for the annotation processor. Not an enum mainly so that
|
||||
* the string tokens can be inlined.
|
||||
*/
|
||||
public final class SupportedOptions {
|
||||
|
||||
public static final String TOKENS = "tokens";
|
||||
|
||||
@@ -50,8 +50,18 @@ import org.spongepowered.asm.util.ObfuscationUtil;
|
||||
import org.spongepowered.asm.util.ObfuscationUtil.IClassRemapper;
|
||||
import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor;
|
||||
|
||||
/**
|
||||
* Stores information relevant to a particular target obfuscation environment.
|
||||
*
|
||||
* <p>We classify different types of possible obfuscation (eg. "searge", "notch"
|
||||
* ) as <em>obfuscation environments</em> and store related information such as
|
||||
* the input SRG mappings, generated refmap, generated SRGs, here.</p>
|
||||
*/
|
||||
class TargetObfuscationEnvironment {
|
||||
|
||||
/**
|
||||
* Remapping proxy for remapping descriptors
|
||||
*/
|
||||
final class RemapperProxy implements IClassRemapper {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,6 +37,9 @@ import org.spongepowered.tools.obfuscation.TypeHandle;
|
||||
*/
|
||||
public interface IMixinValidator {
|
||||
|
||||
/**
|
||||
* Validation pass
|
||||
*/
|
||||
public enum ValidationPass {
|
||||
EARLY,
|
||||
LATE
|
||||
|
||||
@@ -30,6 +30,10 @@ import javax.lang.model.element.AnnotationValue;
|
||||
import javax.lang.model.element.Element;
|
||||
import javax.tools.Diagnostic;
|
||||
|
||||
/**
|
||||
* Wrapper for Annotation Processor messages, used to enable messages to be
|
||||
* easily queued and manipulated
|
||||
*/
|
||||
public class Message {
|
||||
|
||||
private Diagnostic.Kind kind;
|
||||
|
||||
Reference in new issue
Block a user