如何使用 preon 中的数组对数组进行建模
我在这里遇到一个问题,我尝试了几件事,但可能无法将其初始化。
@TypePrefix(value = "4", size = 8)
public class ArrayObject extends SerializedData {
@BoundBuffer(match = {(byte) 0x00, (byte) 0x01})
private byte[] magic;
@BoundNumber(byteOrder = ByteOrder.BigEndian, size = "7")
private byte value;
@BoundNumber(byteOrder = ByteOrder.BigEndian, size = "1")
private int signed;
@BoundList(size = "value", types = {ArrayObject.class, ByteString.class, SingleByteInteger.class, FourByteInteger.class, KeyValueObject.class, VariableLengthFormat.class})
private SerializedData[] elements;
public SerializedData[] getElements() {
return elements;
}
}
我的 ArrayObject 有 SerializedData 列表,它可以保存 ArrayObject (循环依赖)。我尝试使用@LazyLoading,但这没有帮助。
I have a problem here with problem I tried several things I just can't get it to init probably.
@TypePrefix(value = "4", size = 8)
public class ArrayObject extends SerializedData {
@BoundBuffer(match = {(byte) 0x00, (byte) 0x01})
private byte[] magic;
@BoundNumber(byteOrder = ByteOrder.BigEndian, size = "7")
private byte value;
@BoundNumber(byteOrder = ByteOrder.BigEndian, size = "1")
private int signed;
@BoundList(size = "value", types = {ArrayObject.class, ByteString.class, SingleByteInteger.class, FourByteInteger.class, KeyValueObject.class, VariableLengthFormat.class})
private SerializedData[] elements;
public SerializedData[] getElements() {
return elements;
}
}
My ArrayObject has List of SerializedData which can hold a ArrayObject (circular dependency). I tried using @LazyLoading but this doesn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论