Package org.jibx.util

Examples of org.jibx.util.IClassItem


    private Map mapFields(IClassItem[] fields, String[] prefs, String[] suffs, Set inclset, Set exclset) {
       
        // check all fields for use as members
        InsertionOrderedMap fieldmap = new InsertionOrderedMap();
        for (int i = 0; i < fields.length; i++) {
            IClassItem item = fields[i];
            if ((item.getAccessFlags() & (Modifier.FINAL | Modifier.STATIC | Modifier.TRANSIENT)) == 0) {
               
                // not final, static, or transient, so check if it should be used
                String name = item.getName();
                String memb = ValueCustom.memberNameFromField(name, prefs, suffs);
                boolean use = true;
                if (inclset != null) {
                    use = inclset.contains(memb.toLowerCase());
                } else if (exclset != null) {
View Full Code Here


                    nameset.addAll(setmap.keySet());
                }
            } else {
                for (Iterator iter = fieldmap.keySet().iterator(); iter.hasNext();) {
                    String name = (String)iter.next();
                    IClassItem field = (IClassItem)fieldmap.get(name);
                    int access = field.getAccessFlags();
                    if (!Modifier.isStatic(access) && !Modifier.isTransient(access)) {
                        nameset.add(name);
                    }
                }
            }
        }
       
        // process all members found in class
        m_memberMap = new InsertionOrderedMap();
        boolean auto = !getName().startsWith("java.") && !getName().startsWith("javax.");
        List names = nameset.asList();
        for (Iterator iter = names.iterator(); iter.hasNext();) {
           
            // get basic member information
            String name = (String)iter.next();
            String lcname = name.toLowerCase();
            ValueCustom cust = null;
            IClassItem gmeth = (IClassItem)(getmap == null ? null : getmap.get(name));
            IClassItem smeth = (IClassItem)(setmap == null ? null : setmap.get(name));
            IClassItem field = (IClassItem)(fieldmap == null ? null : fieldmap.get(name));
           
            // find the optional/required setting
            Boolean isreq = null;
            if (optset.contains(lcname)) {
                isreq = Boolean.FALSE;
View Full Code Here

     * @param info containing class information
     * @param req required member flag (<code>null</code> if unknown)
     * @param style representation style (<code>null</code> if unspecified)
     */
    /* package */void fillDetails(IClass info, Boolean req, Integer style) {
        IClassItem field = null;
        if (m_fieldName != null) {
            field = info.getField(m_fieldName);
            if (field == null) {
                throw new IllegalArgumentException("Field " + m_fieldName + " not found in class " + info.getName());
            }
        }
        IClassItem gmeth = null;
        if (m_getName != null) {
            gmeth = info.getBestMethod(m_getName, null, Utility.EMPTY_STRING_ARRAY);
            if (gmeth == null) {
                throw new IllegalArgumentException("get method " + m_getName + " not found in class " + info.getName());
            }
        }
        IClassItem smeth = null;
        if (m_setName != null) {
            smeth = info.getBestMethod(m_setName, "void", null);
            if (smeth == null) {
                throw new IllegalArgumentException("gset method " + m_setName + " not found in class " + info.getName());
            }
View Full Code Here

                    if (vctx.isOutBinding()) {
                       
                        // make sure types differ or test method supplied
                        IClass type = comp.getType();
                        if (type.isAssignable(prior.getType())) {
                            IClassItem test = null;
                            if (prior instanceof ValueElement) {
                                test = ((ValueElement)prior).getTest();
                            } else if (prior instanceof StructureElementBase) {
                                test = ((StructureElementBase)prior).getTest();
                            }
View Full Code Here

TOP

Related Classes of org.jibx.util.IClassItem

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.