JAXB 注解的类可以知道 JAXBContext 或 JAXBIntrospector 实例吗?
JAXB 注解的类是否可以知道用于编组/解组该类的 JAXBContext 或 JAXBIntrospector 实例?
类似:
@XmlType
class Hello {
@XmlAttribute
private String name = "";
// called by JAXB
public Hello(){
JAXBIntrospector i = [some-magic-utility-class].getCurrentIntrospector();
}
}
更具体:我需要类实例知道(编组/解组时)当前 JAXBContext 已知哪些其他类。
Can a JAXB-annotated class known the JAXBContext or JAXBIntrospector instance which is used to marshal/unmarshal the class?
Something like:
@XmlType
class Hello {
@XmlAttribute
private String name = "";
// called by JAXB
public Hello(){
JAXBIntrospector i = [some-magic-utility-class].getCurrentIntrospector();
}
}
More specific: I need the class instance to know (when being marshalled/unmarshalled) which other classes are known to the current JAXBContext.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论