Examples of MappingLoader


Examples of org.exolab.castor.mapping.MappingLoader

        if (_loader == null) {
            _loader = mapping.getClassLoader();
        }
       
        MappingUnmarshaller mum = new MappingUnmarshaller();
        MappingLoader resolver = mum.getMappingLoader(mapping, BindingType.XML);
        _internalContext.getXMLClassDescriptorResolver().setMappingLoader(resolver);
    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

    public final void testGetXMLMappingLoader() throws Exception {
        Configuration config = new CoreConfiguration();
        MappingLoaderRegistry registry = new MappingLoaderRegistry(config);
        assertNotNull(registry);

        MappingLoader mappingLoader = registry.getMappingLoader(
                "CastorXmlMapping", BindingType.XML);
        assertNotNull(mappingLoader);
        assertEquals(mappingLoader.getClass().getName(),
                "org.exolab.castor.xml.XMLMappingLoader");
    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

     * {@inheritDoc}
     */
    protected Map internalResolve(final String className, final ClassLoader classLoader,
            final Map properties) throws ResolverException {
       
        MappingLoader mappingLoader = (MappingLoader)properties.get(ResolverStrategy.PROPERTY_MAPPING_LOADER);
        HashMap results = new HashMap();
        if (mappingLoader == null) {
            LOG.debug("No mapping loader specified");
            return results;
        }
       
        XMLClassDescriptor descriptor = (XMLClassDescriptor) mappingLoader.getDescriptor(className);
        if (descriptor != null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Found descriptor: " + descriptor);
            }
            results.put(className, descriptor);
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

        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();
                while (descriptors.hasNext()) {
                    XMLClassDescriptor descriptor = (XMLClassDescriptor) descriptors.next();
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Found descriptor: " + descriptor);
                    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

        Iterator iter = _mappingLoaderFactories.iterator();
        while (iter.hasNext()) {
            MappingLoaderFactory loaderFactory = (MappingLoaderFactory) iter.next();
            if (loaderFactory.getSourceType().equals(sourceType)
                    && (loaderFactory.getBindingType() == bindingType)) {
                MappingLoader mappingLoader = loaderFactory.getMappingLoader();
                _mappingLoaders.add(mappingLoader);
                return mappingLoader;
            }
        }
       
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

    /**
     * @inheritDoc
     * @see org.castor.mapping.MappingLoaderFactory#getMappingLoader()
     */
    public final MappingLoader getMappingLoader() throws MappingException {
        MappingLoader mappingLoader = null;
        try {
            ClassLoader loader = getClass().getClassLoader();
            Class cls = loader.loadClass(getClassname());
            Class[] types = new Class[] {ClassLoader.class};
            Object[] args = new Object[] {loader};
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

    /**
     * @see org.castor.xml.InternalContext#addMapping(org.exolab.castor.mapping.Mapping)
     */
    public void addMapping(final Mapping mapping) throws MappingException {
         MappingUnmarshaller mappingUnmarshaller = new MappingUnmarshaller();
         MappingLoader mappingLoader =
             mappingUnmarshaller.getMappingLoader(mapping, BindingType.XML);
         _xmlClassDescriptorResolver.setMappingLoader(mappingLoader);       
    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

        MappingUnmarshaller mappingUnmarshaller = new MappingUnmarshaller();
        if (_classDescriptorResolver == null) {
            _classDescriptorResolver = (JDOClassDescriptorResolver)
            ClassDescriptorResolverFactory.createClassDescriptorResolver(BindingType.JDO);
        }
        MappingLoader mappingLoader =
            mappingUnmarshaller.getMappingLoader(_mapping, BindingType.JDO, factory);
        _classDescriptorResolver.setMappingLoader(mappingLoader);
        _engine = new PersistenceEngineFactory().createEngine(
                this, _classDescriptorResolver, factory);
    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

    public final void testGetXMLMappingLoader() throws Exception {
        AbstractProperties properties = new CoreProperties();
        MappingLoaderRegistry registry = new MappingLoaderRegistry(properties);
        assertNotNull(registry);

        MappingLoader mappingLoader = registry.getMappingLoader(
                "CastorXmlMapping", BindingType.XML);
        assertNotNull(mappingLoader);
        assertEquals(mappingLoader.getClass().getName(),
                "org.exolab.castor.xml.XMLMappingLoader");
    }
View Full Code Here

Examples of org.exolab.castor.mapping.MappingLoader

     * descriptors will be derived.
     * @throws MappingException If the {@link Mapping} cannot be loaded and analyzed successfully.
     */
    public void addMapping(final Mapping mapping) throws MappingException {
         MappingUnmarshaller mappingUnmarshaller = new MappingUnmarshaller();
         MappingLoader mappingLoader =
             mappingUnmarshaller.getMappingLoader(mapping, BindingType.XML);
         _internalContext.getXMLClassDescriptorResolver()
             .setMappingLoader(mappingLoader);       
    }
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.