Browse Source

Fix javadoc in org.eclipse.jgit ignore package

Change-Id: I1a81d371420cd4cf90ab9e048026c0ab8a763018
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
107c71a6e6
  1. 16
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java
  2. 15
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
  3. 3
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java
  4. 7
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java
  5. 1
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java
  6. 2
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java
  7. 7
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java
  8. 14
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java
  9. 1
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java
  10. 3
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java
  11. 2
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java

16
org.eclipse.jgit/src/org/eclipse/jgit/ignore/FastIgnoreRule.java

@ -77,6 +77,7 @@ public class FastIgnoreRule {
private final boolean dirOnly; private final boolean dirOnly;
/** /**
* Constructor for FastIgnoreRule
* *
* @param pattern * @param pattern
* ignore pattern as described in <a href= * ignore pattern as described in <a href=
@ -160,15 +161,18 @@ public class FastIgnoreRule {
} }
/** /**
* @return True if the pattern is just a file name and not a path * Whether the pattern is just a file name and not a path
*
* @return {@code true} if the pattern is just a file name and not a path
*/ */
public boolean getNameOnly() { public boolean getNameOnly() {
return !(matcher instanceof PathMatcher); return !(matcher instanceof PathMatcher);
} }
/** /**
* Whether the pattern should match directories only
* *
* @return True if the pattern should match directories only * @return {@code true} if the pattern should match directories only
*/ */
public boolean dirOnly() { public boolean dirOnly() {
return dirOnly; return dirOnly;
@ -193,13 +197,17 @@ public class FastIgnoreRule {
} }
/** /**
* @return true if the rule never matches (comment line or broken pattern) * Whether the rule never matches
*
* @return {@code true} if the rule never matches (comment line or broken
* pattern)
* @since 4.1 * @since 4.1
*/ */
public boolean isEmpty() { public boolean isEmpty() {
return matcher == NO_MATCH; return matcher == NO_MATCH;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -212,6 +220,7 @@ public class FastIgnoreRule {
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
@ -222,6 +231,7 @@ public class FastIgnoreRule {
return result; return result;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)

15
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java

@ -81,7 +81,9 @@ public class IgnoreNode {
/** The rules that have been parsed into this node. */ /** The rules that have been parsed into this node. */
private final List<FastIgnoreRule> rules; private final List<FastIgnoreRule> rules;
/** Create an empty ignore node with no rules. */ /**
* Create an empty ignore node with no rules.
*/
public IgnoreNode() { public IgnoreNode() {
rules = new ArrayList<>(); rules = new ArrayList<>();
} }
@ -91,7 +93,7 @@ public class IgnoreNode {
* *
* @param rules * @param rules
* list of rules. * list of rules.
**/ */
public IgnoreNode(List<FastIgnoreRule> rules) { public IgnoreNode(List<FastIgnoreRule> rules) {
this.rules = rules; this.rules = rules;
} }
@ -102,7 +104,7 @@ public class IgnoreNode {
* @param in * @param in
* input stream holding the standard ignore format. The caller is * input stream holding the standard ignore format. The caller is
* responsible for closing the stream. * responsible for closing the stream.
* @throws IOException * @throws java.io.IOException
* Error thrown when reading an ignore file. * Error thrown when reading an ignore file.
*/ */
public void parse(InputStream in) throws IOException { public void parse(InputStream in) throws IOException {
@ -122,7 +124,11 @@ public class IgnoreNode {
return new BufferedReader(new InputStreamReader(in, Constants.CHARSET)); return new BufferedReader(new InputStreamReader(in, Constants.CHARSET));
} }
/** @return list of all ignore rules held by this node. */ /**
* Get list of all ignore rules held by this node
*
* @return list of all ignore rules held by this node
*/
public List<FastIgnoreRule> getRules() { public List<FastIgnoreRule> getRules() {
return Collections.unmodifiableList(rules); return Collections.unmodifiableList(rules);
} }
@ -194,6 +200,7 @@ public class IgnoreNode {
return MatchResult.CHECK_PARENT; return MatchResult.CHECK_PARENT;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return rules.toString(); return rules.toString();

3
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/AbstractMatcher.java

@ -64,16 +64,19 @@ public abstract class AbstractMatcher implements IMatcher {
this.dirOnly = dirOnly; this.dirOnly = dirOnly;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return pattern; return pattern;
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return pattern.hashCode(); return pattern.hashCode();
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)

7
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/IMatcher.java

@ -74,9 +74,10 @@ public interface IMatcher {
* with a slash) * with a slash)
* @param pathMatch * @param pathMatch
* {@code true} if the match is for the full path: prefix-only * {@code true} if the match is for the full path: prefix-only
* matches are not allowed, and {@link NameMatcher}s must match * matches are not allowed, and
* only the last component (if they can -- they may not, if they * {@link org.eclipse.jgit.ignore.internal.NameMatcher}s must
* are anchored at the beginning) * match only the last component (if they can -- they may not, if
* they are anchored at the beginning)
* @return true if this matcher pattern matches given string * @return true if this matcher pattern matches given string
*/ */
boolean matches(String path, boolean assumeDirectory, boolean pathMatch); boolean matches(String path, boolean assumeDirectory, boolean pathMatch);

1
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/LeadingAsteriskMatcher.java

@ -55,6 +55,7 @@ public class LeadingAsteriskMatcher extends NameMatcher {
"Pattern must have leading asterisk: " + pattern); //$NON-NLS-1$ "Pattern must have leading asterisk: " + pattern); //$NON-NLS-1$
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String segment, int startIncl, int endExcl, public boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

2
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/NameMatcher.java

@ -71,6 +71,7 @@ public class NameMatcher extends AbstractMatcher {
} }
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String path, boolean assumeDirectory, public boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) { boolean pathMatch) {
@ -120,6 +121,7 @@ public class NameMatcher extends AbstractMatcher {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String segment, int startIncl, int endExcl, public boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

7
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/PathMatcher.java

@ -105,14 +105,17 @@ public class PathMatcher extends AbstractMatcher {
} }
/** /**
* Create path matcher
* *
* @param pattern * @param pattern
* a pattern
* @param pathSeparator * @param pathSeparator
* if this parameter isn't null then this character will not * if this parameter isn't null then this character will not
* match at wildcards(* and ? are wildcards). * match at wildcards(* and ? are wildcards).
* @param dirOnly * @param dirOnly
* a boolean.
* @return never null * @return never null
* @throws InvalidPatternException * @throws org.eclipse.jgit.errors.InvalidPatternException
*/ */
public static IMatcher createPathMatcher(String pattern, public static IMatcher createPathMatcher(String pattern,
Character pathSeparator, boolean dirOnly) Character pathSeparator, boolean dirOnly)
@ -170,6 +173,7 @@ public class PathMatcher extends AbstractMatcher {
} }
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String path, boolean assumeDirectory, public boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) { boolean pathMatch) {
@ -212,6 +216,7 @@ public class PathMatcher extends AbstractMatcher {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String segment, int startIncl, int endExcl, public boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

14
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java

@ -56,8 +56,8 @@ import org.eclipse.jgit.ignore.FastIgnoreRule;
import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.JGitText;
/** /**
* Various {@link String} related utility methods, written mostly to avoid * Various {@link java.lang.String} related utility methods, written mostly to
* generation of new String objects (e.g. via splitting Strings etc). * avoid generation of new String objects (e.g. via splitting Strings etc).
*/ */
public class Strings { public class Strings {
@ -67,6 +67,8 @@ public class Strings {
} }
/** /**
* Strip trailing characters
*
* @param pattern * @param pattern
* non null * non null
* @param c * @param c
@ -87,6 +89,8 @@ public class Strings {
} }
/** /**
* Strip trailing whitespace characters
*
* @param pattern * @param pattern
* non null * non null
* @return new string with all trailing whitespace removed * @return new string with all trailing whitespace removed
@ -105,10 +109,12 @@ public class Strings {
} }
/** /**
* Check if pattern is a directory pattern ending with a path separator
*
* @param pattern * @param pattern
* non null * non null
* @return true if the last character, which is not whitespace, is a path * @return {@code true} if the last character, which is not whitespace, is a
* separator * path separator
*/ */
public static boolean isDirectoryPattern(String pattern) { public static boolean isDirectoryPattern(String pattern) {
for (int i = pattern.length() - 1; i >= 0; i--) { for (int i = pattern.length() - 1; i >= 0; i--) {

1
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/TrailingAsteriskMatcher.java

@ -55,6 +55,7 @@ public class TrailingAsteriskMatcher extends NameMatcher {
"Pattern must have trailing asterisk: " + pattern); //$NON-NLS-1$ "Pattern must have trailing asterisk: " + pattern); //$NON-NLS-1$
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String segment, int startIncl, int endExcl, public boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

3
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildCardMatcher.java

@ -50,7 +50,7 @@ import org.eclipse.jgit.errors.InvalidPatternException;
/** /**
* Matcher built from path segments containing wildcards. This matcher converts * Matcher built from path segments containing wildcards. This matcher converts
* glob wildcards to Java {@link Pattern}'s. * glob wildcards to Java {@link java.util.regex.Pattern}'s.
* <p> * <p>
* This class is immutable and thread safe. * This class is immutable and thread safe.
*/ */
@ -64,6 +64,7 @@ public class WildCardMatcher extends NameMatcher {
p = convertGlob(subPattern); p = convertGlob(subPattern);
} }
/** {@inheritDoc} */
@Override @Override
public boolean matches(String segment, int startIncl, int endExcl, public boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

2
org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/WildMatcher.java

@ -61,12 +61,14 @@ public final class WildMatcher extends AbstractMatcher {
super(WILDMATCH, false); super(WILDMATCH, false);
} }
/** {@inheritDoc} */
@Override @Override
public final boolean matches(String path, boolean assumeDirectory, public final boolean matches(String path, boolean assumeDirectory,
boolean pathMatch) { boolean pathMatch) {
return true; return true;
} }
/** {@inheritDoc} */
@Override @Override
public final boolean matches(String segment, int startIncl, int endExcl, public final boolean matches(String segment, int startIncl, int endExcl,
boolean assumeDirectory) { boolean assumeDirectory) {

Loading…
Cancel
Save