Package org.apache.uima.resource.metadata.impl

Examples of org.apache.uima.resource.metadata.impl.MetaDataObject_impl


      Document orangeXmlDoc = docBuilder.parse(new ByteArrayInputStream(orangeXml.getBytes()));
      Document fruitBagXmlDoc = docBuilder.parse(new ByteArrayInputStream(fruitBagXml.getBytes()));

      // construct new objects from the XML
      XMLParser xmlp = UIMAFramework.getXMLParser();
      MetaDataObject_impl newApple1 = (MetaDataObject_impl) unknownFruit.clone();
      newApple1.buildFromXMLElement(apple1xmlDoc.getDocumentElement(), xmlp);
      MetaDataObject_impl newApple2 = (MetaDataObject_impl) unknownFruit.clone();
      newApple2.buildFromXMLElement(apple2xmlDoc.getDocumentElement(), xmlp);
      MetaDataObject_impl newOrange = (MetaDataObject_impl) unknownFruit.clone();
      newOrange.buildFromXMLElement(orangeXmlDoc.getDocumentElement(), xmlp);

      xmlp.addMapping("fruit", TestFruitObject.class.getName());

      MetaDataObject_impl newFruitBag = new TestFruitBagObject();
      newFruitBag.buildFromXMLElement(fruitBagXmlDoc.getDocumentElement(), xmlp);

      // new objects should be equal to the originals
      Assert.assertEquals(apple1, newApple1);
      Assert.assertEquals(apple2, newApple2);
      Assert.assertEquals(orange, newOrange);
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.impl.MetaDataObject_impl

Copyright © 2018 www.massapicom. 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.