Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.Mapping


    /**
     * Will throw exception when setting mapping in unmarshaller
     */        
    public void testTextContentNotWorking() throws Exception {
         // das Mapping laden
        mapping = new Mapping(getClass().getClassLoader());
        mapping.loadMapping(new InputSource(getClass().getResourceAsStream(MAPPING_FILE)));

        // den Marshaller erzeugen
        marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(writer);
View Full Code Here


    /**
     * Everything works
     */        
    public void testTextContentWorking() throws Exception {
        // das Mapping laden
        mapping = new Mapping(getClass().getClassLoader());
        mapping.loadMapping(getClass().getResource(MAPPING_FILE));

        // den Marshaller erzeugen
        marshaller = xmlContext.createMarshaller();
        marshaller.setWriter(writer);
View Full Code Here

        log("Processing " + filePath);
        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

    private synchronized void loadTypesDefinitions() {
        if ( (_typesByName == null) && (_typesByCode == null) ) {
            InputStream is = null;

          try //Load the mapping file
            Mapping mapping= new Mapping(getClass().getClassLoader());

            is = this.getClass().getResourceAsStream(TYPE_MAPPINGS);
        mapping.loadMapping( new InputSource(is) );

                //unmarshall the list of built in simple types
            Unmarshaller unmarshaller= new Unmarshaller(TypeList.class);
            unmarshaller.setMapping(mapping);
            //-- turn off validation
View Full Code Here

    throws MappingException {
        URL url = classLoader.getResource(ResolveHelpers.getQualifiedFileName(
                XMLConstants.PKG_MAPPING_FILE, packageName));
        if (url == null) { return null; }
        try {
            Mapping mapping = new Mapping(classLoader);
            mapping.loadMapping(url);
            return mapping;
        } catch (java.io.IOException ioex) {
            throw new MappingException(ioex);
        }
    }
View Full Code Here

            return results;
        }
       
        if (!isEmptyPackageName(packageName)) _loadedPackages.add(packageName);
        try {
            final Mapping mapping = this.loadMapping(packageName, classLoader);
            if (mapping != null) {
                MappingUnmarshaller unmarshaller = new MappingUnmarshaller();
                // TODO: Joachim 2007-09-07 the InternalContext should be set into the unmarshaller!
                MappingLoader mappingLoader = unmarshaller.getMappingLoader(mapping, BindingType.XML);
                Iterator descriptors = mappingLoader.descriptorIterator();
View Full Code Here

        if (mappingFile == null) {
            throw new FileNotFoundException("Unable to locate the mapping file '"
                     + mappingFilePath + "' for the test '" + _test.getName() + "'");
        }

        _mapping = new Mapping(loader);
        InputSource source = new InputSource(mappingFile);
        source.setSystemId(mappingFilePath);
        _mapping.loadMapping(source);

        ListenerType listener = _unitTest.getListener();
View Full Code Here

        // Create generator and generate ddl.
        try {
            Generator generator = GeneratorFactory.createDDLGenerator(
                    engine, globalConfig, specificConfig);

            Mapping mapping = new Mapping();
            mapping.loadMapping(mappingName);
            new MappingUnmarshaller().loadMappingOnly(mapping);
            // TODO: Joachim 2007-09-07 the InternalContext should be set into the unmarshaller!
           
            generator.setMapping(mapping);
            generator.generateDDL(new FileOutputStream(ddlName));           
View Full Code Here

       
        JdoConf jdoConf = getJdoConf(DBNAME, MAPPING);
        if (jdoConf.getDatabase(0).getDatabaseChoice().getDriver() != null) {
            factory = new DriverConnectionFactory(jdoConf, 0, null);
        } else if (jdoConf.getDatabase(0).getDatabaseChoice().getDataSource() != null) {
            factory = new DataSourceConnectionFactory(jdoConf, 0, new Mapping());
        } else if (jdoConf.getDatabase(0).getDatabaseChoice().getDriver() != null) {
            factory = new JNDIConnectionFactory(jdoConf, 0, null);
        }
       
        factory.initializeFactory();
View Full Code Here

        AbstractConnectionFactory factory;
        for (int i = 0; i < databases.length; i++) {
            // Load the mapping file from the URL specified in the database
            // configuration file, relative to the configuration file.
            // Fail if cannot load the mapping for whatever reason.
            Mapping mapping = new Mapping(loader);
            if (resolver != null) { mapping.setEntityResolver(resolver); }
            if (baseURI != null) { mapping.setBaseURL(baseURI); }
           
            factory = DatabaseRegistry.createFactory(jdoConf, i, mapping);
            factory.setClassDescriptorResolver(classDescriptorResolver);
            if (init) { factory.initialize(); }
            String name = databases[i].getName();
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.Mapping

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.