diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java index c256b738b..5842e14cd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attribute.java @@ -47,9 +47,12 @@ package org.eclipse.jgit.attributes; *
* According to the man page, an attribute can have the following states: *
null
.
* @param state
- * the attribute state. It should be either {@link State#SET} or
- * {@link State#UNSET}. In order to create a custom value
- * attribute prefer the use of {@link #Attribute(String, String)}
- * constructor.
+ * the attribute state. It should be either
+ * {@link org.eclipse.jgit.attributes.Attribute.State#SET} or
+ * {@link org.eclipse.jgit.attributes.Attribute.State#UNSET}. In
+ * order to create a custom value attribute prefer the use of
+ * {@link #Attribute(String, String)} constructor.
*/
public Attribute(String key, State state) {
this(key, state, null);
@@ -127,6 +131,7 @@ public final class Attribute {
this(key, State.CUSTOM, value);
}
+ /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -147,6 +152,8 @@ public final class Attribute {
}
/**
+ * Get key
+ *
* @return the attribute key (never returns null
)
*/
public String getKey() {
@@ -154,7 +161,7 @@ public final class Attribute {
}
/**
- * Returns the state.
+ * Return the state.
*
* @return the state (never returns null
)
*/
@@ -163,12 +170,15 @@ public final class Attribute {
}
/**
+ * Get value
+ *
* @return the attribute value (may be null
)
*/
public String getValue() {
return value;
}
+ /** {@inheritDoc} */
@Override
public int hashCode() {
final int prime = 31;
@@ -179,6 +189,7 @@ public final class Attribute {
return result;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
switch (state) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attributes.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attributes.java
index d3826b3d9..5fcd596a6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attributes.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/Attributes.java
@@ -64,6 +64,7 @@ public final class Attributes {
* Creates a new instance
*
* @param attributes
+ * a {@link org.eclipse.jgit.attributes.Attribute}
*/
public Attributes(Attribute... attributes) {
if (attributes != null) {
@@ -74,6 +75,8 @@ public final class Attributes {
}
/**
+ * Whether the set of attributes is empty
+ *
* @return true if the set does not contain any attributes
*/
public boolean isEmpty() {
@@ -81,7 +84,10 @@ public final class Attributes {
}
/**
+ * Get the attribute with the given key
+ *
* @param key
+ * a {@link java.lang.String} object.
* @return the attribute or null
*/
public Attribute get(String key) {
@@ -89,6 +95,8 @@ public final class Attributes {
}
/**
+ * Get all attributes
+ *
* @return all attributes
*/
public Collectionnull
)
*/
public Attribute.State getState(String key) {
@@ -130,41 +148,63 @@ public final class Attributes {
}
/**
+ * Whether the attribute is set
+ *
* @param key
- * @return true if the key is {@link State#SET}, false in all other cases
+ * a {@link java.lang.String} object.
+ * @return true if the key is
+ * {@link org.eclipse.jgit.attributes.Attribute.State#SET}, false in
+ * all other cases
*/
public boolean isSet(String key) {
return (getState(key) == State.SET);
}
/**
+ * Whether the attribute is unset
+ *
* @param key
- * @return true if the key is {@link State#UNSET}, false in all other cases
+ * a {@link java.lang.String} object.
+ * @return true if the key is
+ * {@link org.eclipse.jgit.attributes.Attribute.State#UNSET}, false
+ * in all other cases
*/
public boolean isUnset(String key) {
return (getState(key) == State.UNSET);
}
/**
+ * Whether the attribute with the given key is unspecified
+ *
* @param key
- * @return true if the key is {@link State#UNSPECIFIED}, false in all other
- * cases
+ * a {@link java.lang.String} object.
+ * @return true if the key is
+ * {@link org.eclipse.jgit.attributes.Attribute.State#UNSPECIFIED},
+ * false in all other cases
*/
public boolean isUnspecified(String key) {
return (getState(key) == State.UNSPECIFIED);
}
/**
+ * Is this a custom attribute
+ *
* @param key
- * @return true if the key is {@link State#CUSTOM}, false in all other cases
- * see {@link #getValue(String)} for the value of the key
+ * a {@link java.lang.String} object.
+ * @return true if the key is
+ * {@link org.eclipse.jgit.attributes.Attribute.State#CUSTOM}, false
+ * in all other cases see {@link #getValue(String)} for the value of
+ * the key
*/
public boolean isCustom(String key) {
return (getState(key) == State.CUSTOM);
}
/**
+ * Get attribute value
+ *
* @param key
+ * an attribute key
* @return the attribute value (may be null
)
*/
public String getValue(String key) {
@@ -192,6 +232,7 @@ public final class Attributes {
return true;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
@@ -206,11 +247,13 @@ public final class Attributes {
return buf.toString();
}
+ /** {@inheritDoc} */
@Override
public int hashCode() {
return map.hashCode();
}
+ /** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesHandler.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesHandler.java
index 8d928e374..638dd827e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesHandler.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesHandler.java
@@ -61,7 +61,8 @@ import org.eclipse.jgit.treewalk.WorkingTreeIterator;
* The attributes handler knows how to retrieve, parse and merge attributes from
* the various gitattributes files. Furthermore it collects and expands macro
* expressions. The method {@link #getAttributes()} yields the ready processed
- * attributes for the current path represented by the {@link TreeWalk}
+ * attributes for the current path represented by the
+ * {@link org.eclipse.jgit.treewalk.TreeWalk}
*
* The implementation is based on the specifications in
* http://git-scm.com/docs/gitattributes
@@ -90,11 +91,13 @@ public class AttributesHandler {
private final Maprules
.
+ *
+ * @return list of all ignore rules held by this node
+ */
public Listnull
)
@@ -180,6 +182,8 @@ public class AttributesRule {
}
/**
+ * Whether the pattern is only a file name and not a path
+ *
* @return true
if the pattern is just a file name and not a
* path
*/
@@ -188,6 +192,8 @@ public class AttributesRule {
}
/**
+ * Get the pattern
+ *
* @return The blob pattern to be used as a matcher (never returns
* null
)
*/
@@ -214,6 +220,7 @@ public class AttributesRule {
return match;
}
+ /** {@inheritDoc} */
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java
index 10be58880..aae00764f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java
@@ -50,7 +50,7 @@ import java.io.OutputStream;
* An abstraction for JGit's builtin implementations for hooks and filters.
* Instead of spawning an external processes to start a filter/hook and to pump
* data from/to stdin/stdout these builtin commmands may be used. They are
- * constructed by {@link FilterCommandFactory}.
+ * constructed by {@link org.eclipse.jgit.attributes.FilterCommandFactory}.
*
* @since 4.6
*/
@@ -66,10 +66,12 @@ public abstract class FilterCommand {
protected OutputStream out;
/**
+ * Constructor for FilterCommand
+ *
* @param in
- * The {@link InputStream} this command should read from
+ * The {@link java.io.InputStream} this command should read from
* @param out
- * The {@link OutputStream} this command should write to
+ * The {@link java.io.OutputStream} this command should write to
*/
public FilterCommand(InputStream in, OutputStream out) {
this.in = in;
@@ -80,15 +82,15 @@ public abstract class FilterCommand {
* Execute the command. The command is supposed to read data from
* {@link #in} and to write the result to {@link #out}. It returns the
* number of bytes it read from {@link #in}. It should be called in a loop
- * until it returns -1 signaling that the {@link InputStream} is completely
- * processed.
+ * until it returns -1 signaling that the {@link java.io.InputStream} is
+ * completely processed.
*
- * @return the number of bytes read from the {@link InputStream} or -1. -1
- * means that the {@link InputStream} is completely processed.
- * @throws IOException
- * when {@link IOException} occured while reading from
+ * @return the number of bytes read from the {@link java.io.InputStream} or
+ * -1. -1 means that the {@link java.io.InputStream} is completely
+ * processed.
+ * @throws java.io.IOException
+ * when {@link java.io.IOException} occured while reading from
* {@link #in} or writing to {@link #out}
- *
*/
public abstract int run() throws IOException;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java
index 6b973da35..11b76b0d9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java
@@ -49,23 +49,25 @@ import java.io.OutputStream;
import org.eclipse.jgit.lib.Repository;
/**
- * The factory responsible for creating instances of {@link FilterCommand}.
+ * The factory responsible for creating instances of
+ * {@link org.eclipse.jgit.attributes.FilterCommand}.
*
* @since 4.6
*/
public interface FilterCommandFactory {
/**
- * Create a new {@link FilterCommand}.
+ * Create a new {@link org.eclipse.jgit.attributes.FilterCommand}.
*
* @param db
* the repository this command should work on
* @param in
- * the {@link InputStream} this command should read from
+ * the {@link java.io.InputStream} this command should read from
* @param out
- * the {@link OutputStream} this command should write to
- * @return the created {@link FilterCommand}
- * @throws IOException
- * thrown when the command constructor throws an IOException
+ * the {@link java.io.OutputStream} this command should write to
+ * @return the created {@link org.eclipse.jgit.attributes.FilterCommand}
+ * @throws java.io.IOException
+ * thrown when the command constructor throws an
+ * java.io.IOException
*/
public FilterCommand create(Repository db, InputStream in,
OutputStream out) throws IOException;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java
index 3fbaedb05..7e511a831 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java
@@ -59,17 +59,20 @@ public class FilterCommandRegistry {
private static ConcurrentHashMapgetCommand("jgit://builtin/x", ...)
will call
- * f1(...)
to create a new instance of {@link FilterCommand}
+ * Register a {@link org.eclipse.jgit.attributes.FilterCommandFactory}
+ * responsible for creating
+ * {@link org.eclipse.jgit.attributes.FilterCommand}s for a certain command
+ * name. If the factory f1 is registered for the name "jgit://builtin/x"
+ * then a call to getCommand("jgit://builtin/x", ...)
will call
+ * f1(...)
to create a new instance of
+ * {@link org.eclipse.jgit.attributes.FilterCommand}
*
* @param filterCommandName
* the command name for which this factory is registered
* @param factory
- * the factory responsible for creating {@link FilterCommand}s
- * for the specified name
+ * the factory responsible for creating
+ * {@link org.eclipse.jgit.attributes.FilterCommand}s for the
+ * specified name
* @return the previous factory associated with commandName, or
* null if there was no mapping for commandName
*/
@@ -79,8 +82,8 @@ public class FilterCommandRegistry {
}
/**
- * Unregisters the {@link FilterCommandFactory} registered for the given
- * command name
+ * Unregister the {@link org.eclipse.jgit.attributes.FilterCommandFactory}
+ * registered for the given command name
*
* @param filterCommandName
* the FilterCommandFactory's filter command name
@@ -92,8 +95,9 @@ public class FilterCommandRegistry {
}
/**
- * Checks whether any {@link FilterCommandFactory} is registered for a given
- * command name
+ * Check whether any
+ * {@link org.eclipse.jgit.attributes.FilterCommandFactory} is registered
+ * for a given command name
*
* @param filterCommandName
* the name for which the registry should be checked
@@ -104,7 +108,10 @@ public class FilterCommandRegistry {
}
/**
- * @return Set of commandNames for which a {@link FilterCommandFactory} is
+ * Get registered filter commands
+ *
+ * @return Set of commandNames for which a
+ * {@link org.eclipse.jgit.attributes.FilterCommandFactory} is
* registered
*/
public static Setnull
if
* there was no factory registered for that name
- * @throws IOException
+ * @throws java.io.IOException
*/
public static FilterCommand createFilterCommand(String filterCommandName,
Repository db, InputStream in, OutputStream out)