Package br.msf.commons.lang

Examples of br.msf.commons.lang.EnhancedStringBuilder.replace()


        final Collection<MatchEntry> newLines = builder.findPattern("\n");
        for (MatchEntry match : newLines) {
            if (match.getStart() > 0 && isPeriodFinalization(builder.charAt(match.getStart() - 1))
                && '\n' != builder.charAt(match.getStart() + 1)) {
                /* new lines not after a punctuation are removed */
                builder.replace(match, " ");
            }
        }
        builder.replacePattern(" +", " ");
        final Collection<String> lines = builder.split("\n");
        builder.clear().appendln(commentStart);
View Full Code Here


        if (CollectionUtils.isNotEmpty(currentLicense)) {
            MatchEntry me = currentLicense.iterator().next();
            switch (params.getUpdateMode()) {
                case ALL_FILES:
                    /* source already have a license header. lets replace it */
                    builder.replace(me, getJavaLicense());
                    break;
                case WITHOUT_LICENSE_FILES:
                    /* we consider the default netbeans template as "file without license" */
                    if (builder.substring(me.getStart(), me.getEnd()).contains(NB_LICENSE_TEMPLATE)) {
                        builder.replace(me, getJavaLicense());
View Full Code Here

                    builder.replace(me, getJavaLicense());
                    break;
                case WITHOUT_LICENSE_FILES:
                    /* we consider the default netbeans template as "file without license" */
                    if (builder.substring(me.getStart(), me.getEnd()).contains(NB_LICENSE_TEMPLATE)) {
                        builder.replace(me, getJavaLicense());
                    } else {
                        /* returning null sinalize that this FileObject will not be updated */
                        return null;
                    }
                    break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.