Text API

Last modified by Admin on 2017/10/05 15:25

cogOffers text-related APIs
TypeJAR
Developed by

XWiki Development Team

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager

Compatibility

XWiki 4.0M2+

Installable with the Extension Manager

Description

Features

  • XWikiToStringBuilder: Make it easy to generate a toString() implementation using Commons Lang ToStringBuilder customized to fit XWiki's coding style. For example:
    @Override
    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). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

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

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

  • org.apache.commons:commons-lang3 3.6
Tags:
Created by Vincent Massol on 2012/04/05 09:46
    

Get Connected