Examples of IBindingFactory


Examples of org.jibx.runtime.IBindingFactory

public class ParserTest {

  @Test
  public void testRead() throws JiBXException {
    IBindingFactory bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
    IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
    Object object = uctx.unmarshalDocument(getClass().getResourceAsStream("samples/example-sld.xml"), null);
    StyledLayerDescriptorInfo sld = (StyledLayerDescriptorInfo) object;
    for (ChoiceInfo choice : sld.getChoiceList()) {
      if (choice.ifNamedLayer()) {
        NamedLayerInfo layer = choice.getNamedLayer();
        Assert.assertEquals("OCEANSEA_1M:Foundation", layer.getName());
      }
    }
    IMarshallingContext ctx = bfact.createMarshallingContext();
    StringWriter sw = new StringWriter();
    ctx.setOutput(sw);
    ctx.marshalDocument(sld);
  }
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.