Package org.jibx.binding.def

Examples of org.jibx.binding.def.BindingDefinition


        if (split > 0) {
            sname = sname.substring(0, split);
        }
        sname = BindingDirectory.convertName(sname);
       
        BindingDefinition def = Utility.loadBinding(fname, sname, is, null, false);
        def.generateCode(false);
        return def;
    }
View Full Code Here


        if (!m_isBound) {
           
            // handle code generation from bindings
            int count = m_bindings.size();
            for (int i = 0; i < count; i++) {
                BindingDefinition binding =
                    (BindingDefinition)m_bindings.get(i);
                binding.generateCode(false, false);
            }
           
            // finish binding factories with information on classes used
            ClassFile[][] lists = MungedClass.fixDispositions();
            for (int i = 0; i < count; i++) {
                BindingDefinition binding =
                    (BindingDefinition)m_bindings.get(i);
                binding.addClassList(lists[0], lists[1]);
            }
           
            // build hashmap of modified classes
            count = lists[0].length;
            for (int i = 0; i < count; i++) {
View Full Code Here

                        bname = sname;
                    }
                    BoundClass.setModify(cf.getRoot(), tpack, bname);
                   
                }
                BindingDefinition bdef =
                    BindingBuilder.unmarshalBindingDefinition(uctx, sname, url);
               
                // set package and class if not validated
                if (!test) {
                   
                    // a kludge, but needed to support skipping validation
                    ArrayList maps = bdef.getDefinitionContext().getMappings();
                    if (maps != null) {
                       
                        // set up package information from mapped class
                        for (int i = 0; i < maps.size(); i++) {
                            Object child = maps.get(i);
                            if (child instanceof MappingBase) {
                               
                                // end scan if a real mapping is found
                                MappingBase mapbase = (MappingBase)child;
                                cf = mapbase.getBoundClass().getMungedFile();
                                if (mapbase.getBoundClass().isDirectAccess()) {
                                    break;
                                }
                               
                            }
                        }
                    }
                }
               
                // set up binding root based on first mapping
                File root = null;
                if (tpack == null) {
                    tpack = bdef.getDefaultPackage();
                }
                if (cf == null) {
                    root = ClassCache.getModifiablePath();
                    if (root == null) {
                        throw new IllegalStateException("Need modifiable directory on classpath for storing generated factory class file");
                    }
                    if (tpack == null) {
                        tpack = "";
                    }
                } else {
                    root = cf.getRoot();
                    if (tpack == null) {
                        tpack = cf.getPackage();
                    }
                }
                bdef.setFactoryLocation(tpack, root);
                return bdef;
               
            } catch (JiBXException e) {
                throw new JiBXException
                    ("\n*** Error during code generation for file '" + fname +
View Full Code Here

TOP

Related Classes of org.jibx.binding.def.BindingDefinition

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.