Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.Mapping.loadMapping()


    File f1 = new File(mappingfile);

    if (f1.exists()) {
      Mapping mapping = new Mapping();
      try {
  mapping.loadMapping(mappingfile);
  Writer writer = new FileWriter(filename);
  Marshaller marshaller = new Marshaller(writer);
  marshaller.setMapping(mapping);
  marshaller.marshal(this);
  writer.close();
View Full Code Here


    File f2 = new File(configDirectory+File.separatorChar+xmlconfig);

    if (f1.exists() && f2.exists()) {
      Mapping mapping = new Mapping();
      try {
  mapping.loadMapping(f1.getPath());
  Unmarshaller unmar = new Unmarshaller(mapping);
  unmar.setDebug(true);
  baseobj=(JoBoBase)unmar.unmarshal(new InputSource(f2.getPath()));
 
  log.info("configured from XML");
View Full Code Here

    try
    {
      mis = JRLoader.getLocationInputStream(MAPPING_FILE);

      Mapping mapping = new Mapping();
      mapping.loadMapping(
        new InputSource(mis)
        );
     
      Unmarshaller unmarshaller = new Unmarshaller(mapping);
      settings =
View Full Code Here

      mis = JRLoader.getLocationInputStream(MAPPING_FILE);

      Marshaller marshaller = new Marshaller(writer);

      Mapping mapping = new Mapping();
      mapping.loadMapping(
        new InputSource(mis)
        );
      marshaller.setMapping(mapping);

      marshaller.marshal(settings);
View Full Code Here

      XMLReader parser = factory.newSAXParser().getXMLReader();
      parser.setEntityResolver(xmlCatalog);

      Mapping mapping = new Mapping();
      mapping.loadMapping(new InputSource(ExtendedGrammar.class.getResource("mapping.xml")
                                                               .openStream()));

      Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
      unmarshaller.setMapping(mapping);
View Full Code Here

public class DiagramGenerator
{
  public static void main(String[] args) throws Exception
  {
    Mapping mapping = new Mapping();
    mapping.loadMapping(new InputSource(ExtendedGrammar.class.getResource("mapping.xml").openStream()));

    Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
    unmarshaller.setMapping(mapping);

    ExtendedGrammar grammar =
View Full Code Here

    NodeList list =
      step.getElementsByTagNameNS("http://chaperon.sourceforge.net/schema/grammar/2.0", "grammar");
    Node node = list.item(0);

    Mapping mapping = new Mapping();
    mapping.loadMapping(new InputSource(ExtendedGrammar.class.getResource("mapping.xml").openStream()));

    Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
    unmarshaller.setMapping(mapping);

    ExtendedGrammar grammar = (ExtendedGrammar)unmarshaller.unmarshal(node);
View Full Code Here

                mapping = (Mapping) mappings.get(source.getURI());
                if (mapping == null) {
                    // mapping not found in cache or the cache is new
                    mapping = new Mapping();
                    InputSource in = new InputSource(source.getInputStream());
                    mapping.loadMapping(in);
                    mappings.put (source.getURI(), mapping);
                }
            } finally {
                resolver.release(source);
            }
View Full Code Here

    }

    public void testUnmarshalWebXml() throws Exception {
        URL webXmlMapping = getClass().getResource("castor-web-xml-mapping.xml");
        Mapping mapping = new Mapping();
        mapping.loadMapping(webXmlMapping);
        InputStream webXml = getClass().getResourceAsStream("web.xml");
        Unmarshaller unmarshaller = new Unmarshaller(mapping);
        unmarshaller.setIgnoreExtraElements(false);
        unmarshaller.setDebug(debug);
        WebAppDD config = (WebAppDD)unmarshaller.unmarshal(new InputStreamReader(webXml));
View Full Code Here

    }

    public void testMarshalWebXml() throws Exception {
        URL webXmlMapping = getClass().getResource("castor-web-xml-mapping.xml");
        Mapping mapping = new Mapping();
        mapping.loadMapping(webXmlMapping);
        InputStream webXml = getClass().getResourceAsStream("web.xml");
        Unmarshaller unmarshaller = new Unmarshaller(mapping);
        WebAppDD config = (WebAppDD)unmarshaller.unmarshal(new InputStreamReader(webXml));

           OutputFormat of = new OutputFormat();
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.