From a2f73926097ddb14819dc85aa6f4db184f5a9e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Go=CC=88tz?= Date: Tue, 22 May 2012 22:51:18 +0200 Subject: [PATCH] Javadoc corrections --- .../wicket/IComponentAwareEventSink.java | 84 +-- .../apache/wicket/ajax/json/JSONWriter.java | 654 +++++++++--------- .../core/request/handler/IPageProvider.java | 5 +- .../handler/PageAndComponentProvider.java | 4 +- .../core/request/mapper/PackageMapper.java | 8 +- .../locator/OsgiResourceStreamLocator.java | 2 +- .../wicket/markup/html/border/Border.java | 4 +- .../markup/html/border/BorderPanel.java | 262 +++---- .../markup/html/form/RangeTextField.java | 4 +- .../resource/DefaultButtonImageResource.java | 2 +- .../markup/html/pages/BrowserInfoPage.java | 2 +- .../repeater/data/EmptyDataProvider.java | 2 +- .../markup/repeater/data/IDataProvider.java | 2 +- .../apache/wicket/pageStore/IPageStore.java | 2 - .../memory/HttpSessionDataStore.java | 2 +- .../cycle/RequestCycleListenerCollection.java | 426 ++++++------ .../loader/ClassStringResourceLoader.java | 2 +- .../wicket/util/template/TextTemplate.java | 2 +- 18 files changed, 734 insertions(+), 735 deletions(-) diff --git a/wicket-core/src/main/java/org/apache/wicket/IComponentAwareEventSink.java b/wicket-core/src/main/java/org/apache/wicket/IComponentAwareEventSink.java index 6e3c4e3ec1f..9b8fc3639ae 100644 --- a/wicket-core/src/main/java/org/apache/wicket/IComponentAwareEventSink.java +++ b/wicket-core/src/main/java/org/apache/wicket/IComponentAwareEventSink.java @@ -1,42 +1,42 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket; - -import org.apache.wicket.behavior.Behavior; -import org.apache.wicket.event.IEvent; -import org.apache.wicket.event.IEventSink; - -/** - * A specialization of {@link IEventSink} that adds component as an additional parameter to the - * {@link #onEvent(IEvent, Component)} method. This interface is useful for component plugins which - * wish to participate in event processing, for example {@link Behavior}s - * - * @author igor - */ -public interface IComponentAwareEventSink -{ - /** - * Called when an event is sent to this behavior sink - * - * @param component - * component that owns this sink. For example, if the implementation of this - * interface is a {@link Behavior} then component parameter will contain the - * component to which the behavior is attached. - * @param event - */ - void onEvent(Component component, IEvent event); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket; + +import org.apache.wicket.behavior.Behavior; +import org.apache.wicket.event.IEvent; +import org.apache.wicket.event.IEventSink; + +/** + * A specialization of {@link IEventSink} that adds component as an additional parameter to the + * {@link #onEvent(Component, IEvent)} method. This interface is useful for component plugins which + * wish to participate in event processing, for example {@link Behavior}s + * + * @author igor + */ +public interface IComponentAwareEventSink +{ + /** + * Called when an event is sent to this behavior sink + * + * @param component + * component that owns this sink. For example, if the implementation of this + * interface is a {@link Behavior} then component parameter will contain the + * component to which the behavior is attached. + * @param event + */ + void onEvent(Component component, IEvent event); +} diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/json/JSONWriter.java b/wicket-core/src/main/java/org/apache/wicket/ajax/json/JSONWriter.java index 7762383f723..136370a258d 100755 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/json/JSONWriter.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/json/JSONWriter.java @@ -1,327 +1,327 @@ -package org.apache.wicket.ajax.json; - -import java.io.IOException; -import java.io.Writer; - -/* -Copyright (c) 2006 JSON.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -/** - * JSONWriter provides a quick and convenient way of producing JSON text. - * The texts produced strictly conform to JSON syntax rules. No whitespace is - * added, so the results are ready for transmission or storage. Each instance of - * JSONWriter can produce one JSON text. - *

- * A JSONWriter instance provides a value method for appending - * values to the - * text, and a key - * method for adding keys before values in objects. There are array - * and endArray methods that make and bound array values, and - * object and endObject methods which make and bound - * object values. All of these methods return the JSONWriter instance, - * permitting a cascade style. For example,

- * new JSONWriter(myWriter)
- *     .object()
- *         .key("JSON")
- *         .value("Hello, World!")
- *     .endObject();
which writes
- * {"JSON":"Hello, World!"}
- *

- * The first method called must be array or object. - * There are no methods for adding commas or colons. JSONWriter adds them for - * you. Objects and arrays can be nested up to 20 levels deep. - *

- * This can sometimes be easier than using a JSONObject to build a string. - * @author JSON.org - * @version 2011-11-24 - */ -public class JSONWriter { - private static final int maxdepth = 200; - - /** - * The comma flag determines if a comma should be output before the next - * value. - */ - private boolean comma; - - /** - * The current mode. Values: - * 'a' (array), - * 'd' (done), - * 'i' (initial), - * 'k' (key), - * 'o' (object). - */ - protected char mode; - - /** - * The object/array stack. - */ - private final JSONObject stack[]; - - /** - * The stack top index. A value of 0 indicates that the stack is empty. - */ - private int top; - - /** - * The writer that will receive the output. - */ - protected Writer writer; - - /** - * Make a fresh JSONWriter. It can be used to build one JSON text. - */ - public JSONWriter(Writer w) { - this.comma = false; - this.mode = 'i'; - this.stack = new JSONObject[maxdepth]; - this.top = 0; - this.writer = w; - } - - /** - * Append a value. - * @param string A string value. - * @return this - * @throws JSONException If the value is out of sequence. - */ - private JSONWriter append(String string) throws JSONException { - if (string == null) { - throw new JSONException("Null pointer"); - } - if (this.mode == 'o' || this.mode == 'a') { - try { - if (this.comma && this.mode == 'a') { - this.writer.write(','); - } - this.writer.write(string); - } catch (IOException e) { - throw new JSONException(e); - } - if (this.mode == 'o') { - this.mode = 'k'; - } - this.comma = true; - return this; - } - throw new JSONException("Value out of sequence."); - } - - /** - * Begin appending a new array. All values until the balancing - * endArray will be appended to this array. The - * endArray method must be called to mark the array's end. - * @return this - * @throws JSONException If the nesting is too deep, or if the object is - * started in the wrong place (for example as a key or after the end of the - * outermost array or object). - */ - public JSONWriter array() throws JSONException { - if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') { - this.push(null); - this.append("["); - this.comma = false; - return this; - } - throw new JSONException("Misplaced array."); - } - - /** - * End something. - * @param mode Mode - * @param c Closing character - * @return this - * @throws JSONException If unbalanced. - */ - private JSONWriter end(char mode, char c) throws JSONException { - if (this.mode != mode) { - throw new JSONException(mode == 'a' - ? "Misplaced endArray." - : "Misplaced endObject."); - } - this.pop(mode); - try { - this.writer.write(c); - } catch (IOException e) { - throw new JSONException(e); - } - this.comma = true; - return this; - } - - /** - * End an array. This method most be called to balance calls to - * array. - * @return this - * @throws JSONException If incorrectly nested. - */ - public JSONWriter endArray() throws JSONException { - return this.end('a', ']'); - } - - /** - * End an object. This method most be called to balance calls to - * object. - * @return this - * @throws JSONException If incorrectly nested. - */ - public JSONWriter endObject() throws JSONException { - return this.end('k', '}'); - } - - /** - * Append a key. The key will be associated with the next value. In an - * object, every value must be preceded by a key. - * @param string A key string. - * @return this - * @throws JSONException If the key is out of place. For example, keys - * do not belong in arrays or if the key is null. - */ - public JSONWriter key(String string) throws JSONException { - if (string == null) { - throw new JSONException("Null key."); - } - if (this.mode == 'k') { - try { - this.stack[this.top - 1].putOnce(string, Boolean.TRUE); - if (this.comma) { - this.writer.write(','); - } - this.writer.write(JSONObject.quote(string)); - this.writer.write(':'); - this.comma = false; - this.mode = 'o'; - return this; - } catch (IOException e) { - throw new JSONException(e); - } - } - throw new JSONException("Misplaced key."); - } - - - /** - * Begin appending a new object. All keys and values until the balancing - * endObject will be appended to this object. The - * endObject method must be called to mark the object's end. - * @return this - * @throws JSONException If the nesting is too deep, or if the object is - * started in the wrong place (for example as a key or after the end of the - * outermost array or object). - */ - public JSONWriter object() throws JSONException { - if (this.mode == 'i') { - this.mode = 'o'; - } - if (this.mode == 'o' || this.mode == 'a') { - this.append("{"); - this.push(new JSONObject()); - this.comma = false; - return this; - } - throw new JSONException("Misplaced object."); - - } - - - /** - * Pop an array or object scope. - * @param c The scope to close. - * @throws JSONException If nesting is wrong. - */ - private void pop(char c) throws JSONException { - if (this.top <= 0) { - throw new JSONException("Nesting error."); - } - char m = this.stack[this.top - 1] == null ? 'a' : 'k'; - if (m != c) { - throw new JSONException("Nesting error."); - } - this.top -= 1; - this.mode = this.top == 0 - ? 'd' - : this.stack[this.top - 1] == null - ? 'a' - : 'k'; - } - - /** - * Push an array or object scope. - * @param c The scope to open. - * @throws JSONException If nesting is too deep. - */ - private void push(JSONObject jo) throws JSONException { - if (this.top >= maxdepth) { - throw new JSONException("Nesting too deep."); - } - this.stack[this.top] = jo; - this.mode = jo == null ? 'a' : 'k'; - this.top += 1; - } - - - /** - * Append either the value true or the value - * false. - * @param b A boolean. - * @return this - * @throws JSONException - */ - public JSONWriter value(boolean b) throws JSONException { - return this.append(b ? "true" : "false"); - } - - /** - * Append a double value. - * @param d A double. - * @return this - * @throws JSONException If the number is not finite. - */ - public JSONWriter value(double d) throws JSONException { - return this.value(new Double(d)); - } - - /** - * Append a long value. - * @param l A long. - * @return this - * @throws JSONException - */ - public JSONWriter value(long l) throws JSONException { - return this.append(Long.toString(l)); - } - - - /** - * Append an object value. - * @param object The object to append. It can be null, or a Boolean, Number, - * String, JSONObject, or JSONArray, or an object that implements JSONString. - * @return this - * @throws JSONException If the value is out of sequence. - */ - public JSONWriter value(Object object) throws JSONException { - return this.append(JSONObject.valueToString(object)); - } -} +package org.apache.wicket.ajax.json; + +import java.io.IOException; +import java.io.Writer; + +/* +Copyright (c) 2006 JSON.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/** + * JSONWriter provides a quick and convenient way of producing JSON text. + * The texts produced strictly conform to JSON syntax rules. No whitespace is + * added, so the results are ready for transmission or storage. Each instance of + * JSONWriter can produce one JSON text. + *

+ * A JSONWriter instance provides a value method for appending + * values to the + * text, and a key + * method for adding keys before values in objects. There are array + * and endArray methods that make and bound array values, and + * object and endObject methods which make and bound + * object values. All of these methods return the JSONWriter instance, + * permitting a cascade style. For example,

+ * new JSONWriter(myWriter)
+ *     .object()
+ *         .key("JSON")
+ *         .value("Hello, World!")
+ *     .endObject();
which writes
+ * {"JSON":"Hello, World!"}
+ *

+ * The first method called must be array or object. + * There are no methods for adding commas or colons. JSONWriter adds them for + * you. Objects and arrays can be nested up to 20 levels deep. + *

+ * This can sometimes be easier than using a JSONObject to build a string. + * @author JSON.org + * @version 2011-11-24 + */ +public class JSONWriter { + private static final int maxdepth = 200; + + /** + * The comma flag determines if a comma should be output before the next + * value. + */ + private boolean comma; + + /** + * The current mode. Values: + * 'a' (array), + * 'd' (done), + * 'i' (initial), + * 'k' (key), + * 'o' (object). + */ + protected char mode; + + /** + * The object/array stack. + */ + private final JSONObject stack[]; + + /** + * The stack top index. A value of 0 indicates that the stack is empty. + */ + private int top; + + /** + * The writer that will receive the output. + */ + protected Writer writer; + + /** + * Make a fresh JSONWriter. It can be used to build one JSON text. + */ + public JSONWriter(Writer w) { + this.comma = false; + this.mode = 'i'; + this.stack = new JSONObject[maxdepth]; + this.top = 0; + this.writer = w; + } + + /** + * Append a value. + * @param string A string value. + * @return this + * @throws JSONException If the value is out of sequence. + */ + private JSONWriter append(String string) throws JSONException { + if (string == null) { + throw new JSONException("Null pointer"); + } + if (this.mode == 'o' || this.mode == 'a') { + try { + if (this.comma && this.mode == 'a') { + this.writer.write(','); + } + this.writer.write(string); + } catch (IOException e) { + throw new JSONException(e); + } + if (this.mode == 'o') { + this.mode = 'k'; + } + this.comma = true; + return this; + } + throw new JSONException("Value out of sequence."); + } + + /** + * Begin appending a new array. All values until the balancing + * endArray will be appended to this array. The + * endArray method must be called to mark the array's end. + * @return this + * @throws JSONException If the nesting is too deep, or if the object is + * started in the wrong place (for example as a key or after the end of the + * outermost array or object). + */ + public JSONWriter array() throws JSONException { + if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') { + this.push(null); + this.append("["); + this.comma = false; + return this; + } + throw new JSONException("Misplaced array."); + } + + /** + * End something. + * @param mode Mode + * @param c Closing character + * @return this + * @throws JSONException If unbalanced. + */ + private JSONWriter end(char mode, char c) throws JSONException { + if (this.mode != mode) { + throw new JSONException(mode == 'a' + ? "Misplaced endArray." + : "Misplaced endObject."); + } + this.pop(mode); + try { + this.writer.write(c); + } catch (IOException e) { + throw new JSONException(e); + } + this.comma = true; + return this; + } + + /** + * End an array. This method most be called to balance calls to + * array. + * @return this + * @throws JSONException If incorrectly nested. + */ + public JSONWriter endArray() throws JSONException { + return this.end('a', ']'); + } + + /** + * End an object. This method most be called to balance calls to + * object. + * @return this + * @throws JSONException If incorrectly nested. + */ + public JSONWriter endObject() throws JSONException { + return this.end('k', '}'); + } + + /** + * Append a key. The key will be associated with the next value. In an + * object, every value must be preceded by a key. + * @param string A key string. + * @return this + * @throws JSONException If the key is out of place. For example, keys + * do not belong in arrays or if the key is null. + */ + public JSONWriter key(String string) throws JSONException { + if (string == null) { + throw new JSONException("Null key."); + } + if (this.mode == 'k') { + try { + this.stack[this.top - 1].putOnce(string, Boolean.TRUE); + if (this.comma) { + this.writer.write(','); + } + this.writer.write(JSONObject.quote(string)); + this.writer.write(':'); + this.comma = false; + this.mode = 'o'; + return this; + } catch (IOException e) { + throw new JSONException(e); + } + } + throw new JSONException("Misplaced key."); + } + + + /** + * Begin appending a new object. All keys and values until the balancing + * endObject will be appended to this object. The + * endObject method must be called to mark the object's end. + * @return this + * @throws JSONException If the nesting is too deep, or if the object is + * started in the wrong place (for example as a key or after the end of the + * outermost array or object). + */ + public JSONWriter object() throws JSONException { + if (this.mode == 'i') { + this.mode = 'o'; + } + if (this.mode == 'o' || this.mode == 'a') { + this.append("{"); + this.push(new JSONObject()); + this.comma = false; + return this; + } + throw new JSONException("Misplaced object."); + + } + + + /** + * Pop an array or object scope. + * @param c The scope to close. + * @throws JSONException If nesting is wrong. + */ + private void pop(char c) throws JSONException { + if (this.top <= 0) { + throw new JSONException("Nesting error."); + } + char m = this.stack[this.top - 1] == null ? 'a' : 'k'; + if (m != c) { + throw new JSONException("Nesting error."); + } + this.top -= 1; + this.mode = this.top == 0 + ? 'd' + : this.stack[this.top - 1] == null + ? 'a' + : 'k'; + } + + /** + * Push an array or object scope. + * @param jo the JSON object + * @throws JSONException If nesting is too deep. + */ + private void push(JSONObject jo) throws JSONException { + if (this.top >= maxdepth) { + throw new JSONException("Nesting too deep."); + } + this.stack[this.top] = jo; + this.mode = jo == null ? 'a' : 'k'; + this.top += 1; + } + + + /** + * Append either the value true or the value + * false. + * @param b A boolean. + * @return this + * @throws JSONException + */ + public JSONWriter value(boolean b) throws JSONException { + return this.append(b ? "true" : "false"); + } + + /** + * Append a double value. + * @param d A double. + * @return this + * @throws JSONException If the number is not finite. + */ + public JSONWriter value(double d) throws JSONException { + return this.value(new Double(d)); + } + + /** + * Append a long value. + * @param l A long. + * @return this + * @throws JSONException + */ + public JSONWriter value(long l) throws JSONException { + return this.append(Long.toString(l)); + } + + + /** + * Append an object value. + * @param object The object to append. It can be null, or a Boolean, Number, + * String, JSONObject, or JSONArray, or an object that implements JSONString. + * @return this + * @throws JSONException If the value is out of sequence. + */ + public JSONWriter value(Object object) throws JSONException { + return this.append(JSONObject.valueToString(object)); + } +} diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java index 5b6ef553273..3618050830c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPageProvider.java @@ -38,8 +38,9 @@ public interface IPageProvider * @throws StalePageException * if render count has been specified in constructor and the render count of page * does not match the value - * @throws {@link PageExpiredException} if the specified page could not have been found and the - * constructor used did not provide enough information to create new page instance + * @throws {@link org.apache.wicket.protocol.http.PageExpiredException} if the specified page + * could not have been found and the constructor used did not provide enough information + * to create new page instance */ IRequestablePage getPageInstance(); diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java index f4230c2c710..a2723b3af58 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/PageAndComponentProvider.java @@ -149,7 +149,7 @@ public PageAndComponentProvider(IRequestablePage page, IRequestableComponent com } /** - * @see org.apache.wicket.request.handler.IPageAndComponentProvider#getComponent() + * @see org.apache.wicket.core.request.handler.IPageAndComponentProvider#getComponent() */ @Override public IRequestableComponent getComponent() @@ -186,7 +186,7 @@ public IRequestableComponent getComponent() } /** - * @see org.apache.wicket.request.handler.IPageAndComponentProvider#getComponentPath() + * @see org.apache.wicket.core.request.handler.IPageAndComponentProvider#getComponentPath() */ @Override public String getComponentPath() diff --git a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/PackageMapper.java b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/PackageMapper.java index 37b9166d5f0..54729e901c6 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/PackageMapper.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/PackageMapper.java @@ -96,7 +96,7 @@ public PackageMapper(final PackageName packageName, } /** - * @see org.apache.wicket.request.mapper.AbstractBookmarkableMapper#buildUrl(org.apache.wicket.request.mapper.AbstractBookmarkableMapper.UrlInfo) + * @see org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper#buildUrl(UrlInfo) */ @Override protected Url buildUrl(UrlInfo info) @@ -124,7 +124,7 @@ protected Url buildUrl(UrlInfo info) } /** - * @see org.apache.wicket.request.mapper.AbstractBookmarkableMapper#parseRequest(org.apache.wicket.request.Request) + * @see org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper#parseRequest(org.apache.wicket.request.Request) */ @Override protected UrlInfo parseRequest(Request request) @@ -211,7 +211,7 @@ protected String transformForUrl(final String className) } /** - * @see org.apache.wicket.request.mapper.AbstractBookmarkableMapper#pageMustHaveBeenCreatedBookmarkable() + * @see org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper#pageMustHaveBeenCreatedBookmarkable() */ @Override protected boolean pageMustHaveBeenCreatedBookmarkable() @@ -220,7 +220,7 @@ protected boolean pageMustHaveBeenCreatedBookmarkable() } /** - * @see org.apache.wicket.request.mapper.AbstractBookmarkableMapper#getCompatibilityScore(org.apache.wicket.request.Request) + * @see org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper#getCompatibilityScore(org.apache.wicket.request.Request) */ @Override public int getCompatibilityScore(Request request) diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/resource/locator/OsgiResourceStreamLocator.java b/wicket-core/src/main/java/org/apache/wicket/core/util/resource/locator/OsgiResourceStreamLocator.java index 9037c8a28f4..8f1ae206ba4 100644 --- a/wicket-core/src/main/java/org/apache/wicket/core/util/resource/locator/OsgiResourceStreamLocator.java +++ b/wicket-core/src/main/java/org/apache/wicket/core/util/resource/locator/OsgiResourceStreamLocator.java @@ -45,7 +45,7 @@ public OsgiResourceStreamLocator(final IResourceFinder finder) /** * - * @see org.apache.wicket.util.resource.locator.ResourceStreamLocator#locate(java.lang.Class, + * @see org.apache.wicket.core.util.resource.locator.ResourceStreamLocator#locate(java.lang.Class, * java.lang.String) */ @Override diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java index af5f0f3fb4a..37bdd23dd82 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/Border.java @@ -127,8 +127,8 @@ * Other methods like {@link #remove()}, {@link #get(int)}, {@link #iterator()}, etc. are not * aliased to work on the border's body and attention must be paid when they need to be used. * - * @see PanelBorder An alternative implementation based on Panel - * @see BorderBehavior A behavior which add (raw) markup before and after the component + * @see BorderPanel An alternative implementation based on Panel + * @see BorderBehavior A behavior which adds (raw) markup before and after the component * * @author Jonathan Locke * @author Juergen Donnerstag diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderPanel.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderPanel.java index 57600fe6cef..c194333c783 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderPanel.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/border/BorderPanel.java @@ -1,131 +1,131 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.markup.html.border; - -import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy; -import org.apache.wicket.model.IModel; - -/** - * Whereas a Panel replaces the body markup with the associated markup file, a BorderPanel assumes a - * that Body component renders the body markup including any number of Wicket Components. - *

- * Example: - * - *

- * MyPage.html
- * ...
- * <div wicket:id="myPanel">
- *   ...
- *   <div wicket:id="componentInBody"/>
- *   ...
- * </div>
- * 
- * MyPage.java
- * ...
- * public MyPage extends WebPage {
- *   ...
- *   public MyPage() { 
- *     ...
- *     MyPanel border = new MyPanel("myPanel");
- *     add(border);
- *     border.getBodyContainer().add(new MyComponent("componentInBody"));
- *     ...
- *   }
- *   ...
- * }
- * 
- * MyPanel.java
- * ...
- * public MyPanel extends BorderPanel {
- *   ...
- *   public MyPanel(final String id) {
- *     super(id);
- *     ...
- *     add(newBodyContainer("body"));
- *     ...
- *   }
- * }
- * 
- * - * @see BorderBehavior A behavior which add (raw) markup before and after the component - * - * @author Juergen Donnerstag - */ -public abstract class BorderPanel extends Panel -{ - private static final long serialVersionUID = 1L; - - private Body body; - - /** - * @see org.apache.wicket.Component#Component(String) - */ - public BorderPanel(final String id) - { - this(id, null); - } - - /** - * @see org.apache.wicket.Component#Component(String, IModel) - */ - public BorderPanel(final String id, final IModel model) - { - super(id, model); - } - - @Override - protected IMarkupSourcingStrategy newMarkupSourcingStrategy() - { - return new PanelMarkupSourcingStrategy(true); - } - - /** - * Sets the body container - * - * @param body - * @return The body component - */ - public final Body setBodyContainer(final Body body) - { - this.body = body; - return body; - } - - /** - * Provide easy access to the Body component. - * - * @return The body container - */ - public final Body getBodyContainer() - { - return body; - } - - /** - * Create a new body container identified by id in the panel's markup - * - * @param id - * @return Body component - */ - public final Body newBodyContainer(final String id) - { - body = new Body(id, this); - return body; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.markup.html.border; + +import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy; +import org.apache.wicket.model.IModel; + +/** + * Whereas a Panel replaces the body markup with the associated markup file, a BorderPanel assumes a + * that Body component renders the body markup including any number of Wicket Components. + *

+ * Example: + * + *

+ * MyPage.html
+ * ...
+ * <div wicket:id="myPanel">
+ *   ...
+ *   <div wicket:id="componentInBody"/>
+ *   ...
+ * </div>
+ * 
+ * MyPage.java
+ * ...
+ * public MyPage extends WebPage {
+ *   ...
+ *   public MyPage() { 
+ *     ...
+ *     MyPanel border = new MyPanel("myPanel");
+ *     add(border);
+ *     border.getBodyContainer().add(new MyComponent("componentInBody"));
+ *     ...
+ *   }
+ *   ...
+ * }
+ * 
+ * MyPanel.java
+ * ...
+ * public MyPanel extends BorderPanel {
+ *   ...
+ *   public MyPanel(final String id) {
+ *     super(id);
+ *     ...
+ *     add(newBodyContainer("body"));
+ *     ...
+ *   }
+ * }
+ * 
+ * + * @see BorderBehavior A behavior which adds (raw) markup before and after the component + * + * @author Juergen Donnerstag + */ +public abstract class BorderPanel extends Panel +{ + private static final long serialVersionUID = 1L; + + private Body body; + + /** + * @see org.apache.wicket.Component#Component(String) + */ + public BorderPanel(final String id) + { + this(id, null); + } + + /** + * @see org.apache.wicket.Component#Component(String, IModel) + */ + public BorderPanel(final String id, final IModel model) + { + super(id, model); + } + + @Override + protected IMarkupSourcingStrategy newMarkupSourcingStrategy() + { + return new PanelMarkupSourcingStrategy(true); + } + + /** + * Sets the body container + * + * @param body + * @return The body component + */ + public final Body setBodyContainer(final Body body) + { + this.body = body; + return body; + } + + /** + * Provide easy access to the Body component. + * + * @return The body container + */ + public final Body getBodyContainer() + { + return body; + } + + /** + * Create a new body container identified by id in the panel's markup + * + * @param id + * @return Body component + */ + public final Body newBodyContainer(final String id) + { + body = new Body(id, this); + return body; + } +} diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RangeTextField.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RangeTextField.java index deaabcb14e8..4f3b023c743 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RangeTextField.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/RangeTextField.java @@ -22,8 +22,8 @@ * A {@link TextField} for HTML5 <input> with type range. * *

- * Automatically validates the input against the configured {@link #setMinimum(Double) min} and - * {@link #setMaximum(Double) max} attributes. If any of them is null then + * Automatically validates the input against the configured {@link #setMinimum(Number)} min} and + * {@link #setMaximum(Number)} max} attributes. If any of them is null then * {@link Double#MIN_VALUE} and {@link Double#MAX_VALUE} are used respectfully. * * @param diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/resource/DefaultButtonImageResource.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/resource/DefaultButtonImageResource.java index a53a9105c0e..b39331ff64a 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/resource/DefaultButtonImageResource.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/resource/DefaultButtonImageResource.java @@ -229,7 +229,7 @@ public synchronized void setTextColor(Color textColor) /** * Renders button image. * - * @see RenderedDynamicImageResource#render(Graphics2D) + * @see RenderedDynamicImageResource#render(java.awt.Graphics2D, Attributes) */ @Override protected boolean render(Graphics2D graphics, Attributes attributes) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java index 1a64941c125..3f5452b16ad 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java @@ -34,7 +34,7 @@ *

* This page uses a form post right after the page has loaded in the browser, using JavaScript or * alternative means to detect and pass on settings to the embedded form. The form submit method - * updates this session's {@link org.apache.wicket.request.ClientInfo} object and then redirects to + * updates this session's {@link org.apache.wicket.core.request.ClientInfo} object and then redirects to * the original location as was passed in as a URL argument in the constructor. *

*

diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/EmptyDataProvider.java b/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/EmptyDataProvider.java index 29ba0575568..eac95b273eb 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/EmptyDataProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/EmptyDataProvider.java @@ -46,7 +46,7 @@ public static EmptyDataProvider getInstance() } /** - * @see IDataProvider#iterator(int, int) + * @see IDataProvider#iterator(long, long) */ @Override public Iterator iterator(long first, long count) diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/IDataProvider.java b/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/IDataProvider.java index 870afc97a41..c98938d611e 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/IDataProvider.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/repeater/data/IDataProvider.java @@ -84,7 +84,7 @@ public interface IDataProvider extends IDetachable /** * Callback used by the consumer of this data provider to wrap objects retrieved from - * {@link #iterator(int, int)} with a model (usually a detachable one). + * {@link #iterator(long, long)} with a model (usually a detachable one). * * @param object * the object that needs to be wrapped diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/IPageStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/IPageStore.java index 5953e646f42..5fe3cf6d585 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/IPageStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/IPageStore.java @@ -90,8 +90,6 @@ public interface IPageStore * This method should restore the serialized page to intermediate object that can be converted * to real page instance using {@link #convertToPage(Object)}. * - * @param sessionId - * The session of the page that must be removed * @param serializable * @return Page */ diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/memory/HttpSessionDataStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/memory/HttpSessionDataStore.java index ffcf6438688..39907d3cf31 100644 --- a/wicket-core/src/main/java/org/apache/wicket/pageStore/memory/HttpSessionDataStore.java +++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/memory/HttpSessionDataStore.java @@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory; /** - * A {@link DataStore} which stores the pages in the {@link HttpSession}. Uses + * A {@link IDataStore} which stores the pages in the {@link HttpSession}. Uses * {@link IDataStoreEvictionStrategy} to keep the memory footprint reasonable. * *

diff --git a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java index c8563132c83..04349136120 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/cycle/RequestCycleListenerCollection.java @@ -1,213 +1,213 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket.request.cycle; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.wicket.request.IRequestHandler; -import org.apache.wicket.request.Url; -import org.apache.wicket.util.listener.ListenerCollection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Composite {@link IRequestCycleListener} that notifies all registered listeners with each - * IRequestCycleListener event. - *

- *

Order of notification

- *

- * {@link #onBeginRequest(RequestCycle)}, {@link #onRequestHandlerScheduled(IRequestHandler)} and - * {@link #onRequestHandlerResolved(IRequestHandler)} are notified in first in, first out order. - *

- * {@link #onEndRequest(RequestCycle)} and {@link #onDetach(RequestCycle)} are notified in last in - * first out order (i.e. reversed order). So for these events the collection functions as a stack. - *

- *

Exception handling

- *

- * The {@code RequestCycleListenerCollection} will use the first exception handler that is returned - * from all listeners in {@link #onException(RequestCycle, Exception)} - */ -public class RequestCycleListenerCollection extends ListenerCollection - implements - IRequestCycleListener -{ - private static final Logger logger = LoggerFactory.getLogger(RequestCycleListenerCollection.class); - private static final long serialVersionUID = 1L; - - /** - * Notifies all registered listeners of the onBeginRequest event in first in first out order, - * i.e. the listener that is the first element of this collection is the first listener to be - * notified of {@code onBeginRequest}. - */ - @Override - public void onBeginRequest(final RequestCycle cycle) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onBeginRequest(cycle); - } - }); - } - - /** - * Notifies all registered listeners of the {@code onEndRequest} event in first in last out - * order (i.e. the last listener that received an {@code #onBeginRequest} will be the first to - * get notified of an {@code onEndRequest}. - * - * @see IRequestCycleListener#onEndRequest(RequestCycle) - */ - @Override - public void onEndRequest(final RequestCycle cycle) - { - reversedNotify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onEndRequest(cycle); - } - }); - } - - /** - * Notifies all registered listeners of the {@code onDetach} event in first in last out order - * (i.e. the last listener that received an {@code #onBeginRequest} will be the first to get - * notified of an {@code onDetach}. - * - * @see IRequestCycleListener#onDetach(RequestCycle) - */ - @Override - public void onDetach(final RequestCycle cycle) - { - reversedNotifyIgnoringExceptions(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onDetach(cycle); - } - }); - } - - /** - * Notifies all registered listeners of the exception and calls the first handler that was - * returned by the listeners. - * - * @see IRequestCycleListener#onException(RequestCycle, Exception) - */ - @Override - public IRequestHandler onException(final RequestCycle cycle, final Exception ex) - { - final List handlers = new ArrayList(); - - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - IRequestHandler handler = listener.onException(cycle, ex); - if (handler != null) - { - handlers.add(handler); - } - } - }); - - if (handlers.isEmpty()) - { - return null; - } - if (handlers.size() > 1) - { - logger.debug( - "{} exception handlers available for exception {}, using the first handler", - handlers.size(), ex); - } - return handlers.get(0); - } - - @Override - public void onRequestHandlerResolved(final RequestCycle cycle, final IRequestHandler handler) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onRequestHandlerResolved(cycle, handler); - } - }); - } - - @Override - public void onExceptionRequestHandlerResolved(final RequestCycle cycle, - final IRequestHandler handler, final Exception exception) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onExceptionRequestHandlerResolved(cycle, handler, exception); - } - }); - } - - @Override - public void onRequestHandlerScheduled(final RequestCycle cycle, final IRequestHandler handler) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onRequestHandlerScheduled(cycle, handler); - } - }); - } - - @Override - public void onRequestHandlerExecuted(final RequestCycle cycle, final IRequestHandler handler) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onRequestHandlerExecuted(cycle, handler); - } - }); - } - - @Override - public void onUrlMapped(final RequestCycle cycle, final IRequestHandler handler, final Url url) - { - notify(new INotifier() - { - @Override - public void notify(IRequestCycleListener listener) - { - listener.onUrlMapped(cycle, handler, url); - } - }); - - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket.request.cycle; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.wicket.request.IRequestHandler; +import org.apache.wicket.request.Url; +import org.apache.wicket.util.listener.ListenerCollection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Composite {@link IRequestCycleListener} that notifies all registered listeners with each + * IRequestCycleListener event. + *

+ *

Order of notification

+ *

+ * {@link #onBeginRequest(RequestCycle)}, {@link #onRequestHandlerScheduled(RequestCycle, IRequestHandler)} and + * {@link #onRequestHandlerResolved(RequestCycle, IRequestHandler)} are notified in first in, first out order. + *

+ * {@link #onEndRequest(RequestCycle)} and {@link #onDetach(RequestCycle)} are notified in last in + * first out order (i.e. reversed order). So for these events the collection functions as a stack. + *

+ *

Exception handling

+ *

+ * The {@code RequestCycleListenerCollection} will use the first exception handler that is returned + * from all listeners in {@link #onException(RequestCycle, Exception)} + */ +public class RequestCycleListenerCollection extends ListenerCollection + implements + IRequestCycleListener +{ + private static final Logger logger = LoggerFactory.getLogger(RequestCycleListenerCollection.class); + private static final long serialVersionUID = 1L; + + /** + * Notifies all registered listeners of the onBeginRequest event in first in first out order, + * i.e. the listener that is the first element of this collection is the first listener to be + * notified of {@code onBeginRequest}. + */ + @Override + public void onBeginRequest(final RequestCycle cycle) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onBeginRequest(cycle); + } + }); + } + + /** + * Notifies all registered listeners of the {@code onEndRequest} event in first in last out + * order (i.e. the last listener that received an {@code #onBeginRequest} will be the first to + * get notified of an {@code onEndRequest}. + * + * @see IRequestCycleListener#onEndRequest(RequestCycle) + */ + @Override + public void onEndRequest(final RequestCycle cycle) + { + reversedNotify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onEndRequest(cycle); + } + }); + } + + /** + * Notifies all registered listeners of the {@code onDetach} event in first in last out order + * (i.e. the last listener that received an {@code #onBeginRequest} will be the first to get + * notified of an {@code onDetach}. + * + * @see IRequestCycleListener#onDetach(RequestCycle) + */ + @Override + public void onDetach(final RequestCycle cycle) + { + reversedNotifyIgnoringExceptions(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onDetach(cycle); + } + }); + } + + /** + * Notifies all registered listeners of the exception and calls the first handler that was + * returned by the listeners. + * + * @see IRequestCycleListener#onException(RequestCycle, Exception) + */ + @Override + public IRequestHandler onException(final RequestCycle cycle, final Exception ex) + { + final List handlers = new ArrayList(); + + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + IRequestHandler handler = listener.onException(cycle, ex); + if (handler != null) + { + handlers.add(handler); + } + } + }); + + if (handlers.isEmpty()) + { + return null; + } + if (handlers.size() > 1) + { + logger.debug( + "{} exception handlers available for exception {}, using the first handler", + handlers.size(), ex); + } + return handlers.get(0); + } + + @Override + public void onRequestHandlerResolved(final RequestCycle cycle, final IRequestHandler handler) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onRequestHandlerResolved(cycle, handler); + } + }); + } + + @Override + public void onExceptionRequestHandlerResolved(final RequestCycle cycle, + final IRequestHandler handler, final Exception exception) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onExceptionRequestHandlerResolved(cycle, handler, exception); + } + }); + } + + @Override + public void onRequestHandlerScheduled(final RequestCycle cycle, final IRequestHandler handler) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onRequestHandlerScheduled(cycle, handler); + } + }); + } + + @Override + public void onRequestHandlerExecuted(final RequestCycle cycle, final IRequestHandler handler) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onRequestHandlerExecuted(cycle, handler); + } + }); + } + + @Override + public void onUrlMapped(final RequestCycle cycle, final IRequestHandler handler, final Url url) + { + notify(new INotifier() + { + @Override + public void notify(IRequestCycleListener listener) + { + listener.onUrlMapped(cycle, handler, url); + } + }); + + } +} diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/loader/ClassStringResourceLoader.java b/wicket-core/src/main/java/org/apache/wicket/resource/loader/ClassStringResourceLoader.java index 6e24c096ff2..57fb235ce13 100644 --- a/wicket-core/src/main/java/org/apache/wicket/resource/loader/ClassStringResourceLoader.java +++ b/wicket-core/src/main/java/org/apache/wicket/resource/loader/ClassStringResourceLoader.java @@ -67,7 +67,7 @@ public String loadStringResource(final Class clazz, final String key, final L /** * @see org.apache.wicket.resource.loader.ComponentStringResourceLoader#loadStringResource(org.apache.wicket.Component, - * java.lang.String, java.util.Locale, java.lang.String) + * String, java.util.Locale, String, String) */ @Override public String loadStringResource(final Component component, final String key, diff --git a/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplate.java b/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplate.java index f35d0c65299..2b4b5e3707c 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplate.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/template/TextTemplate.java @@ -75,7 +75,7 @@ public String asString(Map variables) } /** - * @see org.apache.wicket.util.resource.AbstractResourceStream#asString() + * @see org.apache.wicket.util.resource.AbstractStringResourceStream#asString() */ @Override public String asString()