com.sun.xml.internal.bind.v2.runtime.unmarshaller.TagName Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.unmarshaller.TagName. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SingleMapNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.prev.target);
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.target = map.get();
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.target = new HashMap();
    }
}
 
Example #2
Source File: SingleMapNodeProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.getPrev().getTarget());
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.setTarget(map.get());
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.setTarget(new HashMap());
    }
}
 
Example #3
Source File: SingleMapNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.getPrev().getTarget());
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.setTarget(map.get());
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.setTarget(new HashMap());
    }
}
 
Example #4
Source File: SingleMapNodeProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.getPrev().getTarget());
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.setTarget(map.get());
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.setTarget(new HashMap());
    }
}
 
Example #5
Source File: SingleMapNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.getPrev().getTarget());
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.setTarget(map.get());
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.setTarget(new HashMap());
    }
}
 
Example #6
Source File: SingleMapNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.getPrev().getTarget());
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.setTarget(map.get());
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.setTarget(new HashMap());
    }
}
 
Example #7
Source File: SingleMapNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    // create or obtain the Map object
    try {
        target.set((BeanT)state.prev.target);
        map.set(acc.get(target.get()));
        depthCounter++;
        if(map.get() == null) {
            map.set(ClassFactory.create(mapImplClass));
        }
        map.get().clear();
        state.target = map.get();
    } catch (AccessorException e) {
        // recover from error by setting a dummy Map that receives and discards the values
        handleGenericException(e,true);
        state.target = new HashMap();
    }
}
 
Example #8
Source File: SingleMapNodeProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(entryTag)) {
        state.setLoader(entryLoader);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #9
Source File: ElementBeanInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    state.setLoader(core);
    state.setIntercepter(this);

    // TODO: make sure there aren't too many duplicate of this code
    // create the object to unmarshal
    Object child;
    UnmarshallingContext context = state.getContext();

    // let's see if we can reuse the existing peer object
    child = context.getOuterPeer();

    if(child!=null && jaxbType!=child.getClass())
        child = null;   // unexpected type.

    if(child!=null)
        reset((JAXBElement)child,context);

    if(child==null)
        child = context.createInstance(ElementBeanInfoImpl.this);

    fireBeforeUnmarshal(ElementBeanInfoImpl.this, child, state);

    context.recordOuterPeer(child);
    UnmarshallingContext.State p = state.getPrev();
    p.setBackup(p.getTarget());
    p.setTarget(child);

    core.startElement(state,ea);
}
 
Example #10
Source File: JAXBContextImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Based on the tag name, determine what object to unmarshal,
 * and then set a new object and its loader to the current unmarshaller state.
 *
 * @return
 *      null if the given name pair is not recognized.
 */
public final Loader selectRootLoader( UnmarshallingContext.State state, TagName tag ) {
    JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local);
    if(beanInfo==null)
        return null;

    return beanInfo.getLoader(this,true);
}
 
Example #11
Source File: ArrayERProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    ChildLoader child = children.get(ea.uri,ea.local);
    if (child == null) {
        child = children.get(CATCH_ALL);
    }
    if (child == null) {
        super.childElement(state,ea);
        return;
    }
    state.setLoader(child.loader);
    state.setReceiver(child.receiver);
}
 
Example #12
Source File: ArrayERProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    UnmarshallingContext context = state.getContext();
    context.startScope(1);
    // inherit the target so that our children can access its target
    state.setTarget(state.getPrev().getTarget());

    // start it now, so that even if there's no children we can still return empty collection
    context.getScope(0).start(acc,lister);
}
 
Example #13
Source File: SingleMapNodeProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(keyTag)) {
        state.setLoader(keyLoader);
        state.setReceiver(keyReceiver);
        return;
    }
    if(ea.matches(valueTag)) {
        state.setLoader(valueLoader);
        state.setReceiver(valueReceiver);
        return;
    }
    super.childElement(state,ea);
}
 
Example #14
Source File: SingleMapNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(keyTag)) {
        state.loader = keyLoader;
        state.receiver = keyReceiver;
        return;
    }
    if(ea.matches(valueTag)) {
        state.loader = valueLoader;
        state.receiver = valueReceiver;
        return;
    }
    super.childElement(state,ea);
}
 
Example #15
Source File: SingleMapNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(keyTag)) {
        state.setLoader(keyLoader);
        state.setReceiver(keyReceiver);
        return;
    }
    if(ea.matches(valueTag)) {
        state.setLoader(valueLoader);
        state.setReceiver(valueReceiver);
        return;
    }
    super.childElement(state,ea);
}
 
