Package javax.xml.bind

Examples of javax.xml.bind.JAXBContext


  List<SoapEventMap> getEvents() throws TranslationException {
    // list of SoapEventMap objs
    List<SoapEventMap> events = new ArrayList<SoapEventMap>();

    try {
      JAXBContext jcontext = JAXBContext.newInstance(this.eventPkg);

      Unmarshaller unmarshaller = jcontext.createUnmarshaller();

      if (this.elements != null) {
        for (Element element : this.elements) {
          if (element != null) {
            SoapEventMap event = new SoapEventMap();
View Full Code Here


    if ((obj != null) && obj instanceof Element) {
      result = (Element) obj;
    } else if (obj != null) {
      try {
        JAXBContext jcontext = JAXBContext.newInstance(this.eventPkg);
        Marshaller marshaller = jcontext.createMarshaller();

        Document doc = getTargetDocument();
       
        if (obj instanceof JaxbEventBase) {
          JaxbEventBase jeb = (JaxbEventBase)obj;
View Full Code Here

        boolean result = true;
        String evtName = this.getEventName();
        this.setEventName(null);
        try {
      ValidationMonitor monitor = new ValidationMonitor();
      JAXBContext context = JAXBContext.newInstance(this.getClass().getPackage().getName());
      Marshaller marshaller = context.createMarshaller();
      marshaller.setSchema(this.validatingSchema);
      marshaller.setEventHandler(monitor);
      marshaller.marshal(getMarshallableType(), getTargetDocument());
     
      monitor.populate(errors);
View Full Code Here

  }

  static public Object unmarshall(String path, String pkg, ClassLoader loader)
      throws Exception {
    LOGGER.debug("Unmarshalling " + path + " in package " + pkg); //$NON-NLS-1$ //$NON-NLS-2$
    JAXBContext jc = JAXBContext.newInstance(pkg, loader);
    Unmarshaller u = jc.createUnmarshaller();
    InputStream istream = ClassLoader.getSystemResourceAsStream(path);

    return u.unmarshal(istream);
  }
View Full Code Here

  }

  static public OutputStream marshall(Object obj, String pkg,
      ClassLoader loader) throws Exception {
    LOGGER.debug("Marshalling " + obj + " in package " + pkg); //$NON-NLS-1$ //$NON-NLS-2$
    JAXBContext jc = JAXBContext.newInstance(pkg, loader);
    Marshaller m = jc.createMarshaller();
    OutputStream ostream = new ByteArrayOutputStream();

    m.marshal(obj, ostream);

    return ostream;
View Full Code Here

    return ostream;
  }
 
  static public Document marshall(Object obj, String pkg, Document targetDoc, ClassLoader loader) throws Exception {
    JAXBContext jc = JAXBContext.newInstance(pkg, loader);
    Marshaller m = jc.createMarshaller();

    m.marshal(obj, targetDoc);

    return targetDoc;
  }
View Full Code Here

                                                      HandlerChain handlerChain)
    throws WebServiceException
  {
    try {
      if (_handlerChainUnmarshaller == null) {
        JAXBContext context =
          JAXBContext.newInstance("com.caucho.soap.jaxws.handlerchain");
        _handlerChainUnmarshaller = context.createUnmarshaller();
      }

      if (log.isLoggable(Level.FINER)) {
        log.finer("Creating handler chain for " + cl +
                  " from file " + handlerChain.file());
View Full Code Here

    _wsdl = wsdl;
    _serviceName = serviceName;
    _serviceClass = serviceClass;

    try {
      JAXBContext context =
        JAXBContext.newInstance("com.caucho.soap.jaxws.handlerchain");
      _handlerUnmarshaller = context.createUnmarshaller();
    }
    catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        assertNotNull("logical message is null", msg);
                        JAXBContext jaxbCtx = JAXBContext.newInstance(PackageUtils
                            .getPackageName(PingOneWay.class));
                        PingResponse resp = new PingResponse();
                        resp.getHandlersInfo().add(clientHandlerMessage);

                        msg.setPayload(resp, jaxbCtx);
View Full Code Here

                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        assertNotNull("logical message is null", msg);
                        JAXBContext jaxbCtx = JAXBContext.newInstance(PackageUtils
                            .getPackageName(PingOneWay.class));
                        PingResponse resp = new PingResponse();
                        resp.getHandlersInfo().add(clientHandlerMessage);

                        msg.setPayload(resp, jaxbCtx);
View Full Code Here

TOP

Related Classes of javax.xml.bind.JAXBContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.