Examples of createMarshallingContext()


Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      Object obj =
         uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/navigation.xml"), null);
      assertEquals(PageNavigation.class, obj.getClass());

      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/navigation.xml"));

      obj = uctx.unmarshalDocument(new FileInputStream("target/navigation.xml"), null);
      assertEquals(PageNavigation.class, obj.getClass());
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

      Object obj =
         uctx.unmarshalDocument(
            new FileInputStream("src/test/resources/portal/portal/classic/portlet-preferences.xml"), null);
      assertEquals(PortletPreferencesSet.class, obj.getClass());

      IMarshallingContext mctx = bfact.createMarshallingContext();
      mctx.setIndent(2);
      mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/portlet-preferences.xml"));
      assertEquals(PortletPreferencesSet.class, obj.getClass());
   }
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

        if (enc == null) {
            enc = "UTF-8";
        }
       
        // marshal root object back out to document in memory
        IMarshallingContext mctx = bfact.createMarshallingContext();
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            XMLOutputFactory ofact = XMLOutputFactory.newInstance();
            XMLStreamWriter wrtr = ofact.createXMLStreamWriter(bos, enc);
            mctx.setXmlWriter(new StAXWriter(bfact.getNamespaces(), wrtr));
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

                    customs, beans, enums, ignores);
               
                // marshal binding out to file
                IBindingFactory bfact =
                    BindingDirectory.getFactory("normal", BindingElement.class);
                IMarshallingContext mctx = bfact.createMarshallingContext();
                mctx.setIndent(2);
                mctx.marshalDocument(binding, "UTF-8", null,
                    new FileOutputStream(fname));
               
            } catch (JiBXException ex) {
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

     */
    public WsdlWriter() throws JiBXException {
       
        // set the marshalling contexts
        IBindingFactory ifact = BindingDirectory.getFactory(Definitions.class);
        m_marshalContext = (MarshallingContext)ifact.createMarshallingContext();
       
        // initialize namespace URI to index map
        String[] nss = ifact.getNamespaces();
        s_namespaceMap = new StringIntSizedMap(nss.length);
        for (int i = 0; i < nss.length; i++) {
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

        /** Marshalling context for schema. */
        private final MarshallingContext m_schemaContext;
       
        public SchemaMarshaller() throws JiBXException {
            IBindingFactory ifact = BindingDirectory.getFactory(SchemaUtils.XS_PREFIX_BINDING, SchemaElement.class);
            m_schemaContext = (MarshallingContext)ifact.createMarshallingContext();
        }
       
        public boolean isExtension(String mapname) {
            return false;
        }
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

                    if (enc == null) {
                        enc = "UTF-8";
                    }
                   
                    // marshal root object back out to document in memory
                    IMarshallingContext mctx = factory.createMarshallingContext();
                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
                    mctx.setIndent(2);
                    mctx.marshalDocument(obj, "UTF-8", null, bos);
                   
                    // compare with original input document
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

            SchemaElement schema = (SchemaElement)iter.next();
            File file = new File(destdir, schema.getResolver().getName());
            OutputStream stream = new FileOutputStream(file);
            Writer writer = new OutputStreamWriter(stream, "utf-8");
            IBindingFactory factory = BindingDirectory.getFactory(SchemaUtils.XS_PREFIX_BINDING, SchemaElement.class);
            IMarshallingContext ictx = factory.createMarshallingContext();
            ictx.setOutput(writer);
            ictx.setIndent(2);
            ictx.marshalDocument(schema);
            writer.close();
        }
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

                    if (enc == null) {
                        enc = "UTF-8";
                    }
                   
                    // marshal root object back out to document in memory
                    IMarshallingContext mctx = factory.createMarshallingContext();
                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
                    mctx.setIndent(2);
                    mctx.marshalDocument(schema, "UTF-8", null, bos);
                   
                    // compare with original input document
View Full Code Here

Examples of org.jibx.runtime.IBindingFactory.createMarshallingContext()

     * @throws JiBXException
     * @throws IOException
     */
    public void writeBindings(File dir) throws JiBXException, IOException {
        IBindingFactory fact = BindingDirectory.getFactory("normal", BindingElement.class);
        IMarshallingContext ictx = fact.createMarshallingContext();
        ictx.setIndent(2);
        List keys = getKeys();
        for (Iterator iter = keys.iterator(); iter.hasNext();) {
            BindingHolder holder = (BindingHolder)m_objectBindings.get(iter.next());
            if (holder != null) {
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.