Examples of Unmarshaller


Examples of javax.xml.bind.Unmarshaller

            catch (NumberFormatException ignored)
            {
            }
         }
         JAXBContext jaxb = findJAXBContext(type, annotations, mediaType, true);
         Unmarshaller unmarshaller = jaxb.createUnmarshaller();
         unmarshaller = decorateUnmarshaller(type, annotations, mediaType, unmarshaller);
         return (T) unmarshaller.unmarshal(new StreamSource(entityStream));
      }
      catch (JAXBException e)
      {
         throw new JAXBUnmarshalException(e);
      }
View Full Code Here

Examples of org.davinci.server.review.persistence.Unmarshaller

    }
    if (reviewHash != null)
      return reviewHash;

    // Load the review file from disk.
    Unmarshaller unmarshaller = new Unmarshaller();
    CommentsDocument document = null;
    synchronized(project){
      document = unmarshaller.unmarshall(project);

      List<Comment> commentList = document.getCommentList();
      reviewHash = new Hashtable<String, Comment>();
      for (Comment comment : commentList) {
        reviewHash.put(comment.getId(), comment);
View Full Code Here

Examples of org.exolab.castor.xml.Unmarshaller

    if (f1.exists() && f2.exists()) {
      Mapping mapping = new Mapping();
      try {
  mapping.loadMapping(f1.getPath());
  Unmarshaller unmar = new Unmarshaller(mapping);
  unmar.setDebug(true);
  baseobj=(JoBoBase)unmar.unmarshal(new InputSource(f2.getPath()));
 
  log.info("configured from XML");
       
      } catch (Exception e) {
  log.error(e.getMessage());
View Full Code Here

Examples of org.exolab.castor.xml.Unmarshaller

        _validate = validate;

        // _cdr = new XMLClassDescriptorResolverImpl();
        if ( _mapping != null )
        {
            _unmarshaller = new Unmarshaller( _mapping );
        }
        else
        {
            _unmarshaller = new Unmarshaller();
        }
        // _unmarshaller.setResolver(_cdr);
        _unmarshaller.setValidation( validate );

        _unmarshaller.setResolver( _cdr );
View Full Code Here

Examples of org.exolab.castor.xml.Unmarshaller

      Mapping mapping = new Mapping();
      mapping.loadMapping(
        new InputSource(mis)
        );
     
      Unmarshaller unmarshaller = new Unmarshaller(mapping);
      settings =
        (ChartThemeSettings)unmarshaller.unmarshal(
          new InputSource(is)
        );
    }
    catch (MappingException e)
    {
View Full Code Here

Examples of org.exolab.castor.xml.Unmarshaller

      Mapping mapping = new Mapping();
      mapping.loadMapping(new InputSource(ExtendedGrammar.class.getResource("mapping.xml")
                                                               .openStream()));

      Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
      unmarshaller.setMapping(mapping);

      this.grammar = (ExtendedGrammar)unmarshaller.unmarshal(new FileReader(grammarFile));

      if (log.isDebugEnabled())
        log.debug("grammar:\n"+grammar);
    }
    catch (Exception ex)
View Full Code Here

Examples of org.jboss.marshalling.Unmarshaller

    return baos.toByteArray();
  }

  T unmarshall(byte[] bytes) throws Exception {
    Unmarshaller unmarshaller = getUnmarshaller();
    InputStream is = new ByteArrayInputStream( bytes );
    try {
      unmarshaller.start( Marshalling.createByteInput( is ) );
      T object = externalizer.readObject( unmarshaller );
      unmarshaller.finish();

      return object;
    }
    finally {
      try {
View Full Code Here

Examples of org.jboss.remoting.marshal.UnMarshaller

      int invokeCount = 0;

      if (trace) { log.trace(this + "(" + (++invokeCount) + ") invoking " + invocationReq); }

      Marshaller marshaller = getMarshaller();
      UnMarshaller unmarshaller = getUnMarshaller();

      if (marshaller == null)
      {
         // try by locator (in case marshaller class name specified)
         Map map = passConfigMapToMarshalFactory ? configuration : null;
         marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader(), map);
         if (marshaller == null)
         {
            // need to have a marshaller, so create a default one
            marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
            if (marshaller == null)
            {
               // went as far as possible to find a marshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid marshaller for data type: " + getDataType());
            }
            setMarshaller(marshaller);
         }
      }

      if (unmarshaller == null)
      {
         // creating a new classloader containing the remoting class loader (for remote classloading)
         // and the current thread's class loader.  This allows to load remoting classes as well as
         // user's classes.
         RemotingClassLoader remotingClassLoader = null;
         if (parentFirstClassLoading)
         {
            remotingClassLoader = new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
         }
         else
         {
            remotingClassLoader = new RemotingClassLoader(Thread.currentThread().getContextClassLoader(), getClassLoader());
         }
         remotingClassLoader.setUseCurrentThreadClassLoader(useCurrentThreadClassLoader);

         // try by locator (in case unmarshaller class name specified)
         Map map = passConfigMapToMarshalFactory ? configuration : null;
         unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader(), map);
         if (unmarshaller == null)
         {
            unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
            if (unmarshaller == null)
            {
               // went as far as possible to find a unmarshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid unmarshaller for data type: " + getDataType());
            }
         }
         unmarshaller.setClassLoader(remotingClassLoader);
        
         if (!useCurrentThreadClassLoader)
         {
            setUnMarshaller(unmarshaller);
         }
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

  
   public EjbJar21MetaData getEJBMetaData(InputStream ejbJarXml)
      throws JBossXBException
   {
      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      SchemaBinding schema = JBossXBBuilder.build(EjbJar21MetaData.class);
      JBossEntityResolver entityResolver = new JBossEntityResolver();
      unmarshaller.setEntityResolver(entityResolver);

      return (EjbJar21MetaData) unmarshaller.unmarshal(ejbJarXml, schema);
   }
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

  
   public WebMetaData getWebMetaData(InputStream webxml)
      throws JBossXBException
   {
      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      SchemaBinding schema = JBossXBBuilder.build(Web24MetaData.class);
      JBossEntityResolver entityResolver = new JBossEntityResolver();
      unmarshaller.setEntityResolver(entityResolver);

      return (WebMetaData) unmarshaller.unmarshal(webxml, schema);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.