Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.oro.text.awk.* (17)org.apache.oro.text.perl.* (3)org.apache.oro.text.regex.* (18)

org.apache.oro.text: Javadoc index of package org.apache.oro.text.


Package Samples:

org.apache.oro.text.perl: This package used to be the TextTools library and provides general text processing support, including a glob regular expression class, pattern caching and line-by-line processing classes.  
org.apache.oro.text.regex
org.apache.oro.text.awk

Classes:

Perl5Util: This is a utility class implementing the 3 most common Perl5 operations involving regular expressions: [m]/pattern/[i][m][s][x], s/pattern/replacement/[g][i][m][o][s][x], and split(). As with Perl, any non-alphanumeric character can be used in lieu of the slashes. The objective of the class is to minimize the amount of code a Java programmer using Jakarta-ORO has to write to achieve the same results as Perl by transparently handling regular expression compilation, caching, and matching. A second objective is to use the same Perl pattern matching syntax to ease the task of Perl programmers transitioning ...
Perl5Substitution: Perl5Substitution implements a Substitution consisting of a literal string, but allowing Perl5 variable interpolation referencing saved groups in a match. This class is intended for use with Util.substitute 55 . The substitution string may contain variable interpolations referring to the saved parenthesized groups of the search pattern. A variable interpolation is denoted by $1 , or $2 , or $3 , etc. If you want such expressions to be interpreted literally, you should set the numInterpolations parameter to INTERPOLATE_NONE . It is easiest to explain what an interpolated variable does by giving ...
MatchActionProcessor: The MatchActionProcessor class provides AWK-like line by line filtering of a text stream, pattern action pair association, and field splitting based on a registered separator. However, the class can be used with any compatible PatternMatcher/PatternCompiler implementations and need not use the AWK matching classes in org.apache.oro.text.awk. In fact, the default matcher and compiler used by the class are Perl5Matcher and Perl5Compiler from org.apache.oro.text.regex. To completely understand how to use MatchActionProcessor, you should first look at MatchAction and MatchActionInfo . A MatchActionProcessor ...
AwkCompiler: The AwkCompiler class is used to create compiled regular expressions conforming to the Awk regular expression syntax. It generates AwkPattern instances upon compilation to be used in conjunction with an AwkMatcher instance. AwkMatcher finds true leftmost-longest matches, so you must take care with how you formulate your regular expression to avoid matching more than you really want. The supported regular expression syntax is a superset of traditional AWK, but NOT to be confused with GNU AWK or other AWK variants. Additionally, this AWK implementation is DFA-based and only supports 8-bit ASCII. ...
GlobCompiler: The GlobCompiler class will compile a glob expression into a Perl5Pattern that may be used to match patterns in conjunction with Perl5Matcher. Rather than create extra GlobMatcher and GlobPattern classes tailored to the task of matching glob expressions, we have simply reused the Perl5 regular expression classes from org.apache.oro.text.regex by making GlobCompiler translate a glob expression into a Perl5 expression that is compiled by a Perl5Compiler instance internal to the GlobCompiler. Because there are various similar glob expression syntaxes, GlobCompiler tries to provide a small amount of ...
MatchResult: The MatchResult interface allows PatternMatcher implementors to return results storing match information in whatever format they like, while presenting a consistent way of accessing that information. However, MatchResult implementations should strictly follow the behavior described for the interface methods. A MatchResult instance contains a pattern match and its saved groups. You can access the entire match directly using the group(int) 55 method with an argument of 0, or by the toString() 55 method which is defined to return the same thing. It is also possible to obtain the beginning and ending ...
PatternMatcherInput: The PatternMatcherInput class is used to preserve state across calls to the contains() methods of PatternMatcher instances. It is also used to specify that only a subregion of a string should be used as input when looking for a pattern match. All that is meant by preserving state is that the end offset of the last match is remembered, so that the next match is performed from that point where the last match left off. This offset can be accessed from the getCurrentOffset() 55 method and can be set with the setCurrentOffset(int) 55 method. You would use a PatternMatcherInput object when you want to ...
Util: The Util class is a holder for useful static utility methods that can be generically applied to Pattern and PatternMatcher instances. This class cannot and is not meant to be instantiated. The Util class currently contains versions of the split() and substitute() methods inspired by Perl's split function and s operation respectively, although they are implemented in such a way as not to rely on the Perl5 implementations of the OROMatcher packages regular expression interfaces. They may operate on any interface implementations conforming to the OROMatcher API specification for the PatternMatcher, ...
PatternCompiler: The PatternCompiler interface defines the operations a regular expression compiler must implement. However, the types of regular expressions recognized by a compiler and the Pattern implementations produced as a result of compilation are not restricted. A PatternCompiler instance is used to compile the string representation (either as a String or char[]) of a regular expression into a Pattern instance. The Pattern can then be used in conjunction with the appropriate PatternMatcher instance to perform pattern searches. A form of use might be: PatternCompiler compiler; PatternMatcher matcher; Pattern ...
AwkStreamInput: The AwkStreamInput class is used to look for pattern matches in an input stream (actually a java.io.Reader instance) in conjunction with the AwkMatcher class. It is called AwkStreamInput instead of AwkInputStream to stress that it is a form of streamed input for the AwkMatcher class to use rather than a subclass of InputStream. AwkStreamInput performs special internal buffering to accelerate pattern searches through a stream. You can determine the size of this buffer and how it grows by using the appropriate constructor. If you want to perform line by line matches on an input stream, you should ...
PatternMatcher: The PatternMatcher interface defines the operations a regular expression matcher must implement. However, the types of the Pattern implementations recognized by a matcher are not restricted. Typically PatternMatcher instances will only recognize a specific type of Pattern. For example, the Perl5Matcher only recognizes Perl5Pattern instances. However, none of the PatternMatcher methods are required to throw an exception in case of the use of an invalid pattern. This is done for efficiency reasons, although usually a CastClassException will be thrown by the Java runtime system if you use the wrong ...
Perl5Compiler: The Perl5Compiler class is used to create compiled regular expressions conforming to the Perl5 regular expression syntax. It generates Perl5Pattern instances upon compilation to be used in conjunction with a Perl5Matcher instance. Please see the user's guide for more information about Perl5 regular expressions. Perl5Compiler and Perl5Matcher are designed with the intent that you use a separate instance of each per thread to avoid the overhead of both synchronization and concurrent access (e.g., a match that takes a long time in one thread will block the progress of another thread with a shorter ...
Perl5Matcher: The Perl5Matcher class is used to match regular expressions (conforming to the Perl5 regular expression syntax) generated by Perl5Compiler. Perl5Compiler and Perl5Matcher are designed with the intent that you use a separate instance of each per thread to avoid the overhead of both synchronization and concurrent access (e.g., a match that takes a long time in one thread will block the progress of another thread with a shorter match). If you want to use a single instance of each in a concurrent program, you must appropriately protect access to the instances with critical sections. If you want to ...
Substitution: The Substitution interface provides a means for you to control how a substitution is performed when using the Util.substitute 55 method. Two standard implementations are provided, StringSubstitution and Perl5Substitution . To achieve custom control over the behavior of substitutions, you can create your own implementations. A common use for customization is to make a substitution a function of a match.
MalformedCachePatternException: An exception used to indicate errors in a regular expression fetched from a PatternCache. It is derived from RuntimeException, and therefore does not have to be caught. You should generally make an effort to catch MalformedCachePatternException whenever you use dynamically generated patterns (from user input or some other source). Static expressions represented as strings in your source code don't require exception handling because as you write and test run your program you will correct any errors in those expressions when you run into an uncaught MalformedCachePatternException. By the time you ...
MalformedPerl5PatternException: An exception used to indicate errors in Perl style regular expressions. It is derived from RuntimeException, and therefore does not have to be caught. You should generally make an effort to catch MalformedPerl5PatternException whenever you use dynamically generated patterns (from user input or some other source). Static expressions represented as strings in your source code don't require exception handling because as you write and test run your program you will correct any errors in those expressions when you run into an uncaught MalformedPerl5PatternException. By the time you complete your project, ...
PatternCacheFIFO2: This class is a GenericPatternCache subclass implementing a second chance FIFO (First In First Out) cache replacement policy. In other words, patterns are added to the cache until the cache becomes full. Once the cache is full, when a new pattern is added to the cache, it replaces the first of the current patterns in the cache to have been added, unless that pattern has been used recently (generally between the last cache replacement and now). If the pattern to be replaced has been used, it is given a second chance, and the next pattern in the cache is tested for replacement in the same manner. ...
Pattern: The Pattern interface allows multiple representations of a regular expression to be defined. In general, different regular expression compilers will produce different types of pattern representations. Some will produce state transition tables derived from syntax trees, others will produce byte code representations of an NFA, etc. The Pattern interface does not impose any specific internal pattern representation, and consequently, Pattern implementations are not meant to be interchangeable among differing PatternCompiler and PatternMatcher implementations. The documentation accompanying a specific ...
Perl5Pattern: An implementation of the Pattern interface for Perl5 regular expressions. This class is compatible with the Perl5Compiler and Perl5Matcher classes. When a Perl5Compiler instance compiles a regular expression pattern, it produces a Perl5Pattern instance containing internal data structures used by Perl5Matcher to perform pattern matches. This class cannot be subclassed and cannot be directly instantiated by the programmer as it would not make sense. Perl5Pattern instances should only be created through calls to a Perl5Compiler instance's compile() methods. The class implements the Serializable interface ...
AwkPattern: An implementation of the Pattern interface for Awk regular expressions. This class is compatible with the AwkCompiler and AwkMatcher classes. When an AwkCompiler instance compiles a regular expression pattern, it produces an AwkPattern instance containing internal data structures used by AwkMatcher to perform pattern matches. This class cannot be subclassed and cannot be directly instantiated by the programmer as it would not make sense. It is however serializable so that pre-compiled patterns may be saved to disk and re-read at a later time. AwkPattern instances should only be created through ...
AwkMatcher: The AwkMatcher class is used to match regular expressions (conforming to the Awk regular expression syntax) generated by AwkCompiler. AwkMatcher only supports 8-bit ASCII. Any attempt to match Unicode values greater than 255 will result in undefined behavior. AwkMatcher finds true leftmost-longest matches, so you must take care with how you formulate your regular expression to avoid matching more than you really want. It is important for you to remember that AwkMatcher does not save parenthesized sub-group information. Therefore the number of groups saved in a MatchResult produced by AwkMatcher ...
Perl5Debug: The Perl5Debug class is not intended for general use and should not be instantiated, but is provided because some users may find the output of its single method to be useful. The Perl5Compiler class generates a representation of a regular expression identical to that of Perl5 in the abstract, but not in terms of actual data structures. The Perl5Debug class allows the bytecode program contained by a Perl5Pattern to be printed out for comparison with the program generated by Perl5 with the -r option.
MalformedPatternException: A class used to signify the occurrence of a syntax error in a regular expression that is being compiled. The class is not declared final so that it may be subclassed for identifying more specific pattern comilation errors. However, at this point in time, this package does not subclass MalformedPatternException for any purpose. This does not preclude users and third party implementors of the interfaces of this package from subclassing it for their own purposes.
GenericPatternCache: This is the base class for all cache implementations provided in the org.apache.oro.text package. Although 4 subclasses of GenericPatternCache are provided with this package, users may not derive subclasses from this class. Rather, users should create their own implmentations of the PatternCache interface.
PatternCacheLRU: This class is a GenericPatternCache subclass implementing an LRU (Least Recently Used) cache replacement policy. In other words, patterns are added to the cache until it becomes full. Once the cache is full, when a new pattern is added to the cache, it replaces the least recently used pattern currently in the cache. This is probably the best general purpose pattern cache replacement policy.

Home | Contact Us | Privacy Policy | Terms of Service