From c1aec0fb49a907f25bc4f958586b075162c77ffc Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Sat, 6 Feb 2021 01:13:10 +0000 Subject: [PATCH] Show the javadoc some love and a bit of a facelift, improve some docs Closes #457, closes #446 --- README.MD | 2 +- build.gradle | 18 + docs/javadoc/mixin.css | 273 +++++++++ docs/javadoc/overview.html | 37 ++ docs/javadoc/resources/jdk8_stylesheet.css | 574 ++++++++++++++++++ docs/{ => javadoc/resources}/logo.png | Bin .../tools/obfuscation/SuppressedBy.java | 39 +- .../tools/obfuscation/package-info.java | 29 + .../asm/launch/package-info.java | 30 + .../platform/container/package-info.java | 29 + .../asm/launch/platform/package-info.java | 30 + .../spongepowered/asm/mixin/Implements.java | 8 +- .../spongepowered/asm/mixin/Intrinsic.java | 42 +- .../org/spongepowered/asm/mixin/Mixin.java | 48 +- .../org/spongepowered/asm/mixin/Pseudo.java | 45 +- .../asm/mixin/connect/package-info.java | 29 + .../asm/mixin/extensibility/package-info.java | 30 + .../asm/mixin/gen/package-info.java | 32 + .../mixin/gen/throwables/package-info.java | 29 + .../asm/mixin/injection/InjectionPoint.java | 21 +- .../asm/mixin/injection/ModifyArg.java | 48 +- .../asm/mixin/injection/ModifyVariable.java | 17 +- .../asm/mixin/injection/Redirect.java | 40 +- .../asm/mixin/injection/Slice.java | 2 +- .../injection/callback/package-info.java | 30 + .../mixin/injection/code/package-info.java | 29 + .../injection/invoke/RedirectInjector.java | 2 +- .../injection/invoke/arg/package-info.java | 32 + .../mixin/injection/invoke/package-info.java | 29 + .../injection/invoke/util/package-info.java | 29 + .../mixin/injection/modify/package-info.java | 31 + .../asm/mixin/injection/package-info.java | 30 + .../injection/points/BeforeConstant.java | 24 +- .../injection/points/BeforeFieldAccess.java | 33 +- .../asm/mixin/injection/points/BeforeNew.java | 10 +- .../injection/points/BeforeStringInvoke.java | 2 +- .../mixin/injection/points/package-info.java | 30 + .../selectors/dynamic/package-info.java | 29 + .../injection/selectors/package-info.java | 31 + .../mixin/injection/struct/MemberInfo.java | 48 +- .../mixin/injection/struct/package-info.java | 29 + .../injection/throwables/package-info.java | 29 + .../spongepowered/asm/mixin/package-info.java | 34 ++ .../asm/mixin/refmap/package-info.java | 31 + .../asm/mixin/struct/package-info.java | 29 + .../asm/mixin/throwables/package-info.java | 29 + .../asm/mixin/transformer/ClassInfo.java | 8 +- .../asm/mixin/transformer/InterfaceInfo.java | 2 +- .../asm/mixin/transformer/MethodMapper.java | 2 +- .../asm/mixin/transformer/MixinProcessor.java | 2 +- .../ext/extensions/package-info.java | 29 + .../mixin/transformer/ext/package-info.java | 30 + .../mixin/transformer/meta/package-info.java | 29 + .../asm/mixin/transformer/package-info.java | 29 + .../transformer/throwables/package-info.java | 29 + .../mapping/common/package-info.java | 29 + .../obfuscation/mapping/fg3/package-info.java | 30 + .../obfuscation/mapping/mcp/package-info.java | 29 + .../asm/obfuscation/mapping/package-info.java | 29 + .../asm/obfuscation/package-info.java | 30 + .../org/spongepowered/asm/package-info.java | 29 + .../asm/service/package-info.java | 31 + .../asm/transformers/package-info.java | 29 + .../asm/util/asm/package-info.java | 30 + .../asm/util/logging/package-info.java | 30 + .../spongepowered/asm/util/package-info.java | 30 + .../asm/util/perf/package-info.java | 29 + 67 files changed, 2406 insertions(+), 161 deletions(-) create mode 100644 docs/javadoc/mixin.css create mode 100644 docs/javadoc/overview.html create mode 100644 docs/javadoc/resources/jdk8_stylesheet.css rename docs/{ => javadoc/resources}/logo.png (100%) create mode 100644 src/ap/java/org/spongepowered/tools/obfuscation/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/launch/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/launch/platform/container/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/launch/platform/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/connect/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/extensibility/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/gen/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/gen/throwables/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/callback/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/code/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/invoke/arg/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/invoke/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/modify/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/points/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/selectors/dynamic/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/selectors/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/struct/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/injection/throwables/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/refmap/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/struct/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/throwables/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/transformer/ext/extensions/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/transformer/ext/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/transformer/meta/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/transformer/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/mixin/transformer/throwables/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/obfuscation/mapping/common/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/obfuscation/mapping/fg3/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/obfuscation/mapping/mcp/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/obfuscation/mapping/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/obfuscation/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/service/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/transformers/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/util/asm/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/util/logging/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/util/package-info.java create mode 100644 src/main/java/org/spongepowered/asm/util/perf/package-info.java diff --git a/README.MD b/README.MD index 6c5b29bb..e35254d8 100644 --- a/README.MD +++ b/README.MD @@ -1,7 +1,7 @@ ### [![Build Status](http://ci.liteloader.com/view/Other/job/Mixin/badge/icon)](http://ci.liteloader.com/view/Other/job/Mixin/lastSuccessfulBuild/) -![Mixin Logo](docs/logo.png?raw=true) +![Mixin Logo](docs/javadoc/resources/logo.png?raw=true) **Mixin** is a trait/mixin framework for Java using [ASM](http://asm.ow2.org/) and hooking into the runtime class-loading process via Mojang's diff --git a/build.gradle b/build.gradle index 5024ef9a..835530b1 100644 --- a/build.gradle +++ b/build.gradle @@ -94,6 +94,8 @@ sourceSets { } launchwrapper { compileClasspath += main.output + sourceCompatibility = '1.8' + targetCompatibility = '1.8' } modlauncher { compileClasspath += main.output @@ -170,7 +172,23 @@ dependencies { } javadoc { + exclude '**/throwables' classpath += sourceSets.legacy.output + source sourceSets.ap.allJava + exclude { + it.relativePath.file && it.relativePath.pathString =~ 'tools' && !(it.name =~ /SuppressedBy|package-info/) } + options { + docTitle 'Welcome to the Mixin Javadoc' + overview 'docs/javadoc/overview.html' + stylesheetFile file('docs/javadoc/mixin.css') + addBooleanOption '-allow-script-in-comments', true + } + doLast { + copy { + from 'docs/javadoc/resources' + into outputDirectory + } + } } // Eclipse diff --git a/docs/javadoc/mixin.css b/docs/javadoc/mixin.css new file mode 100644 index 00000000..fbebec3a --- /dev/null +++ b/docs/javadoc/mixin.css @@ -0,0 +1,273 @@ +@import url('jdk8_stylesheet.css'); + +/* Montserrat font, for sponge style */ +@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900'); + +span.summary { + clear: both; + display: block; +} + +span.summary.p { + padding: 12px 0; +} + +span.summary hr { + color: transparent; + margin: 8px; +} + +.subTitle .block .summary { + margin-block-start: 0; +} + +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor, .rowColor { + background-color:#FFFFFF; +} + +/* altColor and rowColor get screwed up by hidden classes so just use css */ +tr.altColor:nth-child(even), tr.rowColor:nth-child(even) { + background: #EEE; +} + +sup { + font-size:8px; +} + +tt { + color: #6c4e0b; +} + +code i, dt i { + color: #996c0c; +} + +a:link, a:visited, code b { + color: #c79015; +} + +a:hover, a:focus, a:active, code em { + color: #e8aa21; +} + +code b, code em, code i, dt i { + font-style: normal; + font-weight: normal; +} + +ins { + background-color: #ffd26d; + text-decoration: none; +} + +del { + color: #AAA; + text-decoration: none; +} + +table.infoTable { + border-collapse: collapse; +} + +table.infoTable td, table.infoTable th, table.cellTable td, table.cellTable th { + padding: 6px 8px; + background-color: #F0F0F0; +} + +table.cellTable th, table.cellTable td { + text-align: center; +} + +table.infoTable th, table.cellTable th, table.infoTable td.th, table.cellTable td.th { + background-color: #CCC; + font-weight: bold; +} + +a[name] { + color: #353833; +} + +a[name]:hover { + text-decoration:none; + color: #353833; +} + +body { + background-color: #FFF; +} + +body, div.block { + font-family: Tahoma, sans-serif, sans; + font-size: 15px; +} + +.indexContainer, +td.colFirst, th.colFirst, td.colLast, th.colLast, td.colOne, th.colOne, +.indexHeader h1, .header ul li, .footer ul li { + font-size: 16px; +} + +.indexHeader span { + font-size: 24px; +} + +.indexHeader h1 { + font-size:13px; +} + +.indexContainer h2 { + font-size: 17px; +} + +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; +} + +.bar { + font-size: 17px; +} + +.tab { + color: #FFFFFF; +} + +.topNav, .bottomNav, .bar { + color: #FFFFFF; + background-color: #666; +} + +.topNav, .bottomNav { + font-size: 16px; +} + +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; +} + +.subNav { + background-color: #CCC; + font-size: 15px; +} + +.navBarCell1Rev { + background-color: #e8aa21; + color: #000; +} + +.header ul li, .footer ul li { + font-size:13px; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + background-color: #e8aa21; + padding: 6px 12px; + height: auto; + font-family: Montserrat; + text-transform: uppercase; +} + +.memberSummary caption span.activeTableTab span { + background-color: #e8aa21; + padding: 6px 12px; + height: auto; + border-bottom: 2px solid #e8aa21; +} + +.memberSummary caption span.tableTab span { + background-color: #666; + padding: 6px 12px; + height: auto; + border-bottom: 2px solid white; +} + +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + border-width: 2px; +} + +.title, h1, h2, h3, h4, h5, h6, .h1 { + font-family: 'Montserrat'; +} + +.title { + font-weight: 700; + color: #666; +} + +h1.overviewTitle, .header img { + margin: 32px 0 0 0; +} + +h1, .h1 { + font-weight: bold; + font-size: 45px; +} + +h2 { + font-size: 32px; +} + +h3 { + font-style: normal; +} + +h1.title, .summary.h1 { + text-transform: uppercase; +} + +pre, code, tt, dt code, table tr td dt code { + font-family: 'Consolas', monospace; + font-size: 16px; +} + +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size: 15px; +} + +.contentContainer .description .block dl dt { + background: #CCC; + display: inline-block; + padding: 6px 12px; + margin-left: 20px; +} + +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + font-family: Tahoma, sans-serif, sans; + font-size: 15px; +} + +.contentContainer .description .block dl dd { + background: #F0F0F0; + margin: -6px 0 0 40px; + padding: 12px; +} + +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4, ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color: #CCC; + border: 0; + margin: 0 0 6px -8px; + padding: 9px 12px; +} + +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background: #CCC; + padding: 8px; +} + +blockquote { + background-color: #F5F5F5; + padding: 12px 40px; + margin: 12px 0; +} + +blockquote pre { + margin: 0; +} + +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding-top: 1px; + border: 0; + background-color: #F5F5F5; +} diff --git a/docs/javadoc/overview.html b/docs/javadoc/overview.html new file mode 100644 index 00000000..8d52d610 --- /dev/null +++ b/docs/javadoc/overview.html @@ -0,0 +1,37 @@ + +

