Hi! :android-wave: This might be a dumb question, ...
# serialization
p
Hi! 👋 This might be a dumb question, but is it possible to annotate and auto-generate serializers for a POJO class in a java file? I am trying something like this
Copy code
// MainActivity.java

public class MainActivity extends Activity {

    @Serializable
    static class Props {
        // my POJO
        int count;
        String name;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Props.serializer() // No such method available
    }
}
I am not sure if i am misusing / misunderstanding the API here, so feel free to correct 🙂 Thx!
n
serialization does its magic as a compiler plugin.. so if it is not a in file processed by kotlinc.. the magic does not happen
why not extract it as a data class into a
.kt
file ?
🙌 1
p
yea i think thats probably what i will end up doing, was just wondering if the compiler plugin can work on java files. thx for the answer 🙂