Java Code Examples for com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext#createInstance()

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext#createInstance() . 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: RuntimeClassInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 2
Source File: ElementBeanInfoImpl.java    From TencentKona-8 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 3
Source File: RuntimeClassInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 4
Source File: ElementBeanInfoImpl.java    From jdk8u60 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 5
Source File: RuntimeClassInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 6
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 7
Source File: RuntimeClassInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 8
Source File: ElementBeanInfoImpl.java    From openjdk-jdk8u-backup 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 9
Source File: RuntimeClassInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 10
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 11
Source File: RuntimeClassInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 12
Source File: ElementBeanInfoImpl.java    From hottub 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 13
Source File: RuntimeClassInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 14
Source File: ElementBeanInfoImpl.java    From openjdk-8-source 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.loader = core;
    state.intercepter = 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.prev;
    p.backup = p.target;
    p.target = child;

    core.startElement(state,ea);
}
 
Example 15
Source File: RuntimeClassInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException {
    UnmarshallingContext ctxt = UnmarshallingContext.getInstance();
    BeanT inst;
    if(ctxt!=null)
        inst = (BeanT)ctxt.createInstance(ownerClass);
    else
        // when this runs for parsing enum constants,
        // there's no UnmarshallingContext.
        inst = ClassFactory.create(ownerClass);

    xacc.parse(inst,lexical);
    return inst;
}
 
Example 16
Source File: ElementBeanInfoImpl.java    From openjdk-8 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.loader = core;
    state.intercepter = 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.prev;
    p.backup = p.target;
    p.target = child;

    core.startElement(state,ea);
}