Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.XMLContext


  public NamedQuery() throws Exception {
    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();
      unmarshaller.setClass(NamedQueries.class);
     
      namedQueries = (NamedQueries) unmarshaller.unmarshal(reader);
  }
View Full Code Here


    environment = paymentExpress.getEnvironment();
   
    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/paymentexpress/TxnRequestMapping.xml"));
    mapping.loadMapping(input);
    xmlContext = new XMLContext();
    xmlContext.addMapping(mapping);
   
    input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/paymentexpress/TxnResultMapping.xml"));
    mapping.loadMapping(input);
    xmlContext = new XMLContext();
    xmlContext.addMapping(mapping);   
  }
View Full Code Here

  public PersistenceLoader() throws Exception {
    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/psigate/OrderMapping.xml"));
    mapping.loadMapping(input);
    xmlContext = new XMLContext();
    xmlContext.addMapping(mapping);
   
    input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/psigate/ResultMapping.xml"));
    mapping.loadMapping(input);
    xmlContext = new XMLContext();
    xmlContext.addMapping(mapping);   
  }
View Full Code Here

  public ItemSimpleXmlTransformation() throws MappingException {
    Mapping mapping = new Mapping();
    InputSource input = new InputSource(getClass().getResourceAsStream("/com/jada/xml/ie/ItemSimpleMapping.xml"));
    mapping.loadMapping(input);
   
    xmlContext = new XMLContext();
    xmlContext.addMapping(mapping);   
  }
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);
      result = writer.toString();
     
      return result;
View Full Code Here

  public DatabaseUpgradeQuery() throws Exception {
    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();
      unmarshaller.setClass(DatabaseUpgradeQueries.class);
     
      databaseUpgradeQueries = (DatabaseUpgradeQueries) unmarshaller.unmarshal(reader);
  }
View Full Code Here

        }

        MappingTool tool;

        try {
            XMLContext xmlContext = new XMLContext();
            tool = xmlContext.createMappingTool();
            tool.addClass(classname);

            Writer writer = null;

            if ((mappingName == null) || (mappingName.length() == 0)) {
View Full Code Here

        // options needed
        // 1. filename/path of CHANGELOG
        // 2. mapping file for customization
        // 3. output file name
       
        XMLContext xmlContext = new XMLContext();
        ChangeLog2XML parser = xmlContext.createChangeLog2XML();
       
        try {
            File file = new File(DEFAULT_FILE);
          Changelog changelog = parser.parse(file);
           
            file = new File(DEFAULT_OUTPUT);
            FileWriter writer = new FileWriter(file);

            xmlContext.setProperty(XMLProperties.USE_INDENTATION, true);
            Marshaller marshaller = xmlContext.createMarshaller();
            marshaller.setWriter(writer);
           
            marshaller.setRootElement("changelog");
            marshaller.setSuppressXSIType(true);
            marshaller.marshal(changelog);
View Full Code Here

     * Test marshalling of simple bean with proxy.
     *
     * @throws Exception For any exception thrown.
     */
    public void testMarshalSimpleBeanProxy() throws Exception {
        XMLContext xmlContext = new XMLContext();
        xmlContext.setProperty(XMLProperties.PROXY_INTERFACES, "net.sf.cglib.proxy.Factory");
       
        Mapping mapping = xmlContext.createMapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(out);
        marshaller.setMapping(mapping);
       
// Joachim 2007-09-04 before XMLContext was introduced it looked like:
//        Configuration config = LocalConfiguration.getInstance();
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.XMLContext

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.