Examples of unmarshalDocument()


Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  @Test
  public void testCrosses() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("samples/polygon_crosses.xml"), null);
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
    for (ChoiceInfo choice : sld.getChoiceList()) {
      if (choice.ifNamedLayer()) {
        NamedLayerInfo layer = choice.getNamedLayer();
        for (org.geomajas.sld.NamedLayerInfo.ChoiceInfo choice2 : layer.getChoiceList()) {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  public void testDtoToGeotools() throws JiBXException, IOException, SAXException, ParserConfigurationException,
      InterruptedException {
    // read dto
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) uctx.unmarshalDocument(getClass()
        .getResourceAsStream("samples/example-sld.xml"), null);

    // pipe to geotools parser
    StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);
    PipedOutputStream pos = new PipedOutputStream();
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  @Test
  public void testRead() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("samples/filter/property_is_equal.xml"), null);
    FilterTypeInfo filter = (FilterTypeInfo) object;
    Assert.assertTrue(filter.ifComparisonOps());
    Assert.assertTrue(filter.getComparisonOps() instanceof PropertyIsEqualToInfo);
    PropertyIsEqualToInfo p = (PropertyIsEqualToInfo) filter.getComparisonOps();
    Assert.assertEquals(2, p.getExpressionList().size());
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

  @Test
  public void testOverlap() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(RasterSymbolizerInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass()
        .getResourceAsStream("samples/symbolizer/rastersymbolizer.xml"), null);
    RasterSymbolizerInfo rasterSymbolizerInfo = (RasterSymbolizerInfo) object;
    Assert.assertEquals(OverlapBehaviorInfoInner.AVERAGE, rasterSymbolizerInfo.getOverlapBehavior()
        .getOverlapBehavior());
  }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

              }
            });
            for (File file : sldFiles) {
              IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
              IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
              Object object = uctx.unmarshalDocument(new FileReader(file));
              StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
              String fileName = StringUtils.stripFilenameExtension(file.getName());
              if (sld.getName() == null) {
                  sld.setName(fileName);
              }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

          Resource resource = applicationContext.getResource(namedStyle.getSldLocation());
          IBindingFactory bindingFactory;
          try {
            bindingFactory = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
            IUnmarshallingContext unmarshallingContext = bindingFactory.createUnmarshallingContext();
            StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) unmarshallingContext
                .unmarshalDocument(new InputStreamReader(resource.getInputStream()));
            namedStyle.setStyledLayerInfo(sld);
          } catch (JiBXException e) {
            throw new LayerException(e, ExceptionCode.INVALID_SLD, namedStyle.getSldLocation(),
                layer.getId());
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

   static public XMLObject getXMLObject(InputStream is) throws Exception
   {
      IBindingFactory bfact = getBindingFactoryInPriviledgedMode(XMLObject.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      XMLObject xmlobject = (XMLObject)uctx.unmarshalDocument(is, "UTF-8");
      return xmlobject;
   }

   static public Object getObject(InputStream is) throws Exception
   {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

      log.debug("About to parse configuration file " + document);

      //
      IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      return (Configuration)uctx.unmarshalDocument(new StringReader(document), null);
   }
}
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

               //
               IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
               IUnmarshallingContext uctx = bfact.createUnmarshallingContext();

               return (Configuration)uctx.unmarshalDocument(new StringReader(document), null);
            }
         });
      }
      catch (PrivilegedActionException pae)
      {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext.unmarshalDocument()

      log.debug("About to parse configuration file " + document);

      //
      IBindingFactory bfact = BindingDirectory.getFactory(Configuration.class);
      IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
      return (Configuration)uctx.unmarshalDocument(new StringReader(document), 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.