Examples of Marshaller


Examples of org.jboss.remoting.marshal.Marshaller

         if (dataType != null)
         {
            // If found data type, will get marshaller and create interceptor wrapper for it
            // and then insert into interceptor chain
            Marshaller marshaller = MarshalFactory.getMarshaller(dataType);
            MarshallInterceptor marshallInterceptor = new MarshallInterceptor(marshaller);
            interceptorList.add(marshallInterceptor);
         }

         // Now onto creating transport interceptor
View Full Code Here

Examples of org.jboss.xb.binding.Marshaller

      InputStream is = getResource("xml/person.dtd");
      Reader dtdReader = new InputStreamReader(is);

      // create an instance of DTD marshaller
      Marshaller marshaller = new DtdMarshaller();

      // map publicId to systemId as it should appear in the resulting XML file
      marshaller.mapPublicIdToSystemId("-//DTD Person//EN", "resources/xml/person.dtd");

      // create an instance of ObjectModelProvider with the book instance to be marshalled
      MappingObjectModelProvider provider = new MappingObjectModelProvider();
      provider.mapFieldToElement(Person.class, "dateOfBirth", "", "date-of-birth", SimpleTypeBindings.JAVA_UTIL_DATE);

      // marshal the book
      marshaller.marshal(dtdReader, provider, person, xmlOutput);

      // close DTD reader
      dtdReader.close();

      final String xml = xmlOutput.getBuffer().toString();
View Full Code Here

Examples of org.jdbf.engine.xml.Marshaller

     *
     * @return the XML representation of object as String
     *
     */
    public String marshall() throws MarshallException{
      Marshaller marshaller = new Marshaller();
      return marshaller.getMarshallString(this);
    }
View Full Code Here

Examples of org.kie.api.marshalling.Marshaller

                // so we read it, but we don't need it, so just ignore.
                AbstractWorkingMemory rsession = (AbstractWorkingMemory) ois.readObject();

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(new KnowledgeBaseImpl(this), new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;

                if ( keepReference ) {
View Full Code Here

Examples of org.kie.marshalling.Marshaller

                // so we read it, but we don't need it, so just ignore.
                ReteooStatefulSession rsession = (ReteooStatefulSession) ois.readObject();
   
                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller( new KnowledgeBaseImpl( this )new ObjectMarshallingStrategy[] { MarshallerFactory.newSerializeMarshallingStrategy() }   );
               
                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                                           conf,
                                                                           environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;
   
                if ( keepReference ) {
View Full Code Here

Examples of org.opensaml.xml.io.Marshaller

      return new DateTime(ISOChronology.getInstanceUTC());
   }
  
   public Element toElement(XMLObject xmlObj) throws MarshallingException
   {
      Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(xmlObj);
      return marshaller.marshall(xmlObj);
   }
View Full Code Here

Examples of org.salamandra.o2.Marshaller

    super(object, trxo);
  }

  @Override
  public void marshal(Node node) throws Exception {
    new Marshaller().marshal( getBean() , node);
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.attributes.Marshaller

    FileUtils.copyDirectory(getTestResourceAsFile("storage/"), storageWorkDir);

    // now setup all the attributes
    File attributesInfo = getTestResourceAsFile("attributes.info");

    final Marshaller marshaller = new JacksonJSONMarshaller();

    final long now = System.currentTimeMillis();

    try (BufferedReader reader = new BufferedReader(new FileReader(attributesInfo))) {

      String line = reader.readLine();
      while (line != null) {
        final String[] parts = line.split(" ");
        final String repoFilePart = parts[0];
        final String repoId = repoFilePart.substring(0, repoFilePart.indexOf('/'));
        final String filePart = repoFilePart.substring(repoFilePart.indexOf('/'), repoFilePart.length());
        long offset = TimeUnit.DAYS.toMillis(Long.parseLong(parts[1]));

        // get the file
        File itemFile = new File(storageWorkDir, repoFilePart);
        if (itemFile.isFile()) {
          this.pathMap.put(repoFilePart, Integer.parseInt(parts[1]));

                    /*
                     * groups are not checked, so the hashes are left behind, see: NEXUS-3026
                     */
          if (repoFilePart.startsWith("releases/") || repoFilePart.startsWith("releases-m1/")
              || repoFilePart.startsWith("public/") || repoFilePart.startsWith("snapshots/")
              || repoFilePart.startsWith("thirdparty/") || repoFilePart.contains(".meta")
              || repoFilePart.contains(".index")) {
            neverDeleteFiles.add(repoFilePart);
          }

          // modify the file corresponding attribute
          final File attributeFile = new File(new File(new File(storageWorkDir, repoId), ".nexus/attributes"), filePart);
          Attributes attributes;
          try (FileInputStream in = new FileInputStream(attributeFile)) {
            attributes = marshaller.unmarshal(in);
          }

          // set new value
          attributes.setLastRequested(now + offset);

          // write it out
          try (FileOutputStream out = new FileOutputStream(attributeFile)) {
            marshaller.marshal(attributes, out);
          }
        }

        line = reader.readLine();
      }
View Full Code Here

Examples of org.springframework.oxm.Marshaller

    }


    @Test
    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);
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.