Examples of Unmarshaller


Examples of org.jboss.xb.binding.Unmarshaller

      {
         if ((sharedWebMetaData == null && webXml != null)
               || (sharedJBossWebMetaData == null && jbossWebXml != null))
         {
            UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
            Unmarshaller unmarshaller = factory.newUnmarshaller();
            SchemaBindingResolver resolver = SingletonSchemaResolverFactory
                  .getInstance().getSchemaBindingResolver();
            if (webXml != null)
            {
               try
               {
                  sharedWebMetaData = (WebMetaData) unmarshaller.unmarshal(webXml, resolver);
               }
               catch (JBossXBException e)
               {
                  throw new DeploymentException("Error parsing shared web.xml", e);
               }
            }
            if (jbossWebXml != null)
            {
               try
               {
                  sharedJBossWebMetaData = (JBossWebMetaData) unmarshaller.unmarshal(jbossWebXml, resolver);
               }
               catch (JBossXBException e)
               {
                  throw new DeploymentException("Error parsing shared jboss-web.xml", e);
               }
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

         return this.ddParser.parse(file.toURL());
      }
      else if (this.ddProcessor != null)
      {
         InputSource source = new VFSInputSource(file);
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
         unmarshaller.setValidation(this.ddProcessor.isValidating());
         ObjectModelFactory factory = this.ddProcessor.getFactory(file.toURL());
         return (T)unmarshaller.unmarshal(source, factory, root);
      }

      return null;
   }
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

   {
      SecurityConfigObjectModelFactory lcomf = new SecurityConfigObjectModelFactory();
      UsersObjectModelFactory uomf = new UsersObjectModelFactory();
     
      InputStreamReader xmlReader = new InputStreamReader(loginConfigURL.openStream());
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      unmarshaller.mapFactoryToNamespace(uomf, "http://www.jboss.org/j2ee/schemas/XMLLoginModule");
      policyConfig = (PolicyConfig) unmarshaller.unmarshal(xmlReader, lcomf, (Object)null);
   }
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

      ObjectName objectName = new ObjectName(objectNameS);

      // Parse main server.xml
      // FIXME: this could be done somewhere else
      SchemaBinding schema = JBossXBBuilder.build(ServerMetaData.class);
      Unmarshaller u = UnmarshallerFactory.newInstance().newUnmarshaller();
      u.setSchemaValidation(false);
      u.setValidation(false);
      u.setEntityResolver(new JBossEntityResolver());
      InputStream is = null;
      ServerMetaData serverMetaData = null;
      try {
         File configFile = new File(tomcatDeployer.getConfigFile());
         if (configFile.exists())
         {
            is = new FileInputStream(configFile);
         }
         else
         {
            is = getClass().getClassLoader().getResourceAsStream(tomcatDeployer.getConfigFile());
         }
         if (is == null) {
            log.error("Could not read configured server.xml (will try default): " + tomcatDeployer.getConfigFile());
            is = getClass().getClassLoader().getResourceAsStream("server.xml");
         }
         serverMetaData = ServerMetaData.class.cast(u.unmarshal(is, schema));
      } finally {
         if (is != null) {
            try {
               is.close();
            } catch (IOException e) {
View Full Code Here

Examples of org.jboss.xb.binding.Unmarshaller

   }
  
  
   protected KernelDeployment parse(String name) throws Throwable
   {
      Unmarshaller unmarshaller = factory.newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(name, resolver);
      deployment.setName(name);
      return deployment;
   }
View Full Code Here

Examples of org.jdbf.engine.xml.Unmarshaller

    */
   
    public static ObjectMapped unmarshall(String xml)
      throws UnmarshallException{
     
      Unmarshaller unmarshaller = new Unmarshaller();
      return unmarshaller.getUnmarshallObject(xml);
    }
View Full Code Here

Examples of org.jongo.marshall.Unmarshaller

    @Test
    //https://groups.google.com/forum/?fromgroups#!topic/jongo-user/Nu4J1tK0kAM
    public void canSelectOnlyAField() throws Exception {

        final Unmarshaller unmarshaller = getMapper().getUnmarshaller();
        Party party = new Party();
        party.with(new Friend("John"));
        party.with(new Friend("Peter"));
        party.with(new Friend("Robert"));
        collection.save(party);

        Friend friend = collection.findOne("{friends.name:'Peter'}").projection("{friends.$:1}").map(new ResultHandler<Friend>() {
            public Friend map(DBObject dbo) {
                Party result = unmarshaller.unmarshall((BsonDocument) dbo, Party.class);
                return result.friends.get(0);
            }
        });

        assertThat(friend.getName()).isEqualTo("Peter");
View Full Code Here

Examples of org.opensaml.xml.io.Unmarshaller

   public XMLObject toXMLObject(Element element) throws UnmarshallingException
   {
      if(element ==null)
         throw new IllegalArgumentException("Null Element");
      UnmarshallerFactory factory = Configuration.getUnmarshallerFactory();
      Unmarshaller unmarshaller = factory.getUnmarshaller(element);
      if(unmarshaller == null)
         throw new IllegalStateException("Unmarshaller for element "+element.getLocalName()
               + " is null");
      return unmarshaller.unmarshall(element);
   }
View Full Code Here

Examples of org.springframework.oxm.Unmarshaller

    public void testSendAndReceiveMarshalResponse() throws Exception {
        Marshaller marshallerMock = createMock(Marshaller.class);
        template.setMarshaller(marshallerMock);
        marshallerMock.marshal(isA(Object.class), isA(Result.class));

        Unmarshaller unmarshallerMock = createMock(Unmarshaller.class);
        template.setUnmarshaller(unmarshallerMock);
        Object unmarshalled = new Object();
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(unmarshalled);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
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.