// Let's live dangerously.
serialiser.setAsmEnabled(false);
// Serialiser for ClassInfo
FieldSerializer classInfoSerialiser = new FieldSerializer(serialiser, ClassInfo.class);
classInfoSerialiser.setFieldsCanBeNull(false);
// Serialiser for MethodInfo
FieldSerializer methodInfoSerialiser = new FieldSerializer(serialiser, MethodInfo.class);
methodInfoSerialiser.getField("methodHash").setClass(String.class, new DefaultSerializers.StringSerializer());
methodInfoSerialiser.setFieldsCanBeNull(false);
// Serialiser for EffectSet.
FieldSerializer effectSetSerialiser = new FieldSerializer(serialiser, EffectSet.class);
SymbolSetSerialiser symbolSetSerialiser = new SymbolSetSerialiser();
serialiser.register(SymbolSet.class, symbolSetSerialiser);
// Don't serialise non-escaping symbol sets. Nobody cares.
effectSetSerialiser.removeField("readInternal");
effectSetSerialiser.removeField("writeInternal");
effectSetSerialiser.getField("readEscaping").setClass(SymbolSet.class, symbolSetSerialiser);
effectSetSerialiser.getField("writeEscaping").setClass(SymbolSet.class, symbolSetSerialiser);
serialiser.register(EffectSet.class, effectSetSerialiser);
// Now you can serialise an EffectSet, you can serialise an Effects.
serialiser.register(Effects.class, new EffectsSerialiser());