private void processClass()

in boolean/src/main/java/org/apache/cxf/xjc/bgi/BooleanGetAndIsPlugin.java [64:82]


    private void processClass(ClassOutline clazz) {
        Collection<JMethod> methods = clazz.implClass.methods();
        Map<String, JType> methodsToAdd = new HashMap<String, JType>();
        for (JMethod method : methods) {
            if (method.name().startsWith(IS_PREFIX) && requiresGetter(methods, method)) {
                methodsToAdd.put(method.name(), method.type());
            }
        }
        
        Iterator<Entry<String, JType>> todo = methodsToAdd.entrySet().iterator();
        while (todo.hasNext()) {
            Entry<String, JType> entry = todo.next();
            String newName = "get" + entry.getKey().substring(2);
            LOG.info("Adding method " + newName);
            JMethod newMethod = clazz.implClass.method(JMod.PUBLIC, entry.getValue(), newName);
            JBlock body = newMethod.body();
            body.directStatement("return " + entry.getKey() + "();");
        }
    }