Examples of loadMapping()


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

    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

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

      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

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

      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

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

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

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

    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

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

                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

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

    }

    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

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

    }

    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

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

     */
    protected Mapping getCastorMapping()
    throws IOException, MappingException {
        URL url = WebAppDD.class.getResource(WEB_XML_MAPPING);
        Mapping mapping = new Mapping();
        mapping.loadMapping(url);
        return mapping;
    }

}

View Full Code Here

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

    protected Mapping getCastorMapping()
    throws IOException, MappingException {
        URL url = PortletAppDD.class.getResource(PORTLET_XML_MAPPING);
        //dump(url);
        Mapping mapping = new Mapping();
        mapping.loadMapping(url);
        return mapping;
    }

    protected boolean getIgnoreExtraElements() {
        return true;
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.