+ Mixin is a trait/mixin framework for Java using + ASM and hooking into + the runtime class-loading process via Mojang's + + LegacyLauncher system. The main documentation for Mixin can + be found in the + + Wiki. +

+ +

+ This Javadoc contains documentation for individual features and + annotations. For additional help use the channel + #mixin + on the Sponge Discord Server. +

+ + + diff --git a/docs/javadoc/resources/jdk8_stylesheet.css b/docs/javadoc/resources/jdk8_stylesheet.css new file mode 100644 index 00000000..98055b22 --- /dev/null +++ b/docs/javadoc/resources/jdk8_stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/logo.png b/docs/javadoc/resources/logo.png similarity index 100% rename from docs/logo.png rename to docs/javadoc/resources/logo.png diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/SuppressedBy.java b/src/ap/java/org/spongepowered/tools/obfuscation/SuppressedBy.java index 70ecf4f6..c8c50547 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/SuppressedBy.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/SuppressedBy.java @@ -24,6 +24,8 @@ */ package org.spongepowered.tools.obfuscation; +import org.spongepowered.asm.mixin.Overwrite; + /** * A centralised list of tokens supported by the AP for use in * {@link SuppressWarnings} annotations. Collected here mainly for @@ -33,52 +35,79 @@ public enum SuppressedBy { /** * Suppress warnings for constraint violations + *
Usage: + * @SuppressWarnings('constraints') + *
*/ CONSTRAINTS("constraints"), /** * Suppress warnings about overwrite visibility upgrading/downgrading target * visibility + *
Usage: + * @SuppressWarnings('visibility') + *
*/ VISIBILITY("visibility"), /** * Suppress warnings when an injector target cannot be found + *
Usage: + * @SuppressWarnings('target') + *
*/ TARGET("target"), /** * Suppress warnings when a class, method or field mapping cannot be located + *
Usage: + * @SuppressWarnings('mapping') + *
*/ MAPPING("mapping"), /** - * Suppress warnings for when an @Overwrite method is missing - * javadoc, or author or reason tags + * Suppress warnings for when an {@link Overwrite @Overwrite} method is + * missing javadoc, or author or reason tags + *
Usage: + * @SuppressWarnings('overwrite') + *
*/ OVERWRITE("overwrite"), /** * Suppress warnings when a mixin target specified by name is located in the * default package + *
Usage: + * @SuppressWarnings('default-package') + *
*/ DEFAULT_PACKAGE("default-package"), /** * Suppress warnings when a mixin target is resolved by the AP as visible * but cannot be referenced with a class literal for some reason + *
Usage: + * @SuppressWarnings('public-target') + *
*/ PUBLIC_TARGET("public-target"), /** - * Suppress warning when a mixin target is resolved by the AP as imaginary - * (unresolvable via Mirror at compile time). For example for anonymous - * inner classes or other synthetic member classes. + * Suppress warning when a mixin target is resolved by the AP as imaginary + * (unresolvable via Mirror at compile time), for example for anonymous + * inner classes or other synthetic member classes + *
Usage: + * @SuppressWarnings('unresolvable-target') + *
*/ UNRESOLVABLE_TARGET("unresolvable-target"), /** * The default java "raw types" suppressions + *
Usage: + * @SuppressWarnings('rawtypes') + *
*/ RAW_TYPES("rawtypes"); diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/package-info.java b/src/ap/java/org/spongepowered/tools/obfuscation/package-info.java new file mode 100644 index 00000000..cf2d2f33 --- /dev/null +++ b/src/ap/java/org/spongepowered/tools/obfuscation/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Base package for the Mixin Annotation Processor. + */ +package org.spongepowered.tools.obfuscation; diff --git a/src/main/java/org/spongepowered/asm/launch/package-info.java b/src/main/java/org/spongepowered/asm/launch/package-info.java new file mode 100644 index 00000000..9fd94a8e --- /dev/null +++ b/src/main/java/org/spongepowered/asm/launch/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Classes which support environment-agnostic launch logic for the Mixin + * subsystem and base classes and interfaces for environment-specific adapters. + */ +package org.spongepowered.asm.launch; diff --git a/src/main/java/org/spongepowered/asm/launch/platform/container/package-info.java b/src/main/java/org/spongepowered/asm/launch/platform/container/package-info.java new file mode 100644 index 00000000..b3adc6e7 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/launch/platform/container/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Default (platform-agnostic) container handles + */ +package org.spongepowered.asm.launch.platform.container; diff --git a/src/main/java/org/spongepowered/asm/launch/platform/package-info.java b/src/main/java/org/spongepowered/asm/launch/platform/package-info.java new file mode 100644 index 00000000..df016e33 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/launch/platform/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Base classes for environment-specific adapters and default platform-agnostic + * handlers for environment and mixin containers. + */ +package org.spongepowered.asm.launch.platform; diff --git a/src/main/java/org/spongepowered/asm/mixin/Implements.java b/src/main/java/org/spongepowered/asm/mixin/Implements.java index 0547eaf9..1820ad9a 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Implements.java +++ b/src/main/java/org/spongepowered/asm/mixin/Implements.java @@ -31,7 +31,13 @@ import java.lang.annotation.Target; /** * Pseudo-implements decorator for Mixins with conflicting methods in a - * superclass to soft-implement an interface + * superclass to soft-implement an interface. + * + *

See Introduction to Mixins - Resolving + * Method Signature Conflicts for details on soft implementation of + * interfaces.

*/ @Target(ElementType.TYPE) @Retention(RetentionPolicy.CLASS) diff --git a/src/main/java/org/spongepowered/asm/mixin/Intrinsic.java b/src/main/java/org/spongepowered/asm/mixin/Intrinsic.java index 721e513b..1896b7db 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Intrinsic.java +++ b/src/main/java/org/spongepowered/asm/mixin/Intrinsic.java @@ -46,10 +46,10 @@ import java.lang.annotation.Target; *

