| org.apache.commons.lang.text |
|
Provides classes for handling and manipulating text, partly as an extension to {@link java.text}.
The classes in this package are, for the most part, intended to be instantiated.
(ie. they are not utility classes with lots of static methods)
@since 2.1
|
| Java Source File Name | Type | Comment |
| CompositeFormat.java | Class | Formats using one formatter and parses using a different formatter. |
| CompositeFormatTest.java | Class | Unit tests for
org.apache.commons.lang.text.CompositeFormat . |
| ExtendedMessageFormat.java | Class | Extends java.text.MessageFormat to allow pluggable/additional formatting
options for embedded format elements. |
| ExtendedMessageFormatTest.java | Class | Test case for
ExtendedMessageFormat . |
| FormatFactory.java | Interface | Format factory. |
| StrBuilder.java | Class | Builds a string from constituent parts providing a more flexible and powerful API
than StringBuffer.
The main differences from StringBuffer/StringBuilder are:
- Not synchronized
- Not final
- Subclasses have direct access to character array
- Additional methods
- appendWithSeparators - adds an array of values, with a separator
- appendPadding - adds a length padding characters
- appendFixedLength - adds a fixed width field to the builder
- toCharArray/getChars - simpler ways to get a range of the character array
- delete - delete char or string
- replace - search and replace for a char or string
- leftString/rightString/midString - substring without exceptions
- contains - whether the builder contains a char or string
- size/clear/isEmpty - collections style API methods
Views
- asTokenizer - uses the internal buffer as the source of a StrTokenizer
- asReader - uses the internal buffer as the source of a Reader
- asWriter - allows a Writer to write directly to the internal buffer
The aim has been to provide an API that mimics very closely what StringBuffer
provides, but with additional methods. |
| StrBuilderAppendInsertTest.java | Class | Unit tests for
org.apache.commons.lang.text.StrBuilder . |
| StrBuilderTest.java | Class | Unit tests for
org.apache.commons.lang.text.StrBuilder . |
| StrLookup.java | Class | Lookup a String key to a String value. |
| StrLookupTest.java | Class | Test class for StrLookup. |
| StrMatcher.java | Class | A matcher class that can be queried to determine if a character array
portion matches. |
| StrMatcherTest.java | Class | Unit tests for
org.apache.commons.lang.text.StrMatcher . |
| StrSubstitutor.java | Class | Substitutes variables within a string by values.
This class takes a piece of text and substitutes all the variables within it.
The default definition of a variable is ${variableName}.
The prefix and suffix can be changed via constructors and set methods.
Variable values are typically resolved from a map, but could also be resolved
from system properties, or by supplying a custom variable resolver.
The simplest example is to use this class to replace Java System properties. |
| StrSubstitutorTest.java | Class | Test class for StrSubstitutor. |
| StrTokenizer.java | Class | Tokenizes a string based based on delimiters (separators)
and supporting quoting and ignored character concepts.
This class can split a String into many smaller strings. |
| StrTokenizerTest.java | Class | Unit test for Tokenizer. |
| TextTestSuite.java | Class | Test suite for the Text package. |