public String toString()

in log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/generator/MethodDefinition.java [243:310]


    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("    /**\n");
        if (getJavadocComments() != null) {
            sb.append("     * ").append(getJavadocComments());
        }

        if (getParameters() != null) {
            for (Parameter param : getParameters()) {
                sb.append("\n     * @param ").append(param.getName())
                        .append(" ").append(param.getDescription());
            }
        }

        sb.append("\n     */\n");
        sb.append("    ");
        if (getAnnotation() != null) {
            sb.append(getAnnotation());
            sb.append("\n    ");
        }

        if (getVisability() != null) {
            sb.append(getVisability()).append(" ");
        }
        if (isFinal() && !isInterface()) {
            sb.append("final ");
        }
        if (isStatic() && !isInterface()) {
            sb.append("static ");
        }
        if (isAbstract() && !isInterface()) {
            sb.append("abstract ");
        }
        sb.append(returnType).append(" ");
        sb.append(getName()).append("(");
        if (getParameters() != null) {
            boolean first = true;
            for (Parameter element : getParameters()) {
                if (!first) {
                    sb.append(", ");
                }
                sb.append(element);
                first = false;
            }
        }
        sb.append(")");
        if (getExceptions() != null && getExceptions().size() > 0) {
            sb.append(" throws ");
            boolean first = true;
            for (String element : getExceptions()) {
                if (!first) {
                    sb.append(", ");
                }
                sb.append(element);
                first = false;
            }
        }

        if (isAbstract() || isInterface()) {
            sb.append(";");
            return sb.toString();
        }
        sb.append(" {\n");
        sb.append(getContent());
        sb.append("\n}");
        return sb.toString();
    }