/**
* Template method that can be overridden by concrete JAXB marshallers for custom initialization behavior.
* Gets called after creation of JAXB {@code Marshaller}, and after the respective properties have been set.
* <p>The default implementation sets the {@link #setMarshallerProperties(Map) defined properties}, the {@link
* #setValidationEventHandler(ValidationEventHandler) validation event handler}, the {@link #setSchemas(Resource[])
* schemas}, {@link #setMarshallerListener(javax.xml.bind.Marshaller.Listener) listener}, and
* {@link #setAdapters(XmlAdapter[]) adapters}.
*/
protected void initJaxbMarshaller(Marshaller marshaller) throws JAXBException {
if (this.marshallerProperties != null) {
for (String name : this.marshallerProperties.keySet()) {
marshaller.setProperty(name, this.marshallerProperties.get(name));
}
}
if (this.marshallerListener != null) {
marshaller.setListener(this.marshallerListener);
}
if (this.validationEventHandler != null) {
marshaller.setEventHandler(this.validationEventHandler);
}
if (this.adapters != null) {
for (XmlAdapter<?, ?> adapter : this.adapters) {
marshaller.setAdapter(adapter);
}
}
if (this.schema != null) {
marshaller.setSchema(this.schema);
}
}
Jaxb2Marshaller.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:spring4-understanding
作者:
评论列表
文章目录