Пример #1
0
 /**
  * Fires the afterUnmarshal event if necessary.
  *
  * @param state state of the parent object
  */
 protected final void fireAfterUnmarshal(
     JaxBeanInfo beanInfo, Object child, UnmarshallingContext.State state) throws SAXException {
   // fire the event callback
   if (beanInfo.lookForLifecycleMethods()) {
     UnmarshallingContext context = state.getContext();
     Unmarshaller.Listener listener = context.parent.getListener();
     if (beanInfo.hasAfterUnmarshalMethod()) {
       beanInfo.invokeAfterUnmarshalMethod(context.parent, child, state.target);
     }
     if (listener != null) listener.afterUnmarshal(child, state.target);
   }
 }
Пример #2
0
 /**
  * Fires the beforeUnmarshal event if necessary.
  *
  * @param state state of the newly create child object.
  */
 protected final void fireBeforeUnmarshal(
     JaxBeanInfo beanInfo, Object child, UnmarshallingContext.State state) throws SAXException {
   if (beanInfo.lookForLifecycleMethods()) {
     UnmarshallingContext context = state.getContext();
     Unmarshaller.Listener listener = context.parent.getListener();
     if (beanInfo.hasBeforeUnmarshalMethod()) {
       beanInfo.invokeBeforeUnmarshalMethod(context.parent, child, state.prev.target);
     }
     if (listener != null) {
       listener.beforeUnmarshal(child, state.prev.target);
     }
   }
 }
 public void buildChildElementUnmarshallers(
     UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
   keyLoader = keyBeanInfo.getLoader(chain.context, true);
   valueLoader = valueBeanInfo.getLoader(chain.context, true);
   handlers.put(tagName, new ChildLoader(itemsLoader, null));
 }