com.sun.xml.internal.ws.spi.db.BindingContext Java Examples

The following examples show how to use com.sun.xml.internal.ws.spi.db.BindingContext. 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: LogicalMessageImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public Object getPayload(BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (context == null)
        throw new WebServiceException("JAXBContext parameter cannot be null");

    Object o;
    if (lm == null) {
        try {
            o = packet.getMessage().copy().readPayloadAsJAXB(context.createUnmarshaller());
        } catch (JAXBException e) {
            throw new WebServiceException(e);
        }
    } else {
        o = lm.getPayload(context);
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), o);
    }
    return o;
}
 
Example #2
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Object getPayload(BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (context == null)
        throw new WebServiceException("JAXBContext parameter cannot be null");

    Object o;
    if (lm == null) {
        try {
            o = packet.getMessage().copy().readPayloadAsJAXB(context.createUnmarshaller());
        } catch (JAXBException e) {
            throw new WebServiceException(e);
        }
    } else {
        o = lm.getPayload(context);
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), o);
    }
    return o;
}
 
Example #3
Source File: LogicalMessageImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public Object getPayload(BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (context == null)
        throw new WebServiceException("JAXBContext parameter cannot be null");

    Object o;
    if (lm == null) {
        try {
            o = packet.getMessage().copy().readPayloadAsJAXB(context.createUnmarshaller());
        } catch (JAXBException e) {
            throw new WebServiceException(e);
        }
    } else {
        o = lm.getPayload(context);
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), o);
    }
    return o;
}
 
Example #4
Source File: LogicalMessageImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Object getPayload(BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (context == null)
        throw new WebServiceException("JAXBContext parameter cannot be null");

    Object o;
    if (lm == null) {
        try {
            o = packet.getMessage().copy().readPayloadAsJAXB(context.createUnmarshaller());
        } catch (JAXBException e) {
            throw new WebServiceException(e);
        }
    } else {
        o = lm.getPayload(context);
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), o);
    }
    return o;
}
 
Example #5
Source File: JAXBMessage.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage( BindingContext context, Object jaxbObject, SOAPVersion soapVer, MessageHeaders headers, AttachmentSet attachments ) {
        super(soapVer);
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();
        this.rawContext = null;
        this.jaxbObject = jaxbObject;
        this.headers = headers;
        this.attachmentSet = attachments;
    }
 
Example #6
Source File: JAXBRIContextFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #7
Source File: JAXBRIContextFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #8
Source File: JAXBHeader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JAXBHeader(BindingContext context, Object jaxbObject) {
        this.jaxbObject = jaxbObject;
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();

        if (jaxbObject instanceof JAXBElement) {
            JAXBElement e = (JAXBElement) jaxbObject;
            this.nsUri = e.getName().getNamespaceURI();
            this.localName = e.getName().getLocalPart();
        }
    }
 
Example #9
Source File: JAXBHeader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBHeader(BindingContext context, Object jaxbObject) {
        this.jaxbObject = jaxbObject;
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();

        if (jaxbObject instanceof JAXBElement) {
            JAXBElement e = (JAXBElement) jaxbObject;
            this.nsUri = e.getName().getNamespaceURI();
            this.localName = e.getName().getLocalPart();
        }
    }
 
Example #10
Source File: LogicalMessageImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
//          if(context == ctxt) {
//              return o;
//          }
          try {
              Source payloadSrc = getPayload();
              if (payloadSrc == null)
                  return null;
              Unmarshaller unmarshaller = context.createUnmarshaller();
              return unmarshaller.unmarshal(payloadSrc);
          } catch (JAXBException e) {
              throw new WebServiceException(e);
          }
      }
 
Example #11
Source File: LogicalMessageImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
    try {
        Source payloadSrc = getPayload();
        if (payloadSrc == null)
            return null;
        Unmarshaller unmarshaller = context.createUnmarshaller();
        return unmarshaller.unmarshal(payloadSrc);
    } catch (JAXBException e) {
        throw new WebServiceException(e);
    }

}
 
Example #12
Source File: LogicalMessageImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setPayload(Object payload, BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (payload == null) {
        lm = new EmptyLogicalMessageImpl();
    } else {
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), payload);
    }
}
 
Example #13
Source File: LogicalMessageImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
//          if(context == ctxt) {
//              return o;
//          }
          try {
              Source payloadSrc = getPayload();
              if (payloadSrc == null)
                  return null;
              Unmarshaller unmarshaller = context.createUnmarshaller();
              return unmarshaller.unmarshal(payloadSrc);
          } catch (JAXBException e) {
              throw new WebServiceException(e);
          }
      }
 
