This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 6e4d2f3f6f9c4a1e72575a3425baf9e66a8dc4cb Author: juanpablo <[email protected]> AuthorDate: Thu Jan 23 21:48:32 2020 +0100 fix javadocs so the updated package of PageEventFilter is used. Also, while at it, apply format suggestions by intellij --- .../java/org/apache/wiki/event/WikiPageEvent.java | 216 +++++++++------------ 1 file changed, 95 insertions(+), 121 deletions(-) diff --git a/jspwiki-main/src/main/java/org/apache/wiki/event/WikiPageEvent.java b/jspwiki-main/src/main/java/org/apache/wiki/event/WikiPageEvent.java index 07825de..181e3a7 100644 --- a/jspwiki-main/src/main/java/org/apache/wiki/event/WikiPageEvent.java +++ b/jspwiki-main/src/main/java/org/apache/wiki/event/WikiPageEvent.java @@ -21,84 +21,70 @@ package org.apache.wiki.event; /** - * WikiPageEvent indicates a change in the state or processing of a WikiPage. - * There are basically two types of page events: - * <dl> - * <dt><b>Phase Boundary Events</b></dt> - * <dd>Those considered as "beginning-of-phase", and those as "end-of-phase" - * events (as designated by <tt>*_BEGIN</tt> and <tt>*_END</tt>), as - * generated by the WikiEngine. The phases include pre-save, post-save, - * pre-translate, and post-translate. - * </dd> - * <dt><b>In-Phase Events</b></dt> - * <dd>In-phase events are generated as specific events from the - * PageEventFilter (or elsewhere), on a per-listener basis. There may - * be many such events during a particular phase. - * </dd> - * </dl> - * <p> - * E.g., a typical event sequence for the pre-translate phase would be: - * </p> - * <ol> - * <li>PRE_TRANSLATE_BEGIN</li> - * <li>PRE_TRANSLATE</li> - * <li>PRE_TRANSLATE</li> - * <li>...</li> - * <li>PRE_TRANSLATE_END</li> - * </ol> - * - * <h2>Notes</h2> - * - * <h3>Page Requested and Delivered Events</h3> - * <p> - * These two events are fired once per page request, at the beginning - * and after delivery of the page (respectively). They are generated - * by the {@link org.apache.wiki.ui.WikiServletFilter}. - * </p> - * - * <h3>Page Lock and Unlock Events</h3> - * <p> - * Page lock and unlock events occur only once during an editing session, - * so there are no begin and end events. They are generated - * by the {@link org.apache.wiki.pages.PageManager}. - * </p> - * - * <h3>WikiPageEvents</h3> - * <p> - * Other WikiPageEvents include both <i>phase boundary</i> and <i>in-phase</i> - * events for saving, pre- and post-translating content. These are very noisy - * event types, but are not fired unless a listener is available. They are - * generated by the {@link org.apache.wiki.api.engine.FilterManager}, - * {@link org.apache.wiki.event.PageEventFilter}, and potentially other - * implementing classes. - * </p> - * - * <h3>Firing Order and Phase Boundaries</h3> - * <p> - * Note that due to the asynchronous nature of event processing, any threads - * spawned by such events will not necessarily have completed during their - * specific phase; we can assume only that no more events of that phase will - * be fired after its <tt>*_END</tt> event has been fired. - * </p> - * - * @see org.apache.wiki.event.WikiEvent - * @since 2.4.20 - */ -public class WikiPageEvent extends WikiEvent -{ - // PAGE LOCKING EVENTS ... + * WikiPageEvent indicates a change in the state or processing of a WikiPage. There are basically two types of page events: + * <dl> + * <dt><b>Phase Boundary Events</b></dt> + * <dd>Those considered as "beginning-of-phase", and those as "end-of-phase" events (as designated by <tt>*_BEGIN</tt> and + * <tt>*_END</tt>), as generated by the WikiEngine. The phases include pre-save, post-save, pre-translate, and post-translate. + * </dd> + * <dt><b>In-Phase Events</b></dt> + * <dd>In-phase events are generated as specific events from the PageEventFilter (or elsewhere), on a per-listener basis. There may + * be many such events during a particular phase. + * </dd> + * </dl> + * <p> + * E.g., a typical event sequence for the pre-translate phase would be: + * </p> + * <ol> + * <li>PRE_TRANSLATE_BEGIN</li> + * <li>PRE_TRANSLATE</li> + * <li>PRE_TRANSLATE</li> + * <li>...</li> + * <li>PRE_TRANSLATE_END</li> + * </ol> + * + * <h2>Notes</h2> + * + * <h3>Page Requested and Delivered Events</h3> + * <p> + * These two events are fired once per page request, at the beginning and after delivery of the page (respectively). They are generated + * by the {@link org.apache.wiki.ui.WikiServletFilter}. + * </p> + * + * <h3>Page Lock and Unlock Events</h3> + * <p> + * Page lock and unlock events occur only once during an editing session, so there are no begin and end events. They are generated + * by the {@link org.apache.wiki.pages.PageManager}. + * </p> + * + * <h3>WikiPageEvents</h3> + * <p> + * Other WikiPageEvents include both <i>phase boundary</i> and <i>in-phase</i> events for saving, pre- and post-translating content. + * These are very noisy event types, but are not fired unless a listener is available. They are generated by the + * {@link org.apache.wiki.api.engine.FilterManager}, {@link org.apache.wiki.filters.PageEventFilter}, and potentially other + * implementing classes. + * </p> + * + * <h3>Firing Order and Phase Boundaries</h3> + * <p> + * Note that due to the asynchronous nature of event processing, any threads spawned by such events will not necessarily have completed + * during their specific phase; we can assume only that no more events of that phase will be fired after its <tt>*_END</tt> event has + * been fired. + * </p> + * + * @see org.apache.wiki.event.WikiEvent + * @since 2.4.20 + */ +public class WikiPageEvent extends WikiEvent { - /** - * - */ private static final long serialVersionUID = 1L; - /** Indicates a page lock event. This is based on events - * generated by {@link org.apache.wiki.pages.PageManager}. */ + // PAGE LOCKING EVENTS ... + + /** Indicates a page lock event. This is based on events generated by {@link org.apache.wiki.pages.PageManager}. */ public static final int PAGE_LOCK = 10; - /** Indicates a page unlock event. This is based on events - * generated by {@link org.apache.wiki.pages.PageManager}. */ + /** Indicates a page unlock event. This is based on events generated by {@link org.apache.wiki.pages.PageManager}. */ public static final int PAGE_UNLOCK = 11; // PRE_TRANSLATE ......... @@ -108,7 +94,7 @@ public class WikiPageEvent extends WikiEvent public static final int PRE_TRANSLATE_BEGIN = 12; /** Indicates a wiki pre-translate page event. This is based on events - * generated by {@link org.apache.wiki.event.PageEventFilter}. */ + * generated by {@link org.apache.wiki.filters.PageEventFilter}. */ public static final int PRE_TRANSLATE = 13; /** Indicates the end of all wiki pre-translate page events. This is based @@ -122,7 +108,7 @@ public class WikiPageEvent extends WikiEvent public static final int POST_TRANSLATE_BEGIN = 15; /** Indicates a wiki post-translate page event. This is based on events - * generated by {@link org.apache.wiki.event.PageEventFilter}. */ + * generated by {@link org.apache.wiki.filters.PageEventFilter}. */ public static final int POST_TRANSLATE = 16; /** Indicates the end of all wiki post-translate page events. This is based @@ -135,8 +121,7 @@ public class WikiPageEvent extends WikiEvent * on events generated by {@link org.apache.wiki.api.engine.FilterManager}. */ public static final int PRE_SAVE_BEGIN = 18; - /** Indicates a wiki pre-save page event. This is based on events - * generated by {@link org.apache.wiki.event.PageEventFilter}. */ + /** Indicates a wiki pre-save page event. This is based on events generated by {@link org.apache.wiki.filters.PageEventFilter}. */ public static final int PRE_SAVE = 19; /** Indicates the end of all wiki pre-save page events. This is based @@ -149,82 +134,72 @@ public class WikiPageEvent extends WikiEvent * on events generated by {@link org.apache.wiki.api.engine.FilterManager}. */ public static final int POST_SAVE_BEGIN = 21; - /** Indicates a wiki post-save page event. This is based on events - * generated by {@link org.apache.wiki.event.PageEventFilter}. */ + /** Indicates a wiki post-save page event. This is based on events generated by {@link org.apache.wiki.filters.PageEventFilter}. */ public static final int POST_SAVE = 22; /** Indicates the end of all wiki post-save page events. This is based - * on events generated by {@link org.apache.wiki.api.engine.FilterManager}. */ + * on events generated by {@link org.apache.wiki.api.engine.FilterManager}. */ public static final int POST_SAVE_END = 23; // PAGE REQUESTS ......... /** Indicates a wiki page request event (the start of a request). This is based - * on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. */ + * on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. */ public static final int PAGE_REQUESTED = 24; /** Indicates a wiki page delivery event (the end of a request). This is based - * on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. */ + * on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. */ public static final int PAGE_DELIVERED = 25; /** Indicates a wiki page delete event (the beginning of a delete request). - * This is based on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. - * @since 2.4.65 */ + * This is based on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. + * @since 2.4.65 */ public static final int PAGE_DELETE_REQUEST = 26; /** Indicates a wiki page deleted event (after the delete has been completed). - * This is based on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. - * @since 2.4.65 */ + * This is based on events generated by {@link org.apache.wiki.ui.WikiServletFilter}. + * @since 2.4.65 */ public static final int PAGE_DELETED = 27; - private String m_pagename = null; + private String m_pagename; // ............ - /** * Constructs an instance of this event. - * @param src the Object that is the source of the event. - * @param type the type of the event (see the enumerated int values defined - * in {@link org.apache.wiki.event.WikiEvent}). - * @param pagename the WikiPage being acted upon. + * + * @param src the Object that is the source of the event. + * @param type the type of the event (see the enumerated int values defined in {@link org.apache.wiki.event.WikiEvent}). + * @param pagename the WikiPage being acted upon. */ - public WikiPageEvent( Object src, int type, String pagename ) - { + public WikiPageEvent( final Object src, final int type, final String pagename ) { super( src, type ); m_pagename = pagename; } - - /** - * Returns the Wiki page name associated with this event. - * This may be null if unavailable. + /** + * Returns the Wiki page name associated with this event. This may be null if unavailable. * - * @return the Wiki page name associated with this WikiEvent, or null. + * @return the Wiki page name associated with this WikiEvent, or null. */ - public String getPageName() - { + public String getPageName() { return m_pagename; } - - /** + /** * Returns true if the int value is a WikiPageEvent type. */ - public static boolean isValidType( int type ) - { + public static boolean isValidType( final int type ) { return type >= PAGE_LOCK && type <= PAGE_DELETED; } - /** * Returns a textual representation of the event type. + * * @return a String representation of the type */ - public String eventName() - { - switch ( getType() ) - { + public String eventName() { + switch ( getType() ) { case PAGE_LOCK: return "PAGE_LOCK"; case PAGE_UNLOCK: return "PAGE_UNLOCK"; @@ -245,23 +220,22 @@ public class WikiPageEvent extends WikiEvent case POST_SAVE_END: return "POST_SAVE_END"; case PAGE_REQUESTED: return "PAGE_REQUESTED"; - case PAGE_DELIVERED: return "PAGE_DELIVERED"; + case PAGE_DELIVERED: return "PAGE_DELIVERED"; - case PAGE_DELETE_REQUEST: return "PAGE_DELETE_REQUEST"; - case PAGE_DELETED: return "PAGE_DELETED"; + case PAGE_DELETE_REQUEST: return "PAGE_DELETE_REQUEST"; + case PAGE_DELETED: return "PAGE_DELETED"; default: return super.eventName(); } } - - /** Returns a human-readable description of the event type. + /** + * Returns a human-readable description of the event type. + * * @return a String description of the type */ - public String getTypeDescription() - { - switch ( getType() ) - { + public String getTypeDescription() { + switch ( getType() ) { case PAGE_LOCK: return "page lock event"; case PAGE_UNLOCK: return "page unlock event"; @@ -282,7 +256,7 @@ public class WikiPageEvent extends WikiEvent case POST_SAVE_END: return "end of page post-save events"; case PAGE_REQUESTED: return "page requested event"; - case PAGE_DELIVERED: return "page delivered event"; + case PAGE_DELIVERED: return "page delivered event"; case PAGE_DELETE_REQUEST: return "page delete request event"; case PAGE_DELETED: return "page deleted event"; @@ -291,4 +265,4 @@ public class WikiPageEvent extends WikiEvent } } -} // end class org.apache.wiki.event.WikiPageEvent +}