Example #16
Source File: SingleMapNodeProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void leaveElement(State state, TagName ea) throws SAXException {
    super.leaveElement(state, ea);
    try {
        acc.set(target.get(), map.get());
        if (--depthCounter == 0) {
            target.remove();
            map.remove();
        }
    } catch (AccessorException ex) {
        handleGenericException(ex,true);
    }
}
 
Example #17
Source File: ArrayBeanInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches("","item")) {
        state.setLoader(itemLoader);
        state.setReceiver(this);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #18
Source File: SingleMapNodeProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(entryTag)) {
        state.setLoader(entryLoader);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #19
Source File: ArrayBeanInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches("","item")) {
        state.setLoader(itemLoader);
        state.setReceiver(this);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #20
Source File: JAXBContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Based on the tag name, determine what object to unmarshal,
 * and then set a new object and its loader to the current unmarshaller state.
 *
 * @return
 *      null if the given name pair is not recognized.
 */
public final Loader selectRootLoader( UnmarshallingContext.State state, TagName tag ) {
    JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local);
    if(beanInfo==null)
        return null;

    return beanInfo.getLoader(this,true);
}
 
Example #21
Source File: ArrayERProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    ChildLoader child = children.get(ea.uri,ea.local);
    if (child == null) {
        child = children.get(CATCH_ALL);
    }
    if (child == null) {
        super.childElement(state,ea);
        return;
    }
    state.setLoader(child.loader);
    state.setReceiver(child.receiver);
}
 
Example #22
Source File: ArrayERProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    UnmarshallingContext context = state.getContext();
    context.startScope(1);
    // inherit the target so that our children can access its target
    state.setTarget(state.getPrev().getTarget());

    // start it now, so that even if there's no children we can still return empty collection
    context.getScope(0).start(acc,lister);
}
 
Example #23
Source File: SingleMapNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void leaveElement(State state, TagName ea) throws SAXException {
    super.leaveElement(state, ea);
    try {
        acc.set(target.get(), map.get());
        if (--depthCounter == 0) {
            target.remove();
            map.remove();
        }
    } catch (AccessorException ex) {
        handleGenericException(ex,true);
    }
}
 
Example #24
Source File: SingleMapNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches(entryTag)) {
        state.setLoader(entryLoader);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #25
Source File: ArrayERProperty.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    ChildLoader child = children.get(ea.uri,ea.local);
    if (child == null) {
        child = children.get(CATCH_ALL);
    }
    if (child == null) {
        super.childElement(state,ea);
        return;
    }
    state.loader = child.loader;
    state.receiver = child.receiver;
}
 
Example #26
Source File: ArrayBeanInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    if(ea.matches("","item")) {
        state.setLoader(itemLoader);
        state.setReceiver(this);
    } else {
        super.childElement(state,ea);
    }
}
 
Example #27
Source File: ElementBeanInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    state.setLoader(core);
    state.setIntercepter(this);

    // TODO: make sure there aren't too many duplicate of this code
    // create the object to unmarshal
    Object child;
    UnmarshallingContext context = state.getContext();

    // let's see if we can reuse the existing peer object
    child = context.getOuterPeer();

    if(child!=null && jaxbType!=child.getClass())
        child = null;   // unexpected type.

    if(child!=null)
        reset((JAXBElement)child,context);

    if(child==null)
        child = context.createInstance(ElementBeanInfoImpl.this);

    fireBeforeUnmarshal(ElementBeanInfoImpl.this, child, state);

    context.recordOuterPeer(child);
    UnmarshallingContext.State p = state.getPrev();
    p.setBackup(p.getTarget());
    p.setTarget(child);

    core.startElement(state,ea);
}
 
Example #28
Source File: JAXBContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Based on the tag name, determine what object to unmarshal,
 * and then set a new object and its loader to the current unmarshaller state.
 *
 * @return
 *      null if the given name pair is not recognized.
 */
public final Loader selectRootLoader( UnmarshallingContext.State state, TagName tag ) {
    JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local);
    if(beanInfo==null)
        return null;

    return beanInfo.getLoader(this,true);
}
 
Example #29
Source File: ArrayERProperty.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    UnmarshallingContext context = state.getContext();
    context.startScope(1);
    // inherit the target so that our children can access its target
    state.target = state.prev.target;

    // start it now, so that even if there's no children we can still return empty collection
    context.getScope(0).start(acc,lister);
}
 
Example #30
Source File: ArrayERProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
    ChildLoader child = children.get(ea.uri,ea.local);
    if (child == null) {
        child = children.get(CATCH_ALL);
    }
    if (child == null) {
        super.childElement(state,ea);
        return;
    }
    state.setLoader(child.loader);
    state.setReceiver(child.receiver);
}