Example #14
Source File: JAXBHeader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBHeader(BindingContext context, Object jaxbObject) {
        this.jaxbObject = jaxbObject;
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();

        if (jaxbObject instanceof JAXBElement) {
            JAXBElement e = (JAXBElement) jaxbObject;
            this.nsUri = e.getName().getNamespaceURI();
            this.localName = e.getName().getLocalPart();
        }
    }
 
Example #15
Source File: LogicalMessageImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setPayload(Object payload, BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (payload == null) {
        lm = new EmptyLogicalMessageImpl();
    } else {
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), payload);
    }
}
 
Example #16
Source File: LogicalMessageImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void setPayload(Object payload, BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (payload == null) {
        lm = new EmptyLogicalMessageImpl();
    } else {
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), payload);
    }
}
 
Example #17
Source File: JAXBRIContextFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #18
Source File: JAXBRIContextFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #19
Source File: JAXBRIContextFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #20
Source File: JAXBHeader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBHeader(BindingContext context, Object jaxbObject) {
        this.jaxbObject = jaxbObject;
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();

        if (jaxbObject instanceof JAXBElement) {
            JAXBElement e = (JAXBElement) jaxbObject;
            this.nsUri = e.getName().getNamespaceURI();
            this.localName = e.getName().getLocalPart();
        }
    }
 
Example #21
Source File: JAXBMessage.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage( BindingContext context, Object jaxbObject, SOAPVersion soapVer, MessageHeaders headers, AttachmentSet attachments ) {
        super(soapVer);
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();
        this.rawContext = null;
        this.jaxbObject = jaxbObject;
        this.headers = headers;
        this.attachmentSet = attachments;
    }
 
Example #22
Source File: JAXBMessage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage( BindingContext context, Object jaxbObject, SOAPVersion soapVer, MessageHeaders headers, AttachmentSet attachments ) {
        super(soapVer);
//        this.bridge = new MarshallerBridge(context);
        this.bridge = context.createFragmentBridge();
        this.rawContext = null;
        this.jaxbObject = jaxbObject;
        this.headers = headers;
        this.attachmentSet = attachments;
    }
 
Example #23
Source File: LogicalMessageImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
//          if(context == ctxt) {
//              return o;
//          }
          try {
              Source payloadSrc = getPayload();
              if (payloadSrc == null)
                  return null;
              Unmarshaller unmarshaller = context.createUnmarshaller();
              return unmarshaller.unmarshal(payloadSrc);
          } catch (JAXBException e) {
              throw new WebServiceException(e);
          }
      }
 
Example #24
Source File: LogicalMessageImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
//          if(context == ctxt) {
//              return o;
//          }
          try {
              Source payloadSrc = getPayload();
              if (payloadSrc == null)
                  return null;
              Unmarshaller unmarshaller = context.createUnmarshaller();
              return unmarshaller.unmarshal(payloadSrc);
          } catch (JAXBException e) {
              throw new WebServiceException(e);
          }
      }
 
Example #25
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setPayload(Object payload, BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (payload == null) {
        lm = new EmptyLogicalMessageImpl();
    } else {
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), payload);
    }
}
 
Example #26
Source File: JAXBRIContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #27
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
//          if(context == ctxt) {
//              return o;
//          }
          try {
              Source payloadSrc = getPayload();
              if (payloadSrc == null)
                  return null;
              Unmarshaller unmarshaller = context.createUnmarshaller();
              return unmarshaller.unmarshal(payloadSrc);
          } catch (JAXBException e) {
              throw new WebServiceException(e);
          }
      }
 
Example #28
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Object getPayload(BindingContext context) {
    try {
        Source payloadSrc = getPayload();
        if (payloadSrc == null)
            return null;
        Unmarshaller unmarshaller = context.createUnmarshaller();
        return unmarshaller.unmarshal(payloadSrc);
    } catch (JAXBException e) {
        throw new WebServiceException(e);
    }

}
 
Example #29
Source File: LogicalMessageImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void setPayload(Object payload, BindingContext context) {
    if (context == null) {
        context = defaultJaxbContext;
    }
    if (payload == null) {
        lm = new EmptyLogicalMessageImpl();
    } else {
        lm = new JAXBLogicalMessageImpl(context.getJAXBContext(), payload);
    }
}
 
Example #30
Source File: WrapperBridge.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public BindingContext context() {
    return parent;
}