Text API

Last modified by Admin on 2024/06/22 09:24

cogOffers text-related APIs
Developed by

XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard


XWiki 4.0M2+

Installable with the Extension Manager



  • XWikiToStringBuilder: Make it easy to generate a toString() implementation using Commons Lang ToStringBuilder customized to fit XWiki's coding style. For example:
    public String toString()
        ToStringBuilder builder = new XWikiToStringBuilder(this);
        builder.append("implementation", getImplementation() == null ? null : getImplementation().getName());
        builder.append("instantiation", getInstantiationStrategy());
       return builder.toString();
  • [since 6.2] org.xwiki.text.StringUtils: extends org.apache.commons.lang3.StringUtils with new useful methods. In 6.2 it comes with:
         * An attempt to make doubling a character (usually for escaping purposes) as fast as it can be.
         * @param str the string to modify
         * @param c the character to double
         * @return the modified string

       public static String doubleChar(final String str, final char c)

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


Dependencies for this extension (org.xwiki.commons:xwiki-commons-text 16.4.0):

  • org.apache.commons:commons-lang3 3.14.0
  • org.xwiki.commons:xwiki-commons-stability 16.4.0

Get Connected