Consider the following code:

* *
@Shadow public int getSomething();
- * 
- * public int soft$getSomething() {
- *     return this.getSomething();
- * }
+ * + *public int soft$getSomething() { + * return this.getSomething(); + *} * *

This type of accessor is common when an interface conflict occurs, but has * the problem that the injected accessor will be effectively self-referential @@ -61,9 +61,9 @@ import java.lang.annotation.Target; * *

@Shadow private int something;
  * 
- * public int soft$getSomething() {
- *     return this.something;
- * }
+ *public int soft$getSomething() { + * return this.something; + *} * *

But this has the drawback of forcing the mixin to re-implement the target * method, and thus forces ongoing maintenance of the mixin to include updating @@ -75,21 +75,21 @@ import java.lang.annotation.Target; * accessor with {@link Intrinsic @Intrinsic}:

* *
@Shadow public int getSomething();
- * 
- * @Intrinsic // don't merge the method if the target already exists
- * public int soft$getSomething() {
- *     return this.getSomething();
- * }
+ * + *@Intrinsic // don't merge the method if the target already exists + *public int soft$getSomething() { + * return this.getSomething(); + *} * *

This is ideal if the accessor is simply providing a proxy through to an * underlying obfuscated method, as in the example above. However, if the new * method contains additional code, such as in this example:

* *
@Shadow public int getSomething();
- * 
- * public int soft$getSomething() {
- *     return this.someCondition ? this.someOtherValue : this.getSomething();
- * }
+ * + *public int soft$getSomething() { + * return this.someCondition ? this.someOtherValue : this.getSomething(); + *} * *

Then we still have the original problem that the method becomes re-entrant * without specifying the additional Overwrite. We can solve this with the @@ -108,11 +108,11 @@ import java.lang.annotation.Target; * accessor will call the overwritten method.

