Fix javadoc in org.eclipse.jgit events package

Change-Id: Ifcb9c67daeb9da84a1461a4f731523ac5df3a223
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2017-12-18 11:39:12 +01:00
parent 6478577899
commit dc91f4ef2c
12 changed files with 66 additions and 26 deletions

View File

@ -43,13 +43,17 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Describes a change to one or more keys in the configuration. */ /**
* Describes a change to one or more keys in the configuration.
*/
public class ConfigChangedEvent extends RepositoryEvent<ConfigChangedListener> { public class ConfigChangedEvent extends RepositoryEvent<ConfigChangedListener> {
/** {@inheritDoc} */
@Override @Override
public Class<ConfigChangedListener> getListenerType() { public Class<ConfigChangedListener> getListenerType() {
return ConfigChangedListener.class; return ConfigChangedListener.class;
} }
/** {@inheritDoc} */
@Override @Override
public void dispatch(ConfigChangedListener listener) { public void dispatch(ConfigChangedListener listener) {
listener.onConfigChanged(this); listener.onConfigChanged(this);

View File

@ -43,7 +43,9 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Receives {@link ConfigChangedEvent}s. */ /**
* Receives {@link org.eclipse.jgit.events.ConfigChangedEvent}s.
*/
public interface ConfigChangedListener extends RepositoryListener { public interface ConfigChangedListener extends RepositoryListener {
/** /**
* Invoked when any change is made to the configuration. * Invoked when any change is made to the configuration.

View File

@ -43,13 +43,17 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Describes a change to one or more paths in the index file. */ /**
* Describes a change to one or more paths in the index file.
*/
public class IndexChangedEvent extends RepositoryEvent<IndexChangedListener> { public class IndexChangedEvent extends RepositoryEvent<IndexChangedListener> {
/** {@inheritDoc} */
@Override @Override
public Class<IndexChangedListener> getListenerType() { public Class<IndexChangedListener> getListenerType() {
return IndexChangedListener.class; return IndexChangedListener.class;
} }
/** {@inheritDoc} */
@Override @Override
public void dispatch(IndexChangedListener listener) { public void dispatch(IndexChangedListener listener) {
listener.onIndexChanged(this); listener.onIndexChanged(this);

View File

@ -43,7 +43,9 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Receives {@link IndexChangedEvent}s. */ /**
* Receives {@link org.eclipse.jgit.events.IndexChangedEvent}s.
*/
public interface IndexChangedListener extends RepositoryListener { public interface IndexChangedListener extends RepositoryListener {
/** /**
* Invoked when any change is made to the index. * Invoked when any change is made to the index.

View File

@ -43,7 +43,9 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Tracks a previously registered {@link RepositoryListener}. */ /**
* Tracks a previously registered {@link org.eclipse.jgit.events.RepositoryListener}.
*/
public class ListenerHandle { public class ListenerHandle {
private final ListenerList parent; private final ListenerList parent;
@ -59,11 +61,14 @@ public class ListenerHandle {
this.listener = listener; this.listener = listener;
} }
/** Remove the listener and stop receiving events. */ /**
* Remove the listener and stop receiving events.
*/
public void remove() { public void remove() {
parent.remove(this); parent.remove(this);
} }
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

View File

@ -48,12 +48,14 @@
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
/** Manages a thread-safe list of {@link RepositoryListener}s. */ /**
* Manages a thread-safe list of {@link org.eclipse.jgit.events.RepositoryListener}s.
*/
public class ListenerList { public class ListenerList {
private final ConcurrentMap<Class<? extends RepositoryListener>, CopyOnWriteArrayList<ListenerHandle>> lists = new ConcurrentHashMap<>(); private final ConcurrentMap<Class<? extends RepositoryListener>, CopyOnWriteArrayList<ListenerHandle>> lists = new ConcurrentHashMap<>();
/** /**
* Register a {@link WorkingTreeModifiedListener}. * Register a {@link org.eclipse.jgit.events.WorkingTreeModifiedListener}.
* *
* @param listener * @param listener
* the listener implementation. * the listener implementation.
@ -102,8 +104,6 @@ public ListenerHandle addConfigChangedListener(
/** /**
* Add a listener to the list. * Add a listener to the list.
* *
* @param <T>
* the type of listener being registered.
* @param type * @param type
* type of listener being registered. * type of listener being registered.
* @param listener * @param listener

View File

@ -43,13 +43,17 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Describes a change to one or more references of a repository. */ /**
* Describes a change to one or more references of a repository.
*/
public class RefsChangedEvent extends RepositoryEvent<RefsChangedListener> { public class RefsChangedEvent extends RepositoryEvent<RefsChangedListener> {
/** {@inheritDoc} */
@Override @Override
public Class<RefsChangedListener> getListenerType() { public Class<RefsChangedListener> getListenerType() {
return RefsChangedListener.class; return RefsChangedListener.class;
} }
/** {@inheritDoc} */
@Override @Override
public void dispatch(RefsChangedListener listener) { public void dispatch(RefsChangedListener listener) {
listener.onRefsChanged(this); listener.onRefsChanged(this);

View File

@ -43,7 +43,9 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** Receives {@link RefsChangedEvent}s. */ /**
* Receives {@link org.eclipse.jgit.events.RefsChangedEvent}s.
*/
public interface RefsChangedListener extends RepositoryListener { public interface RefsChangedListener extends RepositoryListener {
/** /**
* Invoked when any reference changes. * Invoked when any reference changes.

View File

@ -59,7 +59,8 @@ public abstract class RepositoryEvent<T extends RepositoryListener> {
* Set the repository this event occurred on. * Set the repository this event occurred on.
* <p> * <p>
* This method should only be invoked once on each event object, and is * This method should only be invoked once on each event object, and is
* automatically set by {@link Repository#fireEvent(RepositoryEvent)}. * automatically set by
* {@link org.eclipse.jgit.lib.Repository#fireEvent(RepositoryEvent)}.
* *
* @param r * @param r
* the repository. * the repository.
@ -69,12 +70,20 @@ public void setRepository(Repository r) {
repository = r; repository = r;
} }
/** @return the repository that was changed. */ /**
* Get the repository that was changed
*
* @return the repository that was changed
*/
public Repository getRepository() { public Repository getRepository() {
return repository; return repository;
} }
/** @return type of listener this event dispatches to. */ /**
* Get type of listener this event dispatches to
*
* @return type of listener this event dispatches to
*/
public abstract Class<T> getListenerType(); public abstract Class<T> getListenerType();
/** /**
@ -85,6 +94,7 @@ public Repository getRepository() {
*/ */
public abstract void dispatch(T listener); public abstract void dispatch(T listener);
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

View File

@ -43,7 +43,9 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** A listener can register for event delivery. */ /**
* A listener can register for event delivery.
*/
public interface RepositoryListener { public interface RepositoryListener {
// Empty marker interface; see extensions for actual methods. // Empty marker interface; see extensions for actual methods.
} }

View File

@ -48,8 +48,9 @@
import org.eclipse.jgit.annotations.NonNull; import org.eclipse.jgit.annotations.NonNull;
/** /**
* A {@link RepositoryEvent} describing changes to the working tree. It is fired * A {@link org.eclipse.jgit.events.RepositoryEvent} describing changes to the
* whenever a {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies * working tree. It is fired whenever a
* {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
* (adds/deletes/updates) files in the working tree. * (adds/deletes/updates) files in the working tree.
* *
* @since 4.9 * @since 4.9
@ -62,8 +63,8 @@ public class WorkingTreeModifiedEvent
private Collection<String> deleted; private Collection<String> deleted;
/** /**
* Creates a new {@link WorkingTreeModifiedEvent} with the given * Creates a new {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}
* collections. * with the given collections.
* *
* @param modified * @param modified
* repository-relative paths that were added or updated * repository-relative paths that were added or updated
@ -88,8 +89,8 @@ public boolean isEmpty() {
} }
/** /**
* Retrieves the {@link Collection} of repository-relative paths of files * Retrieves the {@link java.util.Collection} of repository-relative paths
* that were modified (added or updated). * of files that were modified (added or updated).
* *
* @return the set * @return the set
*/ */
@ -103,8 +104,8 @@ public boolean isEmpty() {
} }
/** /**
* Retrieves the {@link Collection} of repository-relative paths of files * Retrieves the {@link java.util.Collection} of repository-relative paths
* that were deleted. * of files that were deleted.
* *
* @return the set * @return the set
*/ */
@ -117,11 +118,13 @@ public boolean isEmpty() {
return result; return result;
} }
/** {@inheritDoc} */
@Override @Override
public Class<WorkingTreeModifiedListener> getListenerType() { public Class<WorkingTreeModifiedListener> getListenerType() {
return WorkingTreeModifiedListener.class; return WorkingTreeModifiedListener.class;
} }
/** {@inheritDoc} */
@Override @Override
public void dispatch(WorkingTreeModifiedListener listener) { public void dispatch(WorkingTreeModifiedListener listener) {
listener.onWorkingTreeModified(this); listener.onWorkingTreeModified(this);

View File

@ -44,8 +44,8 @@
package org.eclipse.jgit.events; package org.eclipse.jgit.events;
/** /**
* Receives {@link WorkingTreeModifiedEvent}s, which are fired whenever a * Receives {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}s, which are
* {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies * fired whenever a {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
* (adds/deletes/updates) files in the working tree. * (adds/deletes/updates) files in the working tree.
* *
* @since 4.9 * @since 4.9
@ -56,6 +56,8 @@ public interface WorkingTreeModifiedListener extends RepositoryListener {
* Respond to working tree modifications. * Respond to working tree modifications.
* *
* @param event * @param event
* a {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}
* object.
*/ */
void onWorkingTreeModified(WorkingTreeModifiedEvent event); void onWorkingTreeModified(WorkingTreeModifiedEvent event);
} }