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> {
+ /** {@inheritDoc} */
@Override
public Class<ConfigChangedListener> getListenerType() {
return ConfigChangedListener.class;
}
+ /** {@inheritDoc} */
@Override
public void dispatch(ConfigChangedListener listener) {
listener.onConfigChanged(this);
package org.eclipse.jgit.events;
-/** Receives {@link ConfigChangedEvent}s. */
+/**
+ * Receives {@link org.eclipse.jgit.events.ConfigChangedEvent}s.
+ */
public interface ConfigChangedListener extends RepositoryListener {
/**
* Invoked when any change is made to the configuration.
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> {
+ /** {@inheritDoc} */
@Override
public Class<IndexChangedListener> getListenerType() {
return IndexChangedListener.class;
}
+ /** {@inheritDoc} */
@Override
public void dispatch(IndexChangedListener listener) {
listener.onIndexChanged(this);
package org.eclipse.jgit.events;
-/** Receives {@link IndexChangedEvent}s. */
+/**
+ * Receives {@link org.eclipse.jgit.events.IndexChangedEvent}s.
+ */
public interface IndexChangedListener extends RepositoryListener {
/**
* Invoked when any change is made to the index.
package org.eclipse.jgit.events;
-/** Tracks a previously registered {@link RepositoryListener}. */
+/**
+ * Tracks a previously registered {@link org.eclipse.jgit.events.RepositoryListener}.
+ */
public class ListenerHandle {
private final ListenerList parent;
this.listener = listener;
}
- /** Remove the listener and stop receiving events. */
+ /**
+ * Remove the listener and stop receiving events.
+ */
public void remove() {
parent.remove(this);
}
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
import java.util.concurrent.ConcurrentMap;
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 {
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
* the listener implementation.
/**
* Add a listener to the list.
*
- * @param <T>
- * the type of listener being registered.
* @param type
* type of listener being registered.
* @param listener
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> {
+ /** {@inheritDoc} */
@Override
public Class<RefsChangedListener> getListenerType() {
return RefsChangedListener.class;
}
+ /** {@inheritDoc} */
@Override
public void dispatch(RefsChangedListener listener) {
listener.onRefsChanged(this);
package org.eclipse.jgit.events;
-/** Receives {@link RefsChangedEvent}s. */
+/**
+ * Receives {@link org.eclipse.jgit.events.RefsChangedEvent}s.
+ */
public interface RefsChangedListener extends RepositoryListener {
/**
* Invoked when any reference changes.
* Set the repository this event occurred on.
* <p>
* 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
* the repository.
repository = r;
}
- /** @return the repository that was changed. */
+ /**
+ * Get the repository that was changed
+ *
+ * @return the repository that was changed
+ */
public Repository getRepository() {
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 void dispatch(T listener);
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
package org.eclipse.jgit.events;
-/** A listener can register for event delivery. */
+/**
+ * A listener can register for event delivery.
+ */
public interface RepositoryListener {
// Empty marker interface; see extensions for actual methods.
}
import org.eclipse.jgit.annotations.NonNull;
/**
- * A {@link RepositoryEvent} describing changes to the working tree. It is fired
- * whenever a {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
+ * A {@link org.eclipse.jgit.events.RepositoryEvent} describing changes to the
+ * working tree. It is fired whenever a
+ * {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
* (adds/deletes/updates) files in the working tree.
*
* @since 4.9
private Collection<String> deleted;
/**
- * Creates a new {@link WorkingTreeModifiedEvent} with the given
- * collections.
+ * Creates a new {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}
+ * with the given collections.
*
* @param modified
* repository-relative paths that were added or updated
}
/**
- * Retrieves the {@link Collection} of repository-relative paths of files
- * that were modified (added or updated).
+ * Retrieves the {@link java.util.Collection} of repository-relative paths
+ * of files that were modified (added or updated).
*
* @return the set
*/
}
/**
- * Retrieves the {@link Collection} of repository-relative paths of files
- * that were deleted.
+ * Retrieves the {@link java.util.Collection} of repository-relative paths
+ * of files that were deleted.
*
* @return the set
*/
return result;
}
+ /** {@inheritDoc} */
@Override
public Class<WorkingTreeModifiedListener> getListenerType() {
return WorkingTreeModifiedListener.class;
}
+ /** {@inheritDoc} */
@Override
public void dispatch(WorkingTreeModifiedListener listener) {
listener.onWorkingTreeModified(this);
package org.eclipse.jgit.events;
/**
- * Receives {@link WorkingTreeModifiedEvent}s, which are fired whenever a
- * {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
+ * Receives {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}s, which are
+ * fired whenever a {@link org.eclipse.jgit.dircache.DirCacheCheckout} modifies
* (adds/deletes/updates) files in the working tree.
*
* @since 4.9
* Respond to working tree modifications.
*
* @param event
+ * a {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent}
+ * object.
*/
void onWorkingTreeModified(WorkingTreeModifiedEvent event);
}