* *
@Shadow public int getSomething();
- * 
- * @Intrinsic(displace = true) // if the target already exists, displace it
- * public int soft$getSomething() {
- *     return this.someCondition ? this.someOtherValue : this.getSomething();
- * }
+ * + *@Intrinsic(displace = true) // if the target already exists, displace it + *public int soft$getSomething() { + * return this.someCondition ? this.someOtherValue : this.getSomething(); + *} * */ @Target({ ElementType.METHOD }) diff --git a/src/main/java/org/spongepowered/asm/mixin/Mixin.java b/src/main/java/org/spongepowered/asm/mixin/Mixin.java index 3d490711..bd071095 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Mixin.java +++ b/src/main/java/org/spongepowered/asm/mixin/Mixin.java @@ -30,7 +30,22 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Decorator for mixin classes + * The main decorator for mixin classes, this annotation denotes a class as a + * mixin and specifies two key attributes: + * + *
+ *
The target classes
+ *
Every mixin requires at least one target class in order to be valid. + * The target classes should be specified via {@link #value} where possible + * using class literals. However for anonymous inner classes, + * package-private classes, or unavailable classes (eg. synthetic classes) + * being targetted via {@link Pseudo @Pseudo}, the targets should be + * specified via the {@link #targets} instead.
+ *
The priority
+ *
The mixin {@link #priority} is used to express the mixin's desired + * ordering with respect to other mixins being applied to the same target + * class.
+ *
*/ @Target(ElementType.TYPE) @Retention(RetentionPolicy.CLASS) @@ -46,18 +61,34 @@ public @interface Mixin { /** * Since specifying targets in {@link #value} requires that the classes be * publicly visible, this property is provided to allow package-private, - * anonymous innner, and private inner classes to be referenced. Referencing - * an otherwise public class using this property is an error condition and - * will throw an exception at runtime. It is completely fine to specify both - * public and private targets for the same mixin however. + * anonymous innner, and private inner, or unavailable ({@link Pseudo + * @Pseudo} classes to be referenced. Referencing an otherwise public + * class using this property is an error condition and will raise a warning + * at runtime or an error if {@link MixinEnvironment.Option#DEBUG_STRICT + * strict checks} are enabled. It is completely fine to specify both publi + * and private targets for the same mixin however. + * + *

Note that unlike class literals specified in {@link #value}, imports + * are not supported and therefore the class specified here must be + * fully-qualified with the package name.

* - * @return protected or package-private classes this mixin targets + * @return protected, package-private, or {@link Pseudo pseudo} classes this + * mixin targets */ public String[] targets() default { }; /** * Priority for the mixin, relative to other mixins targetting the same - * classes + * classes. By default mixins inherit their priority from the parent + * configuration that contains them, setting this value allows the priority + * to be overridden on a per-mixin basis. + * + *

Priorities sort mixins into natural order with lower priority + * mixins being applied first. This changes the nature of priority based on + * your intentions. Especially with respect to injectors, which must be + * considered on a case-by-case basis since the semantics of priority vary + * by injector because of first-come-first-served versus implied ordering of + * injectors such as inject-at-HEAD.

* * @return the mixin priority (relative to other mixins targetting the same * class) @@ -66,7 +97,7 @@ public @interface Mixin { /** * By default, the annotation processor will attempt to locate an - * obfuscation mapping for all {@link Shadow} and + * obfuscation mapping for all {@link Overwrite}, {@link Shadow} and * {@link org.spongepowered.asm.mixin.injection.Inject} annotated members * since it is anticipated that in general the target of a {@link Mixin} * will be an obfuscated class and all annotated members will need to be @@ -84,4 +115,5 @@ public @interface Mixin { * obfuscation mappings for this annotation (default true). */ public boolean remap() default true; + } diff --git a/src/main/java/org/spongepowered/asm/mixin/Pseudo.java b/src/main/java/org/spongepowered/asm/mixin/Pseudo.java index fc6c394a..335304f4 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Pseudo.java +++ b/src/main/java/org/spongepowered/asm/mixin/Pseudo.java @@ -30,23 +30,38 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * A Mixin marked as Pseudo is allowed to target classes which are not - * available at compile time and may not be available at runtime. This means - * that certain restrictions apply: + * A Mixin marked as @Pseudo is allowed to target classes which are + * not available at compile time and may not be available at runtime. + * This can be used in situations where - for one reason or another - a target + * class is not available to a project being compiled and would therefore fail + * AP verification. The target class is simulated by the AP using knowledge of + * only the superclass of the target (or at least, any available known + * superclass of the target. This means that certain restrictions apply: * - *

In particular, the superclass requirement for pseudo mixins is extremely - * important if the target has an obfuscated class in its hierarchy. For example - * let's assume that we're mixing into a class SomeCustomScreen from - * another party which extends GuiScreen which is obfuscated. - * Attempting to inject into initGui will succeed at dev time and fail - * at production time, because the reference is obfuscated. We can overcome this - * by ensuring the mixin inherits from the same superclass, thus allowing - * initGui to be resolved in the superclass hierarchy (this is not the - * case for normal mixins).

+ *

The superclass requirement for pseudo mixins is extremely important if + * the target has an obfuscated class in its hierarchy. For example + * let's assume that we're mixing into a class CustomGuiScreen from + * another party which extends GuiScreen, where GuiScreen is + * an obfuscated class. GuiScreen contains an obfuscated method + * initGui which the (@Pseudo) target class overrides. Attempting + * to inject into initGui would succeed at dev time but would fail + * at production time, because the reference is obfuscated. Normally when a + * target overrides an obfuscated method in this way, the AP can resolve the + * obfuscation by walking the superclass hierarchy of the target in order to + * discover a mapping. However when the target is not available at compile time + * the AP cannot do this and must rely on only information from the mixin + * itself. We can overcome this problem by ensuring the mixin inherits from the + * same superclass (or at least a superclass which contains the obfuscated + * methods or fields used in the mixin), thus allowing our example initGui + * method to be resolved in the superclass hierarchy. This behaviour is + * not available to normal mixins as the AP always resolves the hierarchy via + * the target class metadata when it is available.

* - *

{@link Overwrite} methods which are not inherited from a superclass - * (if the target is obfuscated) must be decorated manually with aliases. - *

+ *

If the target class contains obfuscated methods which the mixin needs to + * {@link Overwrite} or {@link Shadow} which are not inherited from a + * superclass (eg. the target is obfuscated), the {@link Overwrite} or + * {@link Shadow} must be decorated manually with aliases since + * there is no mechanism for the AP to resolve the mappings automatically.

*/ @Target(ElementType.TYPE) @Retention(RetentionPolicy.CLASS) diff --git a/src/main/java/org/spongepowered/asm/mixin/connect/package-info.java b/src/main/java/org/spongepowered/asm/mixin/connect/package-info.java new file mode 100644 index 00000000..0a71a362 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/connect/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * See {@link org.spongepowered.asm.mixin.connect.IMixinConnector} + */ +package org.spongepowered.asm.mixin.connect; diff --git a/src/main/java/org/spongepowered/asm/mixin/extensibility/package-info.java b/src/main/java/org/spongepowered/asm/mixin/extensibility/package-info.java new file mode 100644 index 00000000..79f0a47d --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/extensibility/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Interfaces for internal Mixin objects which provide extensibility for mixin + * consumers. + */ +package org.spongepowered.asm.mixin.extensibility; diff --git a/src/main/java/org/spongepowered/asm/mixin/gen/package-info.java b/src/main/java/org/spongepowered/asm/mixin/gen/package-info.java new file mode 100644 index 00000000..8b740b19 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/gen/package-info.java @@ -0,0 +1,32 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Generators, a special type of injector which replace the annotated method + * with synthetic content, see + * {@link org.spongepowered.asm.mixin.gen.Accessor @Accessor} and + * {@link org.spongepowered.asm.mixin.gen.Invoker @Invoker}. + */ +package org.spongepowered.asm.mixin.gen; diff --git a/src/main/java/org/spongepowered/asm/mixin/gen/throwables/package-info.java b/src/main/java/org/spongepowered/asm/mixin/gen/throwables/package-info.java new file mode 100644 index 00000000..49468b98 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/gen/throwables/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Exceptions for generators. + */ +package org.spongepowered.asm.mixin.gen.throwables; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java b/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java index 171994c7..5a2f332e 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java @@ -69,22 +69,23 @@ import com.google.common.collect.ImmutableList.Builder; /** *

Base class for injection point discovery classes. Each subclass describes * a strategy for locating code injection points within an instruction list, - * with the {@link #find} method populating a collection with insn nodes from - * the supplied list which satisfy its strategy.

+ * with the {@link #find find} method populating a collection with insn nodes + * from the supplied list which satisfy its strategy.

* *

This base class also contains composite strategy factory methods such as - * {@link #and} and {@link #or} which allow strategies to be combined using - * intersection (and) or union (or) relationships to allow multiple strategies - * to be easily combined.

+ * {@link #and and} and {@link #or or} which allow strategies to be combined + * using intersection (and) or union (or) relationships to allow multiple + * strategies to be easily combined.

* *

You are free to create your own injection point subclasses, but take note * that it is allowed for a single InjectionPoint instance to be used for * multiple injections and thus implementing classes MUST NOT cache the insn - * list, event, or nodes instance passed to the {@link #find} method, as each - * call to {@link #find} must be considered a separate functional contract and - * the InjectionPoint's lifespan is not linked to the discovery lifespan, - * therefore it is important that the InjectionPoint implementation is fully - * stateless.

+ * list, event, or nodes instance passed to the {@link #find find} method, as + * each call to {@link #find find} must be considered a separate functional + * contract and the InjectionPoint's lifespan is not linked to the discovery + * lifespan, therefore it is important that the InjectionPoint implementation is + * fully stateless and that calls to {@link #find find} are idempotent. + *

*/ public abstract class InjectionPoint { diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java index fe9ffe82..048b8238 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java @@ -38,24 +38,35 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; /** * Specifies that this mixin method should inject an argument modifier to itself * in the target method(s) identified by {@link #method}. This type of injection - * provides a lightweight mechanism for changing a single argument of a target - * method invocation. To affect multiple arguments at once, use {@link - * ModifyArgs} instead. + * provides a lightweight mechanism for changing a single argument of a selected + * method invocation within the target method(s). To affect multiple arguments + * of an invocation all at once, use {@link ModifyArgs} instead. * - *

Consider the following method call:

+ *

Use this injector when a method contains an method invocation and you wish + * to change a single value being passed to that method. If you need to + * alter an argument received by a target method, use {@link + * ModifyVariable} instead.

* - *
// x, y and z are of type float
- *someObject.setLocation(x, y, z, true);
+ *

Consider the following method:

* - *

Let us assume that we wish to modify the y value in the method - * call. We know that the arguments are floats and that the y - * value is the second (index = 1) float argument. Thus our - * injector requires the following signature: + *

private void targetMethod() {
+ *    Entity someEntity = this.obtainEntity();
+ *    float x = 1.0F, y = 3.0F, z = 0.1F;
+ *    someEntity.setLocation(x, y, z, true);
+ *}
+ *
+ * + *

Let us assume that we wish to modify the y value when + * calling the setLocation method. We know that the + * arguments are floats and that the y value is the second + * (index = 1) float argument. Thus our injector requires the + * following signature: * - *

@ModifyArg(method = "...", at = ..., index = 1)
- *private float adjustYCoord(float y) {
- *    return y + 64.0F;
- *}
+ *
@ModifyArg(method = "targetMethod", at = @At(value + * = "INVOKE", target = "setLocation(FFFZ)V"), index = 1)
+ * private float adjustYCoord(float y) {
+ *     return y + 64.0F;
+ * }
* *

The callback consumes the original value of y and returns the * adjusted value.

@@ -64,10 +75,11 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * arguments if required, to provide additional context for the callback. In * this case the arguments of the callback should match the target method:

* - *
@ModifyArg(method = "...", at = ..., index = 1)
- *private float adjustYCoord(float x, float y, float z, boolean interpolate) {
- *    return (x == 0 && y == 0) ? 0 : y;
- *}
+ *
@ModifyArg(method = "targetMethod", at = @At(value + * = "INVOKE", target = "setLocation(FFFZ)V"), index = 1)
+ * private float adjustYCoord(float x, float y, float z, boolean interpolate) { + *
    return (x == 0 && y == 0) ? 0 : y;
+ * }
*/ @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyVariable.java b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyVariable.java index d8f76088..5dd71cfe 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyVariable.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyVariable.java @@ -37,20 +37,27 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; /** * Specifies that this mixin method should inject a variable modifier callback - * to itself in the target method(s) identified by {@link #method}. + * to itself in the target method(s) identified by {@link #method}. The variable + * modifier can modify a single local variable in the target method frame. + * + *

If the variable being modified is a method argument, specifying the + * {@link #argsOnly argsOnly=true} reduces the overhead of calculating + * the local variable table for the method.

* *

ModifyVariable callbacks should always take one argument of the * type to capture and return the same type. For example a ModifyVariable - * for a local of type {@link String} should have the signature:

+ * for a local of type {@link String} should have the + * signature:

* - * private String methodName(String variable) { ... + *
private String myHandlerMethod(String + * variable) {
    ...
* *

The callback receives the current value of the local variable, and should * return the new value.

* *

The injector has two operating modes, explicit and implicit - * , and can operate either on the entire LVT or on the method arguments - * only

. + * , and can operate either on the entire LVT or on the {@link #argsOnly + * ethod arguments only}.

* *

In explicit mode, the variable to capture can be specified by * specifying values for the discriminator arguments {@link #ordinal}, diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/Redirect.java b/src/main/java/org/spongepowered/asm/mixin/injection/Redirect.java index 3bca4255..b72f5fdc 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/Redirect.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/Redirect.java @@ -55,7 +55,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * int def = 1; * Foo someObject = new Foo(); * - * // Hooking this method + * // Hooking this method * boolean xyz = someObject.bar(abc, def); *} * @@ -63,7 +63,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; *

The signature of the redirected method should be:

* *
- *
public boolean barProxy(Foo someObject, int abc, int def)
+ * public boolean barProxy(Foo someObject, int abc, int def) *
* *

For obvious reasons this does not apply for static methods, for static @@ -77,8 +77,8 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * arguments) by appending the arguments to the method signature:

* *
- *
public boolean barProxy(Foo someObject, int abc, int def,
- *    int someInt, String someString)
+ * public boolean barProxy(Foo someObject, int abc, int def, + * int someInt, String someString) *
* *

All arguments of a method redirect handler, and the return type, can be @@ -92,7 +92,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * handling a field write (PUTFIELD, PUTSTATIC) or a * field read (GETFIELD, GETSTATIC).

* - * + *
* * * @@ -148,7 +148,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * indices, for multi-dimensional arrays) and returns the element * type (in this case String) as follows:

* - *
Operation (OPCODE)Handler signature
+ *
* * * @@ -177,16 +177,16 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * array=length and configure your handler signature to return int * and consume the array as an argument:

* - *
private int getLength(ElementType[] array) + *
private int getLength(ElementType[] array) *
- * + * - *

For multi-dimensional arrays, provide one int argument for each * additional dimension of the array:

* - *
// Multidimensional array
- * private ElementType[][] array;

- * // Handler signature:
- * private int getLength(ElementType[][] array, int baseDim) + *
// Multidimensional array
+ * private ElementType[][] array;

+ * // Handler signature:
private int + * getLength(ElementType[][] array, int baseDim) *
* *

New Object Redirect Mode (Factory Mode)

@@ -211,7 +211,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; *class Foo { * private final int x, y; * - * // ctor we wish to hook + * // ctor we wish to hook * Foo(int x, int y) { * this.x = x; * this.y = y; @@ -231,7 +231,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * example to redirect the following object creation call:

* *
public void exampleFunc(String someString, int dx, int dy) {
- *    // Hooking this constructor
+ *    // Hooking this constructor
  *    Foo someFoo = new Foo(dx * 10, dy * 10);
  *}
*
@@ -239,15 +239,15 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; *

The signature of the handler method should be:

* *
- *
public Foo constructFoo(int x, int y)
+ * public Foo constructFoo(int x, int y) *
* *

Note that like other redirectors, it is possible to capture the target * method's arguments by appending them to the handler method's signature:

* *
- * public Foo constructFoo(int x, int y, String someString, int dx, - * int dy) + * public Foo constructFoo(int x, int y, String someString, int dx, + * int dy) *
* *

instanceof Redirect Mode

@@ -277,8 +277,8 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * *

Note that this results in the injected code being less efficient, because * the instanceof opcode is replaced with discrete code similar to - * reference != null && yourClass.isAssignableFrom(reference.getClass()) in - * the target method body.

+ * reference != null && yourClass.isAssignableFrom(reference.getClass()) + * in the target method body.

* *

The arguments to an instanceof redirect handler must always be * Object, Class even if the variable type is known. This is @@ -298,7 +298,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint; * *

class Foo : Bar {
  *    Foo(int arg) {
- *        super(Foo.isEven(arg));
+ *        super(Foo.isEven(arg));
  *    }
  *    
  *    static int isEven(int arg) {
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/Slice.java b/src/main/java/org/spongepowered/asm/mixin/injection/Slice.java
index 769b1555..857432db 100644
--- a/src/main/java/org/spongepowered/asm/mixin/injection/Slice.java
+++ b/src/main/java/org/spongepowered/asm/mixin/injection/Slice.java
@@ -85,7 +85,7 @@ import org.spongepowered.asm.mixin.injection.InjectionPoint.Selector;
  *         thing.processStuff();
  *     }
  *     
- *     // A new call to processStuff, which now has the ordinal 1
+ *     // A new call to processStuff, which now has the ordinal 1
  *     bar.getActiveThing().processStuff();
  *     
  *     Thing specialThing = bar.getSpecialThing();
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/callback/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/callback/package-info.java
new file mode 100644
index 00000000..39952e3a
--- /dev/null
+++ b/src/main/java/org/spongepowered/asm/mixin/injection/callback/package-info.java
@@ -0,0 +1,30 @@
+/*
+ * This file is part of Mixin, licensed under the MIT License (MIT).
+ *
+ * Copyright (c) SpongePowered 
+ * Copyright (c) contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * Implementation of callback injector functionality provided by
+ * {@link org.spongepowered.asm.mixin.injection.Inject @#64;Inject}.
+ */
+package org.spongepowered.asm.mixin.injection.callback;
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/code/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/code/package-info.java
new file mode 100644
index 00000000..1a505452
--- /dev/null
+++ b/src/main/java/org/spongepowered/asm/mixin/injection/code/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * This file is part of Mixin, licensed under the MIT License (MIT).
+ *
+ * Copyright (c) SpongePowered 
+ * Copyright (c) contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * Common base classes for injector implementations.
+ */
+package org.spongepowered.asm.mixin.injection.code;
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/RedirectInjector.java b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/RedirectInjector.java
index 2cde5ecd..6e6d1967 100644
--- a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/RedirectInjector.java
+++ b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/RedirectInjector.java
@@ -65,7 +65,7 @@ import com.google.common.primitives.Ints;
  *   int def = 1;
  *   Foo someObject = new Foo();
  *   
- *   // Hooking this method
+ *   // Hooking this method
  *   boolean xyz = someObject.bar(abc, def);
*
* diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/arg/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/arg/package-info.java new file mode 100644 index 00000000..e0a1adc5 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/arg/package-info.java @@ -0,0 +1,32 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Support classes for + * {@link org.spongepowered.asm.mixin.injection.ModifyArgs @ModifyArgs} + * which handle argument bundles + * ({@link org.spongepowered.asm.mixin.injection.invoke.arg.Args}). + */ +package org.spongepowered.asm.mixin.injection.invoke.arg; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/package-info.java new file mode 100644 index 00000000..cbfaf69d --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Implementation of injectors which primarily mutate method invocations. + */ +package org.spongepowered.asm.mixin.injection.invoke; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/package-info.java new file mode 100644 index 00000000..3dd49622 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/invoke/util/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Utility classes for invoke injectors. + */ +package org.spongepowered.asm.mixin.injection.invoke.util; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/modify/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/modify/package-info.java new file mode 100644 index 00000000..20ceda6c --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/modify/package-info.java @@ -0,0 +1,31 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Implementation of variable modifier injector specified by + * {@link org.spongepowered.asm.mixin.injection.ModifyVariable + * @ModifyVariable} + */ +package org.spongepowered.asm.mixin.injection.modify; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/package-info.java new file mode 100644 index 00000000..c1190db2 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Injectors are class postprocessors which search for annotated methods merged + * by mixins and perform weaving operations as requested. + */ +package org.spongepowered.asm.mixin.injection; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeConstant.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeConstant.java index db18ffdb..8cab6c01 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeConstant.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeConstant.java @@ -71,41 +71,41 @@ import com.google.common.primitives.Longs; *
ordinal
*
The ordinal position of the constant opcode to match. The default value * is -1 which supresses ordinal matching
- *
named argument nullValue
+ *
named argument: nullValue
*
To match null literals in the method body, set this to * true
- *
named argument intValue
+ *
named argument: intValue
*
To match int literals in the method body. See also the * expandZeroConditions argument below for concerns when matching * conditional zeroes.
- *
named argument floatValue
+ *
named argument: floatValue
*
To match float literals in the method body.
- *
named argument longValue
+ *
named argument: longValue
*
To match long literals in the method body.
- *
named argument doubleValue
+ *
named argument: doubleValue
*
To match double literals in the method body.
- *
named argument stringValue
+ *
named argument: stringValue
*
To match {@link String} literals in the method body.
- *
named argument classValue
+ *
named argument: classValue
*
To match {@link Class} literals in the method body.
- *
named argument log
+ *
named argument: log
*
Enable debug logging when searching for matching opcodes.
- *
named argument expandZeroConditions
+ *
named argument: expandZeroConditions
*
See the {@link Constant#expandZeroConditions} option, this argument * should be a list of {@link Condition} names
* * *

Examples:

*
- *   // Find all integer constans with value 4
+ *   // Find all integer constans with value 4
  *   @At(value = "CONSTANT", args = "intValue=4")
*
*
- *   // Find the String literal "foo"
+ *   // Find the String literal "foo"
  *   @At(value = "CONSTANT", args = "stringValue=foo"
*
*
- *   // Find all integer constants with value 0 and expand conditionals
+ *   // Find integer constants with value 0 and expand conditionals
  *   @At(
  *     value = "CONSTANT",
  *     args = {
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java
index 0cc4b05d..5d3de468 100644
--- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java
+++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeFieldAccess.java
@@ -49,21 +49,33 @@ import org.spongepowered.asm.util.Bytecode;
  * 
*
target
*
A {@link ITargetSelector Target Selector} which identifies the target - * field.
+ * field. *
opcode
*
The {@link Opcodes opcode} of the field access, must be one of - * GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+ * GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. *
ordinal
*
The ordinal position of the field access to match. For example if the - * field is referenced 3 times and you want to match the 3rd then you can - * specify an ordinal of 2 (ordinals are zero-indexed). The - * default value is -1 which supresses ordinal matching
+ * field is referenced 3 times and you want to match the 3rd then you can + * specify an ordinal of 2 (ordinals are zero-indexed). The + * default value is -1 which supresses ordinal matching + *
named argument: array
+ *
For matching accesses to an array field element following a GETFIELD or + * GETSTATIC. Specify get, set or length to match + * the desired operation.
+ *
named argument: fuzz
+ *
When matching array operations using array the injection point + * will by default search up to 8 instructions after the matched field insn. + * However in some cases the array operation may be further from the matched + * GETFIELD or GETSTATIC and the amount to search (the "fuzz factor" can be + * specified using this argument. Likewise to optimise the search against + * false positives, this value can be specified as a lower value if desired. + * Has no effect if array is not specified.
*
* *

Example:

- *
+ * 
* @At(value = "FIELD", target="field_59_z:I", opcode = Opcodes.GETFIELD) - *
+ * *
* *

Matching array access:

@@ -72,9 +84,10 @@ import org.spongepowered.asm.util.Bytecode; * operation. To enable this behaviour specify the array named-argument * with the desired operation:

* - *
- *   @At(value = "FIELD", target="myIntArray:[I", args = "array=get")
- * 
+ *
+ * @At(value = "FIELD", target="myIntArray:[I", opcode + * = Opcodes.GETFIELD, args = "array=get") + * *
* *

See {@link Redirect} for information on array element redirection.

diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java index c0484c5e..72249325 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeNew.java @@ -52,7 +52,7 @@ import com.google.common.base.Strings; * {@link org.spongepowered.asm.mixin.injection.At At}:

* *
- *
named argument class (or specify using target
+ *
named argument: class (or specify using target
*
The value of the NEW node to look for, the fully-qualified class name *
*
ordinal
@@ -70,16 +70,16 @@ import com.google.common.base.Strings; * *

Examples:

*
- *   // Find all NEW opcodes for String
+ *   // Find all NEW opcodes for String
  *   @At(value = "NEW", args = "class=java/lang/String")
*
*
- *   // Find all NEW opcodes for String
+ *   // Find all NEW opcodes for String
  *   @At(value = "NEW", target = "java/lang/String"
*
*
- *   // Find all NEW opcodes for String which are constructed using the
- *   // ctor which takes an array of char
+ *   // Find all NEW opcodes for String which are constructed
+ *   // using the ctor which takes an array of char
  *   @At(value = "NEW", target = "([C)Ljava/lang/String;"
*
* diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java index fe02f649..82318a1c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeStringInvoke.java @@ -64,7 +64,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData; * the method is invoked 3 times and you want to match the 3rd then you can * specify an ordinal of 2 (ordinals are zero-indexed). The * default value is -1 which supresses ordinal matching - *
named argument ldc
+ *
named argument: ldc
*
The value of the LDC node to look for prior to the method invocation *
*
diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/package-info.java new file mode 100644 index 00000000..d84bf042 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Built-in {@link org.spongepowered.asm.mixin.injection.InjectionPoint + * injection point} classes. + */ +package org.spongepowered.asm.mixin.injection.points; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/selectors/dynamic/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/selectors/dynamic/package-info.java new file mode 100644 index 00000000..c126bc42 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/selectors/dynamic/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Dynamic target selectors provide custom logic for selecting injector targets. + */ +package org.spongepowered.asm.mixin.injection.selectors.dynamic; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/selectors/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/selectors/package-info.java new file mode 100644 index 00000000..d50ea83a --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/selectors/package-info.java @@ -0,0 +1,31 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Target selectors are consumed by injectors and injection points when + * identifying target members in a class or inside a method, see {@link + * org.spongepowered.asm.mixin.injection.selectors.ITargetSelector}. + */ +package org.spongepowered.asm.mixin.injection.selectors; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java index 37df0ee0..fa59165c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java @@ -48,43 +48,51 @@ import com.google.common.base.Objects; import com.google.common.base.Strings; /** - *

Target selector, also used as a general-purpose information bundle about a - * member (method or field) parsed from a String token in another annotation, - * this is used where target members need to be specified as Strings in order to - * parse the String representation to something useful. See - * {@link ITargetSelector} for other supported selector types.

+ *

Struct which defines an Explcit Target selector, See + * {@link ITargetSelector} for other supported selector types. This struct is + * also used as a general-purpose information bundle about a member (method or + * field) parsed from a String token in another annotation, this is used where + * target members need to be specified as Strings in order to parse the String + * representation to something useful.

* *

Some examples:

*
- *   // references a method or field called func_1234_a, if there are multiple
- *   // members with the same signature, matches the first occurrence
- *   func_1234_a
+ *   // references a method or field called func_1234_a, if there are
+ *   // multiple members with the same signature, matches the first occurrence
+ *   func_1234_a
  *   
- *   // references a method or field called func_1234_a, if there are multiple
- *   // members with the same signature, matches all occurrences
+ *   // references a method or field called func_1234_a, if there are
+ *   // multiple members with matching name, matches all occurrences
  *   func_1234_a*
  *   
- *   // references a method called func_1234_a which takes 3 ints and returns
- *   // a bool
+ *   // references all methods which take 3 ints and return a bool
+ *   *(III)Z
+ *   
+ *   // references a method called func_1234_a which takes 3 ints and
+ *   // returns a bool
  *   func_1234_a(III)Z
  *   
- *   // references a field called field_5678_z which is a String
+ *   // references a field called field_5678_z which is a String
  *   field_5678_z:Ljava/lang/String;
  *   
- *   // references a ctor which takes a single String argument 
+ *   // references a ctor which takes a single String argument 
  *   <init>(Ljava/lang/String;)V
  *   
- *   // references a method called func_1234_a in class foo.bar.Baz
+ *   // references a method called func_1234_a in class foo.bar.Baz
  *   Lfoo/bar/Baz;func_1234_a
  *  
- *   // references a field called field_5678_z in class com.example.Dave
- *   Lcom/example/Dave;field_5678_z
+ *   // references a field called field_5678_z in class com.example.Dave
+ *   Lcom/example/Dave;field_5678_z
  *  
- *   // references a method called func_1234_a in class foo.bar.Baz which takes
- *   // three doubles and returns void
+ *   // references a field called field_5678_z in class com.example.Dave
+ *   // which is of type String
+ *   Lcom/example/Dave;field_5678_z:Ljava/lang/String;
+ *  
+ *   // references a method called func_1234_a in class foo.bar.Baz which
+ *   // takes three doubles and returns void
  *   Lfoo/bar/Baz;func_1234_a(DDD)V
  *   
- *   // alternate syntax for the same
+ *   // alternate syntax for the same
  *   foo.bar.Baz.func_1234_a(DDD)V
*
*/ diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/package-info.java new file mode 100644 index 00000000..e4138056 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Internal data bundles used by injectors during application. + */ +package org.spongepowered.asm.mixin.injection.struct; diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/throwables/package-info.java b/src/main/java/org/spongepowered/asm/mixin/injection/throwables/package-info.java new file mode 100644 index 00000000..a1a3d686 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/injection/throwables/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Throwable classes (errors and exceptions) for injectors. + */ +package org.spongepowered.asm.mixin.injection.throwables; diff --git a/src/main/java/org/spongepowered/asm/mixin/package-info.java b/src/main/java/org/spongepowered/asm/mixin/package-info.java new file mode 100644 index 00000000..08b2b9c2 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/package-info.java @@ -0,0 +1,34 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Primary interaction points ( + * {@link org.spongepowered.asm.mixin.Mixin @Mixin} and + * {@link org.spongepowered.asm.mixin.MixinEnvironment @MixinEnvironment}) + * and annotations (eg. + * {@link org.spongepowered.asm.mixin.Mixin @Mixin}, + * {@link org.spongepowered.asm.mixin.Shadow @Shadow}) for mixin consumers. + */ +package org.spongepowered.asm.mixin; diff --git a/src/main/java/org/spongepowered/asm/mixin/refmap/package-info.java b/src/main/java/org/spongepowered/asm/mixin/refmap/package-info.java new file mode 100644 index 00000000..19669c41 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/refmap/package-info.java @@ -0,0 +1,31 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Refmaps are data bundles which map string references to obfuscated + * counterparts at runtime, see {@link + * org.spongepowered.asm.mixin.refmap.ReferenceMapper}. + */ +package org.spongepowered.asm.mixin.refmap; diff --git a/src/main/java/org/spongepowered/asm/mixin/struct/package-info.java b/src/main/java/org/spongepowered/asm/mixin/struct/package-info.java new file mode 100644 index 00000000..ec338bc3 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/struct/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Internal data bundles used by mixin during application. + */ +package org.spongepowered.asm.mixin.struct; diff --git a/src/main/java/org/spongepowered/asm/mixin/throwables/package-info.java b/src/main/java/org/spongepowered/asm/mixin/throwables/package-info.java new file mode 100644 index 00000000..aa5cc880 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/throwables/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Mixin throwables and throwable base classes. + */ +package org.spongepowered.asm.mixin.throwables; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java index 8eb20a93..097149e7 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/ClassInfo.java @@ -112,9 +112,9 @@ public final class ClassInfo { } /** - * When using {@link ClassInfo#forType}, determines whether an array type - * should be returned as declared (eg. as Object) or whether the - * element type should be returned instead. + * When using {@link ClassInfo#forType ClassInfo.forType}, determines + * whether an array type should be returned as declared (eg. as Object + * ) or whether the element type should be returned instead. */ public static enum TypeLookup { @@ -974,7 +974,7 @@ public final class ClassInfo { return this.name; } - public MethodMapper getMethodMapper() { + MethodMapper getMethodMapper() { return this.methodMapper; } diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java b/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java index 5e567f3f..2ff9d94e 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/InterfaceInfo.java @@ -42,7 +42,7 @@ import org.spongepowered.asm.util.Annotations; * Information about an interface being runtime-patched onto a mixin target * class, see {@link org.spongepowered.asm.mixin.Implements Implements} */ -public final class InterfaceInfo { +final class InterfaceInfo { /** * Parent mixin diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java index 55baab6d..1e298a57 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MethodMapper.java @@ -44,7 +44,7 @@ import com.google.common.base.Strings; /** * Maintains method remaps for a target class */ -public class MethodMapper { +class MethodMapper { /** * Logger diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java index 86d82b28..68043f0e 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinProcessor.java @@ -69,7 +69,7 @@ import org.spongepowered.asm.util.perf.Profiler.Section; /** * Heart of the Mixin pipeline */ -public class MixinProcessor { +class MixinProcessor { /** * Phase during which an error occurred, delegates to functionality in diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/ext/extensions/package-info.java b/src/main/java/org/spongepowered/asm/mixin/transformer/ext/extensions/package-info.java new file mode 100644 index 00000000..9f661b44 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/ext/extensions/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Internal mixin transformation pipeline extensions. + */ +package org.spongepowered.asm.mixin.transformer.ext.extensions; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/ext/package-info.java b/src/main/java/org/spongepowered/asm/mixin/transformer/ext/package-info.java new file mode 100644 index 00000000..16d1fa4d --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/ext/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Internal mixin transformation pipeline extension interface and registry of + * active extensions. + */ +package org.spongepowered.asm.mixin.transformer.ext; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/meta/package-info.java b/src/main/java/org/spongepowered/asm/mixin/transformer/meta/package-info.java new file mode 100644 index 00000000..9d6a3b8b --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/meta/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Meta annotations applied by the mixin processor to fingerprint mixin actions. + */ +package org.spongepowered.asm.mixin.transformer.meta; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/package-info.java b/src/main/java/org/spongepowered/asm/mixin/transformer/package-info.java new file mode 100644 index 00000000..34f240d9 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Internal mixin transformation pipeline classes. + */ +package org.spongepowered.asm.mixin.transformer; diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/throwables/package-info.java b/src/main/java/org/spongepowered/asm/mixin/transformer/throwables/package-info.java new file mode 100644 index 00000000..cd3fafb2 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/throwables/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Mixin transformation pipeline throwables. + */ +package org.spongepowered.asm.mixin.transformer.throwables; diff --git a/src/main/java/org/spongepowered/asm/obfuscation/mapping/common/package-info.java b/src/main/java/org/spongepowered/asm/obfuscation/mapping/common/package-info.java new file mode 100644 index 00000000..da35f651 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/obfuscation/mapping/common/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Structs for method and field mappings. + */ +package org.spongepowered.asm.obfuscation.mapping.common; diff --git a/src/main/java/org/spongepowered/asm/obfuscation/mapping/fg3/package-info.java b/src/main/java/org/spongepowered/asm/obfuscation/mapping/fg3/package-info.java new file mode 100644 index 00000000..b18be912 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/obfuscation/mapping/fg3/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Structs for method and field mappings with specific behaviour for ForgeGradle + * 3 and above. + */ +package org.spongepowered.asm.obfuscation.mapping.fg3; diff --git a/src/main/java/org/spongepowered/asm/obfuscation/mapping/mcp/package-info.java b/src/main/java/org/spongepowered/asm/obfuscation/mapping/mcp/package-info.java new file mode 100644 index 00000000..a12457a2 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/obfuscation/mapping/mcp/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Structs for method and field mappings with specific behaviour for MCP + */ +package org.spongepowered.asm.obfuscation.mapping.mcp; diff --git a/src/main/java/org/spongepowered/asm/obfuscation/mapping/package-info.java b/src/main/java/org/spongepowered/asm/obfuscation/mapping/package-info.java new file mode 100644 index 00000000..ea731a55 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/obfuscation/mapping/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Interface for structs for method and field mappings. + */ +package org.spongepowered.asm.obfuscation.mapping; diff --git a/src/main/java/org/spongepowered/asm/obfuscation/package-info.java b/src/main/java/org/spongepowered/asm/obfuscation/package-info.java new file mode 100644 index 00000000..4aa77ff4 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/obfuscation/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Obfuscation-related structs for interoperability with the annotation + * processor and runtime obfuscation utilities. + */ +package org.spongepowered.asm.obfuscation; diff --git a/src/main/java/org/spongepowered/asm/package-info.java b/src/main/java/org/spongepowered/asm/package-info.java new file mode 100644 index 00000000..41b69dd0 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * The Mixin runtime and utilities. + */ +package org.spongepowered.asm; diff --git a/src/main/java/org/spongepowered/asm/service/package-info.java b/src/main/java/org/spongepowered/asm/service/package-info.java new file mode 100644 index 00000000..39cc7d8f --- /dev/null +++ b/src/main/java/org/spongepowered/asm/service/package-info.java @@ -0,0 +1,31 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Mixin service interface, with base classes for all the moving parts of the + * Mixin transformation pipeline and supporting infrastructure. Abstracted here + * and implemented by platform-specific modules. + */ +package org.spongepowered.asm.service; diff --git a/src/main/java/org/spongepowered/asm/transformers/package-info.java b/src/main/java/org/spongepowered/asm/transformers/package-info.java new file mode 100644 index 00000000..ea62595f --- /dev/null +++ b/src/main/java/org/spongepowered/asm/transformers/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Specialised ASM utility and base classes used by the mixin processor. + */ +package org.spongepowered.asm.transformers; diff --git a/src/main/java/org/spongepowered/asm/util/asm/package-info.java b/src/main/java/org/spongepowered/asm/util/asm/package-info.java new file mode 100644 index 00000000..6fe9322f --- /dev/null +++ b/src/main/java/org/spongepowered/asm/util/asm/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Utilities, abstractions and specialised subclasses used by Mixin for + * interacting with ASM. + */ +package org.spongepowered.asm.util.asm; diff --git a/src/main/java/org/spongepowered/asm/util/logging/package-info.java b/src/main/java/org/spongepowered/asm/util/logging/package-info.java new file mode 100644 index 00000000..387fd39f --- /dev/null +++ b/src/main/java/org/spongepowered/asm/util/logging/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Logging abstraction to provide a unified logging interface for classes which + * operate both at runtime and in the AP. + */ +package org.spongepowered.asm.util.logging; diff --git a/src/main/java/org/spongepowered/asm/util/package-info.java b/src/main/java/org/spongepowered/asm/util/package-info.java new file mode 100644 index 00000000..1ab1784e --- /dev/null +++ b/src/main/java/org/spongepowered/asm/util/package-info.java @@ -0,0 +1,30 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Utility classes used by the entire Mixin pipeline, including utilities for + * working with bytecode as well as general-purpose tools and parsers. + */ +package org.spongepowered.asm.util; diff --git a/src/main/java/org/spongepowered/asm/util/perf/package-info.java b/src/main/java/org/spongepowered/asm/util/perf/package-info.java new file mode 100644 index 00000000..2c054f95 --- /dev/null +++ b/src/main/java/org/spongepowered/asm/util/perf/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Mixin, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Performance profiling for Mixin. + */ +package org.spongepowered.asm.util.perf;
OperationHandler signature