Examples of loadMapping()


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

     *
     * @throws Exception For any exception thrown.
     */
    public void testUnmarshalReferingBean() throws Exception {
        Mapping mapping = new Mapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        Unmarshaller unmarshaller = new Unmarshaller(Bean.class);
        unmarshaller.setMapping(mapping);
       
        String input
View Full Code Here

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

     *
     * @throws Exception For any exception thrown.
     */
    public void testMarshalSimpleBean() throws Exception {
        Mapping mapping = new Mapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = new Marshaller(out);
        marshaller.setMapping(mapping);
       
View Full Code Here

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

     *
     * @throws Exception For any exception thrown.
     */
    public void testMarshalReferingBean() throws Exception {
        Mapping mapping = new Mapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = new Marshaller(out);
        marshaller.setMapping(mapping);
       
View Full Code Here

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

    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);
View Full Code Here

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

    public void testMarshalReferingBeanProxy() 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);
View Full Code Here

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

        TestHarness testApp;
        Mapping mapping;

        unm = new Unmarshaller(Harness.class);
        mapping = new Mapping();
        mapping.loadMapping(Main.class.getResource("harness/mapping.xml"));
        unm.setMapping(mapping);
        if (_testRes != null) {
            harness = (Harness) unm.unmarshal(new InputStreamReader(
                    Main.class.getResourceAsStream(_testRes)));
        } else if (_testFile != null) {
View Full Code Here

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

  }

  public static void main(String[] args) throws Exception
  {
    Mapping mapping = new Mapping(Item.class.getClassLoader());
    mapping.loadMapping("mapping.xml");

    Unmarshaller unmarshaller = new Unmarshaller(mapping);
    unmarshaller.setClassLoader(Item.class.getClassLoader());
    unmarshaller.setValidation(false);
    Item item = (Item) unmarshaller.unmarshal(new InputSource(new java.io.FileInputStream(args[0])));
View Full Code Here

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

     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testUnmarshalEntity() throws Exception {
        Mapping mapping = new Mapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        Unmarshaller unmarshaller = getXMLContext().createUnmarshaller();
        unmarshaller.setClass(Entity.class);
        unmarshaller.setMapping(mapping);
       
View Full Code Here

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

     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testMarshalEntity() throws Exception {
        Mapping mapping = new Mapping();
        mapping.loadMapping(getClass().getResource(MAPPING_FILE).toExternalForm());
       
        StringWriter out = new StringWriter();
        Marshaller marshaller = getXMLContext().createMarshaller();
        marshaller.setWriter(out);
        marshaller.setMapping(mapping);
View Full Code Here

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

        try {
            Generator ddlgen = GeneratorFactory.createDDLGenerator(
                    _databaseEngine, _globalProperties, _databaseEngineProperties);
           
            Mapping mapping = new Mapping();
            mapping.loadMapping(filePath);
            new MappingUnmarshaller().loadMappingOnly(mapping);
            // TODO: Joachim 2007-09-07 the InternalContext should be set into the unmarshaller!
           
            ddlgen.setMapping(mapping);
            ddlgen.generateDDL(_outputStream);
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.