Package org.jibx.runtime.impl

Examples of org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement()


      String out = IOUtil.getStreamContentAsString(confManager_.getInputStream(path));
      ByteArrayInputStream is = new ByteArrayInputStream(out.getBytes("UTF-8"));
      IBindingFactory bfact = BindingDirectory.getFactory(Container.class);
      UnmarshallingContext uctx = (UnmarshallingContext)bfact.createUnmarshallingContext();
      uctx.setDocument(is, null, "UTF-8", false);
      Container container = (Container)uctx.unmarshalElement();
      generateStorageName(container);
      return container;
   }

   public void save() throws Exception
View Full Code Here


         {
            PortletBuilder builder = new PortletBuilder();
            ctx.parsePastStartTag(m_uri, "preferences");
            while (ctx.isAt(m_uri, "preference"))
            {
               Preference value = (Preference)ctx.unmarshalElement();
               builder.add(value.getName(), value.getValues(), value.isReadOnly());
            }
            ctx.parsePastEndTag(m_uri, "preferences");
            state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, builder.build());
         }
View Full Code Here

      //
      Properties properties = null;
      if (ctx.isAt(m_uri, "properties"))
      {
         properties = (Properties)ctx.unmarshalElement();
      }

      //
      ctx.parsePastEndTag(m_uri, m_name);
View Full Code Here

      //
      ctx.parsePastStartTag(m_uri, m_name);
      while (ctx.isAt(m_uri, "preference"))
      {
         Preference value = (Preference)ctx.unmarshalElement();
         builder.add(value.getName(), value.getValues(), value.isReadOnly());
      }
      ctx.parsePastEndTag(m_uri, m_name);

      //
View Full Code Here

   {
      ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8"));
      IBindingFactory bfact = BindingDirectory.getFactory(clazz);
      UnmarshallingContext uctx = (UnmarshallingContext)bfact.createUnmarshallingContext();
      uctx.setDocument(is, null, "UTF-8", false);
      T o = clazz.cast(uctx.unmarshalElement());
      if (o instanceof PageNavigation)
      {
         PageNavigation nav = (PageNavigation)o;
         nav.setOwnerType(ownerType);
         nav.setOwnerId(owner);
View Full Code Here

        //
        IBindingFactory bfact = BindingDirectory.getFactory(type);
        UnmarshallingContext uctx = (UnmarshallingContext) bfact.createUnmarshallingContext();
        uctx.setDocument(baos, null, "UTF-8", false);
        T obj = type.cast(uctx.unmarshalElement());

        // Find out version
        XMLInputFactory factory = XMLInputFactory.newInstance();
        baos.reset();
        XMLStreamReader reader = factory.createXMLStreamReader(baos);
View Full Code Here

            if (ctx.isAt(m_uri, "preferences")) {
                PortletBuilder builder = new PortletBuilder();
                ctx.parsePastStartTag(m_uri, "preferences");
                while (ctx.isAt(m_uri, "preference")) {
                    Preference value = (Preference) ctx.unmarshalElement();
                    builder.add(value.getName(), value.getValues(), value.isReadOnly());
                }
                ctx.parsePastEndTag(m_uri, "preferences");
                state = new TransientApplicationState(contentId, builder.build());
            } else {
View Full Code Here

        String height = nextOptionalTag(ctx, "height");

        //
        Properties properties = null;
        if (ctx.isAt(m_uri, "properties")) {
            properties = (Properties) ctx.unmarshalElement();
        }

        //
        ctx.parsePastEndTag(m_uri, m_name);
View Full Code Here

        String out = IOUtil.getStreamContentAsString(confManager_.getInputStream(path));
        ByteArrayInputStream is = new ByteArrayInputStream(out.getBytes("UTF-8"));
        IBindingFactory bfact = BindingDirectory.getFactory(Container.class);
        UnmarshallingContext uctx = (UnmarshallingContext) bfact.createUnmarshallingContext();
        uctx.setDocument(is, null, "UTF-8", false);
        Container container = (Container) uctx.unmarshalElement();
        generateStorageName(container);
        return container;
    }

    public void save() throws Exception {
View Full Code Here

                    return JibxSimpleTypes.toObject(text, stype);
                } else {
                    throw new RuntimeException("Missing required element [" + ctype + "]");
                }
            } else {
                return ctx.unmarshalElement(part.getTypeClass());  
            }
        } catch (JiBXException e) {
            throw new RuntimeException(e);
        }
    }
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.