Package org.jibx.util

Examples of org.jibx.util.IClassItem


            opmap.put(op.getMethodName().toLowerCase(), op);
            s_logger.debug("Added operation " + op.getOperationName());
        }
        IClassItem[] methods = m_classInformation.getMethods();
        for (int i = 0; i < methods.length; i++) {
            IClassItem method = methods[i];
            String name = method.getName();
            String lcname = name.toLowerCase();
            int access = method.getAccessFlags();
            OperationCustom op = (OperationCustom)opmap.get(lcname);
            if (op == null) {
                if (!Modifier.isStatic(access) && !Modifier.isTransient(access) && !"<init>".equals(name)) {
                    boolean use = true;
                    if (inclset != null) {
View Full Code Here


                            "factory method for unmodifiable class " +
                            type.getName());
                    } else {
                        IClass suptype = type;
                        while ((suptype = suptype.getSuperClass()) != null) {
                            IClassItem cons = suptype.getInitializerMethod("()V");
                            if ((cons == null || !type.isAccessible(cons)) &&
                                !suptype.isModifiable()) {
                                vctx.addError("Need accessible no-argument constructor for unmodifiable class " +
                                    suptype.getName() + " (superclass of " + type.getName() + ')');
                            }
View Full Code Here

        }
        IClass clas = icl.getRequiredClassInfo(m_exceptionType);
        if (m_fieldName == null) {
            IClassItem[] fields = clas.getFields();
            for (int i = 0; i < fields.length; i++) {
                IClassItem item = fields[i];
                String type = item.getTypeName();
                if (!Types.isSimpleValue(type)) {
                    IClass info = icl.getRequiredClassInfo(type);
                    if (info.isModifiable()) {
                        m_fieldName = item.getName();
                        m_dataType = type;
                        break;
                    }
                }
            }
            if (m_fieldName == null) {
                throw new IllegalStateException("No data object field found for exception class " + m_exceptionType);
            }
        } else {
            IClassItem field = clas.getField(m_fieldName);
            if (field == null) {
                throw new IllegalStateException("Field " + m_fieldName + " not found in exception class "
                    + m_exceptionType);
            } else {
                m_dataType = field.getTypeName();
            }
        }
    }
View Full Code Here

                            } else {
                                break;
                            }
                        }
                        if (m_serializerItem == null) {
                            IClassItem item = m_typeClass.getMethod("toString",
                                "()Ljava/lang/String;");
                            if (item == null) {
                                vctx.addError("toString method not found");
                            }
                        }
View Full Code Here

    IClass iclas = vctx.getClassInfo(cname);
        if (iclas != null) {
           
            // find the method in class or superclass
            for (int i = 0; i < sigs.length; i++) {
                IClassItem method = iclas.getMethod(mname, sigs[i]);
                if (method != null) {
                    return method;
                }
            }
        }
View Full Code Here

        IClass iclas = vctx.getClassInfo(cname);
            if (iclas != null) {
               
                // find the method in class or superclass
                for (int i = 0; i < sigs.length; i++) {
                    IClassItem method = iclas.getStaticMethod(mname, sigs[i]);
                    if (method != null) {
                        return method;
                    }
                }
            }
View Full Code Here

     *
     * @param struct
     * @param elem
     */
    private void addItemDocumentation(StructureElementBase struct, AnnotatedBase elem) {
        IClassItem item = struct.getField();
        if (item == null) {
            item = struct.getGet();
            if (item == null) {
                item = struct.getSet();
            }
View Full Code Here

     *
     * @param value
     * @param elem
     */
    private void addItemDocumentation(ValueElement value, AnnotatedBase elem) {
        IClassItem item = value.getField();
        if (item == null) {
            item = value.getGet();
            if (item == null) {
                item = value.getSet();
            }
View Full Code Here

    private Map mapPropertyReadMethods(IClassItem[] methods, Set inclset, Set exclset) {
       
        // check all methods for property read access matches
        InsertionOrderedMap getmap = new InsertionOrderedMap();
        for (int i = 0; i < methods.length; i++) {
            IClassItem item = methods[i];
            String name = item.getName();
            int flags = item.getAccessFlags();
            if (item.getArgumentCount() == 0 && (flags & Modifier.STATIC) == 0 && (flags & Modifier.PUBLIC) != 0 &&
                ((name.startsWith("get") && !item.getTypeName().equals("void")) || (name.startsWith("is") &&
                item.getTypeName().equals("boolean")))) {
               
                // have what appears to be a getter, check if it should be used
                String memb = ValueCustom.memberNameFromGetMethod(name);
                boolean use = true;
                if (inclset != null) {
View Full Code Here

    private Map mapPropertyWriteMethods(IClassItem[] methods, Set inclset, Set exclset) {
       
        // check all methods for property write access matches
        InsertionOrderedMap setmap = new InsertionOrderedMap();
        for (int i = 0; i < methods.length; i++) {
            IClassItem item = methods[i];
            String name = item.getName();
            int flags = item.getAccessFlags();
            if (item.getArgumentCount() == 1 && (flags & Modifier.STATIC) == 0 && (flags & Modifier.PUBLIC) != 0 &&
                name.startsWith("set") && item.getTypeName().equals("void")) {
               
                // have what appears to be a setter, check if it should be used
                String memb = ValueCustom.memberNameFromSetMethod(name);
                boolean use = true;
                if (inclset != null) {
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.