Package org.jibx.custom.classes

Examples of org.jibx.custom.classes.ClassCustom


        // check for existing detail
        BindingMappingDetail detail = (BindingMappingDetail)m_mappingDetailsMap.get(type);
        if (detail == null) {
           
            // provide warning when interface used with field access
            ClassCustom cust = m_global.getClassCustomization(type);
            IClass sclas = cust.getClassInformation();
            if (sclas.isInterface() && !cust.isPropertyAccess()) {
                System.out.println("Warning: generating mapping for interface " + type +
                    " without checking properties - consider setting property-access='true'");
            }
           
            // check if a superclass is base for extension
            String stype = null;
            Boolean isabs = null;
            while ((sclas = sclas.getSuperClass()) != null) {
                if (m_directSet.contains(sclas.getName())) {
                    stype = sclas.getName();
                    isabs = Boolean.valueOf(sclas.isAbstract());
                    break;
                }
            }
            // TODO: really should check for multiple superclasses/interfaces to
            // be handled (and generate a warning, since they can't be handled)
            if (stype == null) {
               
                // check if an interface is base for extension
                sclas = cust.getClassInformation();
                loop: while (sclas != null) {
                    String[] intfs = sclas.getInterfaces();
                    for (int i = 0; i < intfs.length; i++) {
                        String itype = intfs[i];
                        while (true) {
                            if (m_directSet.contains(itype)) {
                                stype = itype;
                                isabs = Boolean.TRUE;
                                break loop;
                            } else {
                                ClassCustom icust = m_global.getClassCustomization(itype);
                                if (icust == null) {
                                    break;
                                } else {
                                   
                                    // check for interface (should only ever be one) of interface
                                    String[] sintfs = icust.getClassInformation().getInterfaces();
                                    if (sintfs.length > 0) {
                                        itype = sintfs[0];
                                    } else {
                                        break;
                                    }
View Full Code Here


    private void generateFormats() {
       
        // add any required format definitions
        for (Iterator iter = m_formatSet.iterator(); iter.hasNext();) {
            String type = (String)iter.next();
            ClassCustom clas = m_global.getClassCustomization(type);
            if (clas.getSerializer() != null || clas.getDeserializer() != null) {
                FormatElement format = new FormatElement();
                format.setDeserializerName(clas.getDeserializer());
                format.setSerializerName(clas.getSerializer());
                format.setTypeName(type);
                m_directory.addFormat(format);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jibx.custom.classes.ClassCustom

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.