Fix javadoc in org.eclipse.jgit fnmatch package
Change-Id: I14384c3bf3c41f8e1c62ec117837c2fc782a832f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
dc91f4ef2c
commit
6c83cc1660
|
@ -53,6 +53,13 @@ abstract class AbstractHead implements Head {
|
|||
|
||||
private final boolean star;
|
||||
|
||||
/**
|
||||
* Whether the char matches
|
||||
*
|
||||
* @param c
|
||||
* a char.
|
||||
* @return whether the char matches
|
||||
*/
|
||||
protected abstract boolean matches(char c);
|
||||
|
||||
AbstractHead(boolean star) {
|
||||
|
@ -60,9 +67,11 @@ abstract class AbstractHead implements Head {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set {@link org.eclipse.jgit.fnmatch.Head}s which will not be modified.
|
||||
*
|
||||
* @param newHeads
|
||||
* a list of {@link Head}s which will not be modified.
|
||||
* a list of {@link org.eclipse.jgit.fnmatch.Head}s which will
|
||||
* not be modified.
|
||||
*/
|
||||
public final void setNewHeads(List<Head> newHeads) {
|
||||
if (this.newHeads != null)
|
||||
|
@ -70,6 +79,7 @@ public final void setNewHeads(List<Head> newHeads) {
|
|||
this.newHeads = newHeads;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public List<Head> getNextHeads(char c) {
|
||||
if (matches(c))
|
||||
|
|
|
@ -47,16 +47,24 @@
|
|||
final class CharacterHead extends AbstractHead {
|
||||
private final char expectedCharacter;
|
||||
|
||||
/**
|
||||
* Constructor for CharacterHead
|
||||
*
|
||||
* @param expectedCharacter
|
||||
* expected {@code char}
|
||||
*/
|
||||
protected CharacterHead(final char expectedCharacter) {
|
||||
super(false);
|
||||
this.expectedCharacter = expectedCharacter;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected final boolean matches(final char c) {
|
||||
return c == expectedCharacter;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(expectedCharacter);
|
||||
|
|
|
@ -126,12 +126,14 @@ private FileNameMatcher(final List<Head> headsStartValue,
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor for FileNameMatcher
|
||||
*
|
||||
* @param patternString
|
||||
* must contain a pattern which fnmatch would accept.
|
||||
* @param invalidWildgetCharacter
|
||||
* if this parameter isn't null then this character will not
|
||||
* match at wildcards(* and ? are wildcards).
|
||||
* @throws InvalidPatternException
|
||||
* @throws org.eclipse.jgit.errors.InvalidPatternException
|
||||
* if the patternString contains a invalid fnmatch pattern.
|
||||
*/
|
||||
public FileNameMatcher(final String patternString,
|
||||
|
@ -141,11 +143,13 @@ public FileNameMatcher(final String patternString,
|
|||
}
|
||||
|
||||
/**
|
||||
* A Copy Constructor which creates a new {@link FileNameMatcher} with the
|
||||
* same state and reset point like <code>other</code>.
|
||||
* A Copy Constructor which creates a new
|
||||
* {@link org.eclipse.jgit.fnmatch.FileNameMatcher} with the same state and
|
||||
* reset point like <code>other</code>.
|
||||
*
|
||||
* @param other
|
||||
* another {@link FileNameMatcher} instance.
|
||||
* another {@link org.eclipse.jgit.fnmatch.FileNameMatcher}
|
||||
* instance.
|
||||
*/
|
||||
public FileNameMatcher(FileNameMatcher other) {
|
||||
this(other.headsStartValue, other.heads);
|
||||
|
@ -347,6 +351,7 @@ private static int indexOfUnescaped(final String searchString,
|
|||
}
|
||||
|
||||
/**
|
||||
* Append to the string which is matched against the patterns of this class
|
||||
*
|
||||
* @param stringToMatch
|
||||
* extends the string which is matched against the patterns of
|
||||
|
@ -369,10 +374,13 @@ public void reset() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which
|
||||
* uses the same pattern like this matcher, but has the current state of
|
||||
* this matcher as reset and start point
|
||||
*
|
||||
* @return a {@link FileNameMatcher} instance which uses the same pattern
|
||||
* like this matcher, but has the current state of this matcher as
|
||||
* reset and start point.
|
||||
* @return a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which
|
||||
* uses the same pattern like this matcher, but has the current
|
||||
* state of this matcher as reset and start point.
|
||||
*/
|
||||
public FileNameMatcher createMatcherForSuffix() {
|
||||
final List<Head> copyOfHeads = new ArrayList<>(heads.size());
|
||||
|
@ -381,8 +389,9 @@ public FileNameMatcher createMatcherForSuffix() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Whether the matcher matches
|
||||
*
|
||||
* @return true, if the string currently being matched does match.
|
||||
* @return whether the matcher matches
|
||||
*/
|
||||
public boolean isMatch() {
|
||||
if (heads.isEmpty())
|
||||
|
@ -400,9 +409,9 @@ public boolean isMatch() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Whether a match can be appended
|
||||
*
|
||||
* @return false, if the string being matched will not match when the string
|
||||
* gets extended.
|
||||
* @return a boolean.
|
||||
*/
|
||||
public boolean canAppendMatch() {
|
||||
for (int i = 0; i < heads.size(); i++) {
|
||||
|
|
|
@ -130,6 +130,7 @@ final class GroupHead extends AbstractHead {
|
|||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected final boolean matches(final char c) {
|
||||
for (CharacterPattern pattern : characterClasses) {
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
interface Head {
|
||||
/**
|
||||
* Get the character which decides which heads are returned
|
||||
*
|
||||
* @param c
|
||||
* the character which decides which heads are returned.
|
||||
|
|
|
@ -56,6 +56,7 @@ private LastHead() {
|
|||
// defined because of javadoc and visibility modifier.
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public List<Head> getNextHeads(char c) {
|
||||
return FileNameMatcher.EMPTY_HEAD_LIST;
|
||||
|
|
|
@ -52,11 +52,13 @@ final class RestrictedWildCardHead extends AbstractHead {
|
|||
this.excludedCharacter = excludedCharacter;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected final boolean matches(final char c) {
|
||||
return c != excludedCharacter;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public String toString() {
|
||||
return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
|
|
@ -49,6 +49,7 @@ final class WildCardHead extends AbstractHead {
|
|||
super(star);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected final boolean matches(final char c) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue