沃创云 v1.0.2版本的 MD5 值为:75fd4b81bf3100e28225c876f02b8eb1
以下内容为反编译后的 ParcelableAnnotationSupport.java 源代码,内容仅作参考
package extensions.jose.han;
import extensions.Extension;
import java.util.List;
import javax.swing.JPanel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import wu.seal.jsontokotlin.model.classscodestruct.Annotation;
import wu.seal.jsontokotlin.model.classscodestruct.DataClass;
import wu.seal.jsontokotlin.model.classscodestruct.KotlinClass;
import wu.seal.jsontokotlin.ui.HorizontalLinearLayoutBox;
import wu.seal.jsontokotlin.ui.UIDSLKt;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0006\u001a\u00020\u0007H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\nH\u0016R\u0014\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\b\n\u0000\u0012\u0004\b\u0005\u0010\u0002¨\u0006\f"}, d2 = {"Lextensions/jose/han/ParcelableAnnotationSupport;", "Lextensions/Extension;", "()V", "configKey", "", "configKey$annotations", "createUI", "Ljavax/swing/JPanel;", "intercept", "originClassImportDeclaration", "Lwu/seal/jsontokotlin/model/classscodestruct/KotlinClass;", "kotlinClass", "JsonToKotlinClass"}, k = 1, mv = {1, 1, 16})
public final class ParcelableAnnotationSupport extends Extension {
public static final ParcelableAnnotationSupport INSTANCE = new ParcelableAnnotationSupport();
public static final String configKey = "jose.han.add_parcelable_annotatioin_enable";
public static void configKey$annotations() {
}
private ParcelableAnnotationSupport() {
}
@Override
public JPanel createUI() {
return UIDSLKt.horizontalLinearLayout(new Function1<HorizontalLinearLayoutBox, Unit>() {
@Override
public Unit invoke(HorizontalLinearLayoutBox horizontalLinearLayoutBox) {
invoke2(horizontalLinearLayoutBox);
return Unit.INSTANCE;
}
public final void invoke2(HorizontalLinearLayoutBox receiver) {
String config;
Intrinsics.checkParameterIsNotNull(receiver, "$receiver");
config = ParcelableAnnotationSupport.INSTANCE.getConfig(ParcelableAnnotationSupport.configKey);
receiver.invoke(UIDSLKt.checkBox("Enable Parcelable Support ", Boolean.parseBoolean(config), new Function1<Boolean, Unit>() {
@Override
public Unit invoke(Boolean bool) {
invoke(bool.booleanValue());
return Unit.INSTANCE;
}
public final void invoke(boolean z) {
ParcelableAnnotationSupport.INSTANCE.setConfig(ParcelableAnnotationSupport.configKey, String.valueOf(z));
}
}));
receiver.invoke(UIDSLKt.link$default("May Need Some Config", "https://github.com/wuseal/JsonToKotlinClass/blob/master/parceable_support_tip.md", null, null, null, 28, null));
receiver.fillSpace();
}
});
}
@Override
public KotlinClass intercept(KotlinClass kotlinClass) {
Intrinsics.checkParameterIsNotNull(kotlinClass, "kotlinClass");
if (!(kotlinClass instanceof DataClass) || !Boolean.parseBoolean(getConfig(configKey))) {
return kotlinClass;
}
List mutableListOf = CollectionsKt.mutableListOf(Annotation.INSTANCE.fromAnnotationString("@SuppressLint(\"ParcelCreator\")"), Annotation.INSTANCE.fromAnnotationString("@Parcelize"));
DataClass dataClass = (DataClass) kotlinClass;
mutableListOf.addAll(dataClass.getAnnotations());
return DataClass.copy$default(dataClass, mutableListOf, null, null, "Parcelable", false, null, false, 118, null);
}
@Override
public String intercept(String originClassImportDeclaration) {
Intrinsics.checkParameterIsNotNull(originClassImportDeclaration, "originClassImportDeclaration");
return Boolean.parseBoolean(getConfig(configKey)) ? append(originClassImportDeclaration, append("import kotlinx.android.parcel.Parcelize", "import android.os.Parcelable")) : originClassImportDeclaration;
}
}