public abstract class PatternMatchRevFilter extends RevFilter
ALL, MERGE_BASE, NO_MERGES, NONE
Modifier | Constructor and Description |
---|---|
protected |
PatternMatchRevFilter(String pattern,
boolean innerString,
boolean rawEncoding,
int flags)
Construct a new pattern matching filter.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
forceToRaw(String patternText)
Encode a string pattern for faster matching on byte arrays.
|
boolean |
include(RevWalk walker,
RevCommit cmit)
Determine if the supplied commit should be included in results.
|
String |
pattern()
Get the pattern this filter uses.
|
boolean |
requiresCommitBody() |
protected abstract CharSequence |
text(RevCommit cmit)
Obtain the raw text to match against.
|
String |
toString() |
protected PatternMatchRevFilter(String pattern, boolean innerString, boolean rawEncoding, int flags)
pattern
- text of the pattern. Callers may want to surround their
pattern with ".*" on either end to allow matching in the
middle of the string.innerString
- should .* be wrapped around the pattern of ^ and $ are
missing? Most users will want this set.rawEncoding
- should forceToRaw(String)
be applied to the pattern
before compiling it?flags
- flags from Pattern
to control how matching performs.protected static final String forceToRaw(String patternText)
Force the characters to our funny UTF-8 only convention that we use on raw buffers. This avoids needing to perform character set decodes on the individual commit buffers.
patternText
- original pattern string supplied by the user or the
application.RawCharSequence
.public String pattern()
public boolean include(RevWalk walker, RevCommit cmit) throws MissingObjectException, IncorrectObjectTypeException, IOException
RevFilter
include
in class RevFilter
walker
- the active walker this filter is being invoked from within.cmit
- the commit currently being tested. The commit has been parsed
and its body is available for inspection only if the filter
returns true from RevFilter.requiresCommitBody()
.MissingObjectException
- an object the filter needs to consult to determine its answer
does not exist in the Git repository the walker is operating
on. Filtering this commit is impossible without the object.IncorrectObjectTypeException
- an object the filter needed to consult was not of the
expected object type. This usually indicates a corrupt
repository, as an object link is referencing the wrong type.IOException
- a loose object or pack file could not be read to obtain data
necessary for the filter to make its decision.public boolean requiresCommitBody()
requiresCommitBody
in class RevFilter
protected abstract CharSequence text(RevCommit cmit)
cmit
- current commit being evaluated.Copyright © 2015 Eclipse JGit Project. All rights reserved.