当前位置: 首页>>代码示例>>Java>>正文


Java Marshaller.Listener方法代码示例

本文整理汇总了Java中javax.xml.bind.Marshaller.Listener方法的典型用法代码示例。如果您正苦于以下问题:Java Marshaller.Listener方法的具体用法?Java Marshaller.Listener怎么用?Java Marshaller.Listener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.bind.Marshaller的用法示例。


在下文中一共展示了Marshaller.Listener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fireAfterMarshalEvents

import javax.xml.bind.Marshaller; //导入方法依赖的package包/类
/**
 * Invoke the afterMarshal api on the external listener (if it exists) and on the bean embedded
 * afterMarshal api(if it exists).
 *
 * This method is called only after the callee has determined that beanInfo.lookForLifecycleMethods == true.
 *
 * @param beanInfo
 * @param currentTarget
 */
private void fireAfterMarshalEvents(final JaxBeanInfo beanInfo, Object currentTarget) {
    // first invoke bean embedded listener
    if (beanInfo.hasAfterMarshalMethod()) {
        Method m = beanInfo.getLifecycleMethods().afterMarshal;
        fireMarshalEvent(currentTarget, m);
    }

    // then invoke external listener before bean embedded listener
    Marshaller.Listener externalListener = marshaller.getListener();
    if (externalListener != null) {
        externalListener.afterMarshal(currentTarget);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:XMLSerializer.java

示例2: fireBeforeMarshalEvents

import javax.xml.bind.Marshaller; //导入方法依赖的package包/类
/**
 * Invoke the beforeMarshal api on the external listener (if it exists) and on the bean embedded
 * beforeMarshal api(if it exists).
 *
 * This method is called only after the callee has determined that beanInfo.lookForLifecycleMethods == true.
 *
 * @param beanInfo
 * @param currentTarget
 */
private void fireBeforeMarshalEvents(final JaxBeanInfo beanInfo, Object currentTarget) {
    // first invoke bean embedded listener
    if (beanInfo.hasBeforeMarshalMethod()) {
        Method m = beanInfo.getLifecycleMethods().beforeMarshal;
        fireMarshalEvent(currentTarget, m);
    }

    // then invoke external listener
    Marshaller.Listener externalListener = marshaller.getListener();
    if (externalListener != null) {
        externalListener.beforeMarshal(currentTarget);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:XMLSerializer.java


注:本文中的javax.xml.bind.Marshaller.Listener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。