linter/src/main/java/org/apache/royale/linter/internal/config/FileConfigurator.java [492:607]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static String formatBuffer1(ConfigurationBuffer cfgbuf,
                                         FormatNode node,
                                         String indent,
                                         LocalizationManager lmgr,
                                         String prefix)
    {
        StringBuilder buf = new StringBuilder(1024);

        buf.append(indent + "<" + node.shortname + ">\n");
        if (node.children != null)
        {
            for (final String key : node.children.keySet())
            {
                final FormatNode child = node.children.get(key);

                if (child.children != null) // its a config
                {
                    buf.append(formatBuffer1(cfgbuf, child, indent + pad, lmgr, prefix));
                }
                else
                {
                    String description = lmgr.getLocalizedTextString(prefix + "." + child.fullname);

                    if (description != null)
                        buf.append(indent + pad + "<!-- " + child.fullname + ": " + description + "-->\n");

                    if ((child.values == null) || !child.info.isDisplayed())
                    {
                        boolean newline = false;
                        buf.append(indent + pad + "<!-- " + child.fullname + " usage:\n");
                        buf.append(indent + pad + "<" + child.shortname + ">");

                        int i = 0;
                        while (true)
                        {
                            if (child.info.getArgCount() == 1)
                            {
                                buf.append(child.info.getArgName(i));
                                break;
                            }
                            else
                            {
                                buf.append("\n" + indent + pad + pad + "<" + child.info.getArgName(i) + ">" + classToArgName(child.info.getArgType(i)) + "</" + child.info.getArgName(i) + ">");
                                newline = true;
                            }
                            if (child.info.getArgCount() == -1)
                            {
                                if (i > 0)
                                {
                                    // stop iterating thru arguments when an arg name
                                    // matches a previously used arg name.
                                    boolean found = false; // true if found argName in the arg list
                                    String argName = child.info.getArgName(i + 1);
                                    for (int j = i; j >= 0; j--)
                                    {
                                        if (child.info.getArgName(j).equals(argName))
                                        {
                                            found = true;
                                            break;
                                        }
                                    }
                                    if (found)
                                    {
                                        break;
                                    }
                                }
                            }
                            else if (i >= child.info.getArgCount())
                            {
                                break;
                            }
                            ++i;
                        }
                        if (newline)
                            buf.append("\n" + indent + pad);

                        buf.append("</" + child.shortname + ">\n");
                        buf.append(indent + pad + "-->\n");
                    }
                    else
                    {
                        // var may be set multiple times...
                        boolean newline = false;
                        for (final ConfigurationValue cv : child.values)
                        {
                            buf.append(indent + pad + "<" + child.shortname + ">");

                            int argCount = child.info.getArgCount();
                            // var may have multiple values...
                            int argc = 0;
                            for (final String arg : cv.getArgs())
                            {
                                if (argCount == 1)
                                {
                                    buf.append(arg);
                                    break;
                                }
                                else
                                {
                                    String argname = child.info.getArgName(argc++);
                                    newline = true;
                                    buf.append("\n" + indent + pad + pad + "<" + argname + ">" + arg + "</" + argname + ">");
                                }
                            }
                            if (newline)
                                buf.append("\n" + indent + pad);
                            buf.append("</" + child.shortname + ">\n");
                        }
                    }
                }
            }
        }
        buf.append(indent + "</" + node.shortname + ">\n");

        return buf.toString();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



compiler-common/src/main/java/org/apache/royale/compiler/internal/config/FileConfigurator.java [492:607]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static String formatBuffer1(ConfigurationBuffer cfgbuf,
                                         FormatNode node,
                                         String indent,
                                         LocalizationManager lmgr,
                                         String prefix)
    {
        StringBuilder buf = new StringBuilder(1024);

        buf.append(indent + "<" + node.shortname + ">\n");
        if (node.children != null)
        {
            for (final String key : node.children.keySet())
            {
                final FormatNode child = node.children.get(key);

                if (child.children != null) // its a config
                {
                    buf.append(formatBuffer1(cfgbuf, child, indent + pad, lmgr, prefix));
                }
                else
                {
                    String description = lmgr.getLocalizedTextString(prefix + "." + child.fullname);

                    if (description != null)
                        buf.append(indent + pad + "<!-- " + child.fullname + ": " + description + "-->\n");

                    if ((child.values == null) || !child.info.isDisplayed())
                    {
                        boolean newline = false;
                        buf.append(indent + pad + "<!-- " + child.fullname + " usage:\n");
                        buf.append(indent + pad + "<" + child.shortname + ">");

                        int i = 0;
                        while (true)
                        {
                            if (child.info.getArgCount() == 1)
                            {
                                buf.append(child.info.getArgName(i));
                                break;
                            }
                            else
                            {
                                buf.append("\n" + indent + pad + pad + "<" + child.info.getArgName(i) + ">" + classToArgName(child.info.getArgType(i)) + "</" + child.info.getArgName(i) + ">");
                                newline = true;
                            }
                            if (child.info.getArgCount() == -1)
                            {
                                if (i > 0)
                                {
                                    // stop iterating thru arguments when an arg name
                                    // matches a previously used arg name.
                                    boolean found = false; // true if found argName in the arg list
                                    String argName = child.info.getArgName(i + 1);
                                    for (int j = i; j >= 0; j--)
                                    {
                                        if (child.info.getArgName(j).equals(argName))
                                        {
                                            found = true;
                                            break;
                                        }
                                    }
                                    if (found)
                                    {
                                        break;
                                    }
                                }
                            }
                            else if (i >= child.info.getArgCount())
                            {
                                break;
                            }
                            ++i;
                        }
                        if (newline)
                            buf.append("\n" + indent + pad);

                        buf.append("</" + child.shortname + ">\n");
                        buf.append(indent + pad + "-->\n");
                    }
                    else
                    {
                        // var may be set multiple times...
                        boolean newline = false;
                        for (final ConfigurationValue cv : child.values)
                        {
                            buf.append(indent + pad + "<" + child.shortname + ">");

                            int argCount = child.info.getArgCount();
                            // var may have multiple values...
                            int argc = 0;
                            for (final String arg : cv.getArgs())
                            {
                                if (argCount == 1)
                                {
                                    buf.append(arg);
                                    break;
                                }
                                else
                                {
                                    String argname = child.info.getArgName(argc++);
                                    newline = true;
                                    buf.append("\n" + indent + pad + pad + "<" + argname + ">" + arg + "</" + argname + ">");
                                }
                            }
                            if (newline)
                                buf.append("\n" + indent + pad);
                            buf.append("</" + child.shortname + ">\n");
                        }
                    }
                }
            }
        }
        buf.append(indent + "</" + node.shortname + ">\n");

        return buf.toString();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



formatter/src/main/java/org/apache/royale/formatter/internal/config/FileConfigurator.java [491:606]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static String formatBuffer1(ConfigurationBuffer cfgbuf,
                                         FormatNode node,
                                         String indent,
                                         LocalizationManager lmgr,
                                         String prefix)
    {
        StringBuilder buf = new StringBuilder(1024);

        buf.append(indent + "<" + node.shortname + ">\n");
        if (node.children != null)
        {
            for (final String key : node.children.keySet())
            {
                final FormatNode child = node.children.get(key);

                if (child.children != null) // its a config
                {
                    buf.append(formatBuffer1(cfgbuf, child, indent + pad, lmgr, prefix));
                }
                else
                {
                    String description = lmgr.getLocalizedTextString(prefix + "." + child.fullname);

                    if (description != null)
                        buf.append(indent + pad + "<!-- " + child.fullname + ": " + description + "-->\n");

                    if ((child.values == null) || !child.info.isDisplayed())
                    {
                        boolean newline = false;
                        buf.append(indent + pad + "<!-- " + child.fullname + " usage:\n");
                        buf.append(indent + pad + "<" + child.shortname + ">");

                        int i = 0;
                        while (true)
                        {
                            if (child.info.getArgCount() == 1)
                            {
                                buf.append(child.info.getArgName(i));
                                break;
                            }
                            else
                            {
                                buf.append("\n" + indent + pad + pad + "<" + child.info.getArgName(i) + ">" + classToArgName(child.info.getArgType(i)) + "</" + child.info.getArgName(i) + ">");
                                newline = true;
                            }
                            if (child.info.getArgCount() == -1)
                            {
                                if (i > 0)
                                {
                                    // stop iterating thru arguments when an arg name
                                    // matches a previously used arg name.
                                    boolean found = false; // true if found argName in the arg list
                                    String argName = child.info.getArgName(i + 1);
                                    for (int j = i; j >= 0; j--)
                                    {
                                        if (child.info.getArgName(j).equals(argName))
                                        {
                                            found = true;
                                            break;
                                        }
                                    }
                                    if (found)
                                    {
                                        break;
                                    }
                                }
                            }
                            else if (i >= child.info.getArgCount())
                            {
                                break;
                            }
                            ++i;
                        }
                        if (newline)
                            buf.append("\n" + indent + pad);

                        buf.append("</" + child.shortname + ">\n");
                        buf.append(indent + pad + "-->\n");
                    }
                    else
                    {
                        // var may be set multiple times...
                        boolean newline = false;
                        for (final ConfigurationValue cv : child.values)
                        {
                            buf.append(indent + pad + "<" + child.shortname + ">");

                            int argCount = child.info.getArgCount();
                            // var may have multiple values...
                            int argc = 0;
                            for (final String arg : cv.getArgs())
                            {
                                if (argCount == 1)
                                {
                                    buf.append(arg);
                                    break;
                                }
                                else
                                {
                                    String argname = child.info.getArgName(argc++);
                                    newline = true;
                                    buf.append("\n" + indent + pad + pad + "<" + argname + ">" + arg + "</" + argname + ">");
                                }
                            }
                            if (newline)
                                buf.append("\n" + indent + pad);
                            buf.append("</" + child.shortname + ">\n");
                        }
                    }
                }
            }
        }
        buf.append(indent + "</" + node.shortname + ">\n");

        return buf.toString();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



