Package org.exolab.castor.mapping.xml

Examples of org.exolab.castor.mapping.xml.FieldHandlerDef


     */
    protected void createFieldHandlers(final MappingRoot mapping)
    throws MappingException {
        Enumeration enumeration = mapping.enumerateFieldHandlerDef();
        while (enumeration.hasMoreElements()) {
            FieldHandlerDef def = (FieldHandlerDef) enumeration.nextElement();
           
            String name = def.getName();
           
            if (_fieldHandlers.containsKey(name)) {
                throw new MappingException(Messages.format("mapping.dupFieldHandler", name));
            }
           
           
            Class clazz = resolveType(def.getClazz());
            FieldHandler fieldHandler = null;
            try {
                if (!FieldHandler.class.isAssignableFrom(clazz)) {
                    throw new MappingException(Messages.format("mapping.classNotFieldHandler",
                            name, def.getClazz()));
                }
                fieldHandler = (FieldHandler) clazz.newInstance();
                _fieldHandlers.put(name, fieldHandler);
            } catch (InstantiationException e) {
                throw new MappingException(e);
View Full Code Here

TOP

Related Classes of org.exolab.castor.mapping.xml.FieldHandlerDef

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.