Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package bpiwowar.argparser.handlers;
 
 
Pattern handler - basically the same as String handler, but compiles the regular expression
public class PatternHandler extends GenericObjectsHandler {
	public PatternHandler(Object objectField field) {
		super(objectfield);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see yrla.argparser.holders.Holder#scan(yrla.argparser.StringScanner)
	 */
	public Object process(ArgParser argParserStringScanner scanner)
		final String s = scanner.getString();
		addValue(Pattern.compile(s));
		return s;
	}
New to GrepCode? Check out our FAQ X