使用 MOXy 我可以在我的 json 输出中展平我的部分对象模型
IE
<java-type name="Medium">
<java-attributes>
<xml-element java-attribute="trackList" xml-path="."/>
</java-attributes>
</java-type>
但是当我想折叠一个静态类的子类时,如下所示
<java-type name="Medium.TrackList">
<java-attributes>
<xml-element java-attribute="artistList" xml-path="."/>
</java-attributes>
</java-type>
它抱怨
Exception Description: Could not load class [Medium.TrackList] declared in the external metadata file. Please ensure that the class name is correct, and that the correct ClassLoader has been set.
at org.eclipse.persistence.exceptions.JAXBException.couldNotLoadClassFromMetadata(JAXBException.java:376)
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.getXmlBindingsClasses(JAXBContext.java:979)
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:879)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:157)
我该如何解决这个问题?