Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.XMLContext.addMapping()


    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/query/NamedQueriesMapping.xml"));
    mapping.loadMapping(input);
   
    XMLContext context = new XMLContext();
    context.addMapping(mapping);
   
    InputStream stream = getClass().getResourceAsStream("/com/jada/xml/query/Query.xml");
      BufferedReader reader = new BufferedReader(new InputStreamReader(stream));

      Unmarshaller unmarshaller = context.createUnmarshaller();
View Full Code Here


    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/persistence/PersistenceMapping.xml"));
    mapping.loadMapping(input);
   
    XMLContext context = new XMLContext();
    context.addMapping(mapping);
   
    InputStream stream = getClass().getResourceAsStream("/META-INF/persistence.xml");
      BufferedReader reader = new BufferedReader(new InputStreamReader(stream));

      Unmarshaller unmarshaller = new Unmarshaller(Persistence.class);
View Full Code Here

    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/sitemap/UrlSetMapping.xml"));
    mapping.loadMapping(input);
   
    XMLContext context = new XMLContext();
    context.addMapping(mapping);
   
    StringWriter writer = new StringWriter();
      Marshaller marshaller = context.createMarshaller();
      marshaller.setWriter(writer);
      marshaller.marshal(urlSet);
View Full Code Here

    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/databaseUpgrade/DatabaseUpgradeQueriesMapping.xml"));
    mapping.loadMapping(input);
   
    XMLContext context = new XMLContext();
    context.addMapping(mapping);
   
    InputStream stream = getClass().getResourceAsStream("/com/jada/xml/databaseUpgrade/DatabaseUpgradeQuery.xml");
      BufferedReader reader = new BufferedReader(new InputStreamReader(stream));

      Unmarshaller unmarshaller = context.createUnmarshaller();
View Full Code Here

            Assert.assertNotNull("InputStream of mapping must not be null", strmMapping);
            InputSource srcMapping = new InputSource(strmMapping);
            Assert.assertNotNull("InputSource of mapping must not be null", srcMapping);
            Mapping mapping = new Mapping();
            mapping.loadMapping(srcMapping);
            context.addMapping(mapping);
            Unmarshaller unmarshaller = context.createUnmarshaller();
            InputStream stream = this.getClass().getClassLoader().getResourceAsStream("withmapping-input.xml");
            Assert.assertNotNull("InputStream must not be null", stream);
            InputSource is = new InputSource(stream);
            Assert.assertNotNull("Inputstream must not be null", is);
View Full Code Here

    if (!ObjectUtils.isEmpty(mappingLocations)) {
      Mapping mapping = new Mapping();
      for (Resource mappingLocation : mappingLocations) {
        mapping.loadMapping(SaxResourceUtils.createInputSource(mappingLocation));
      }
      context.addMapping(mapping);
    }
    if (!ObjectUtils.isEmpty(targetClasses)) {
      context.addClasses(targetClasses);
    }
    if (!ObjectUtils.isEmpty(targetPackages)) {
View Full Code Here

                xmlMap = new Mapping(contextClassLoader);
            } else {
                xmlMap = new Mapping();
            }
            xmlMap.loadMapping(resolver.loadResourceAsURL(getMappingFile()));
            xmlContext.addMapping(xmlMap);
        }

        if (getPackages() != null) {
            xmlContext.addPackages(getPackages());
        }
View Full Code Here

    if (!ObjectUtils.isEmpty(mappingLocations)) {
      Mapping mapping = new Mapping();
      for (Resource mappingLocation : mappingLocations) {
        mapping.loadMapping(SaxResourceUtils.createInputSource(mappingLocation));
      }
      context.addMapping(mapping);
    }
    if (!ObjectUtils.isEmpty(targetClasses)) {
      context.addClasses(targetClasses);
    }
    if (!ObjectUtils.isEmpty(targetPackages)) {
View Full Code Here

      try {
          //Load Mapping
          Mapping mapping = new Mapping();
      mapping.loadMapping("mapping.xml");
      XMLContext context = new XMLContext();
        context.addMapping(mapping);
       
        //( 1 ) OBJECT --> XML

        //1.1 Prepare file writer
        Writer writer = new FileWriter("mapped_article.xml");
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.