net.sf.mmm.util.pattern.base
Class PathPatternCompiler

java.lang.Object
  extended by net.sf.mmm.util.pattern.base.AbstractGlobPatternCompiler
      extended by net.sf.mmm.util.pattern.base.PathPatternCompiler
All Implemented Interfaces:
PatternCompiler

public class PathPatternCompiler
extends AbstractGlobPatternCompiler

This is an implementation of the PatternCompiler interface that compiles path-glob-patterns. A path-glob-pattern is like a glob-pattern but more specific for matching directory paths:

The idea is taken from ant even though it might be slightly different.
Examples:

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
static PatternCompiler INSTANCE
          A singleton instance of this instance.
 
Constructor Summary
PathPatternCompiler()
          The constructor.
 
Method Summary
protected  int process(char[] chars, int charIndex, StringBuilder buffer)
          This method processes one or many characters from chars starting at the given charIndex and adds the translated regexp-sequence to buffer.
 
Methods inherited from class net.sf.mmm.util.pattern.base.AbstractGlobPatternCompiler
compile, convertPattern, isRequireWildcard
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final PatternCompiler INSTANCE
A singleton instance of this instance.

Constructor Detail

PathPatternCompiler

public PathPatternCompiler()
The constructor.

Method Detail

process

protected int process(char[] chars,
                      int charIndex,
                      StringBuilder buffer)
This method processes one or many characters from chars starting at the given charIndex and adds the translated regexp-sequence to buffer.

Overrides:
process in class AbstractGlobPatternCompiler
Parameters:
chars - are the characters of the original pattern string.
charIndex - is the current index in chars.
buffer - is where the translated regexp-pattern is appended to.
Returns:
the index of the next character that has NOT yet been consumed (typically charIndex + 1).


Copyright © 2001-2010 mmm-Team. All Rights Reserved.