mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Fix wrong closing HTML tags in javadoc comments
This commit is contained in:
@@ -3,7 +3,7 @@ package com.opensymphony.xwork2.conversion;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Used to process <clazz>-conversion.properties file to read defined Converters
|
||||
* Used to process <clazz>-conversion.properties file to read defined Converters
|
||||
*/
|
||||
public interface ConversionFileProcessor {
|
||||
|
||||
|
||||
@@ -18,8 +18,9 @@ package com.opensymphony.xwork2.conversion;
|
||||
/**
|
||||
* Determines what the key and and element class of a Map or Collection should be. For Maps, the elements are the
|
||||
* values. For Collections, the elements are the elements of the collection.
|
||||
* <p/>
|
||||
* <p>
|
||||
* See the implementations for javadoc description for the methods as they are dependent on the concrete implementation.
|
||||
* </p>
|
||||
*
|
||||
* @author Gabriel Zimmerman
|
||||
*/
|
||||
|
||||
@@ -25,13 +25,15 @@ import java.lang.annotation.Target;
|
||||
* A marker annotation for type conversions at Type level.
|
||||
* <!-- END SNIPPET: description -->
|
||||
*
|
||||
* <p/> <u>Annotation usage:</u>
|
||||
* <p>
|
||||
* <u>Annotation usage:</u>
|
||||
* </p>
|
||||
*
|
||||
* <!-- START SNIPPET: usage -->
|
||||
* The Conversion annotation must be applied at Type level.
|
||||
* <!-- END SNIPPET: usage -->
|
||||
*
|
||||
* <p/> <u>Annotation parameters:</u>
|
||||
* <p> <u>Annotation parameters:</u> </p>
|
||||
*
|
||||
* <!-- START SNIPPET: parameters -->
|
||||
* <table>
|
||||
@@ -54,7 +56,7 @@ import java.lang.annotation.Target;
|
||||
* </table>
|
||||
* <!-- END SNIPPET: parameters -->
|
||||
*
|
||||
* <p/> <u>Example code:</u>
|
||||
* <p> <u>Example code:</u> </p>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
|
||||
+8
-6
@@ -22,27 +22,29 @@ import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
* <p/>This annotation is used for class and application wide conversion rules.
|
||||
* <p>This annotation is used for class and application wide conversion rules.</p>
|
||||
*
|
||||
* <p>
|
||||
* Class wide conversion:<br/>
|
||||
* The conversion rules will be assembled in a file called <code>XXXAction-conversion.properties</code>
|
||||
* within the same package as the related action class.
|
||||
* Set type to: <code>type = ConversionType.CLASS</code>
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Allication wide conversion:<br/>
|
||||
* Application wide conversion:<br/>
|
||||
* The conversion rules will be assembled within the <code>xwork-conversion.properties</code> file within the classpath root.
|
||||
* Set type to: <code>type = ConversionType.APPLICATION</code>
|
||||
* <p/>
|
||||
* </p>
|
||||
* <!-- END SNIPPET: description -->
|
||||
*
|
||||
* <p/> <u>Annotation usage:</u>
|
||||
* <p> <u>Annotation usage:</u></p>
|
||||
*
|
||||
* <!-- START SNIPPET: usage -->
|
||||
* The TypeConversion annotation can be applied at property and method level.
|
||||
* <!-- END SNIPPET: usage -->
|
||||
*
|
||||
* <p/> <u>Annotation parameters:</u>
|
||||
* <p> <u>Annotation parameters:</u></p>
|
||||
*
|
||||
* <!-- START SNIPPET: parameters -->
|
||||
* <table>
|
||||
@@ -90,7 +92,7 @@ import java.lang.annotation.Target;
|
||||
*
|
||||
* <!-- END SNIPPET: parameters -->
|
||||
*
|
||||
* <p/> <u>Example code:</u>
|
||||
* <p> <u>Example code:</u></p>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ import java.util.Map;
|
||||
* Maps, both the key and the value may be specified by using the pattern <b>Key_xxx</b> and <b>Element_xxx</b>,
|
||||
* respectively.
|
||||
*
|
||||
* <p/> From WebWork 2.1.x, the <b>Collection_xxx</b> format is still supported and honored, although it is deprecated
|
||||
* and will be removed eventually.
|
||||
* <p> From WebWork 2.1.x, the <b>Collection_xxx</b> format is still supported and honored, although it is deprecated
|
||||
* and will be removed eventually.</p>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class DefaultTypeConverterHolder implements TypeConverterHolder {
|
||||
/**
|
||||
* Record classes that doesn't have conversion mapping defined.
|
||||
* <pre>
|
||||
* - String -> classname as String
|
||||
* - String -> classname as String
|
||||
* </pre>
|
||||
*/
|
||||
protected HashSet<String> unknownMappings = new HashSet<>(); // non-action (eg. returned value)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import java.util.*;
|
||||
* that have caused a NullPointerException will be temporarily stopped for evaluation while the system automatically
|
||||
* tries to solve the null references by automatically creating the object.
|
||||
*
|
||||
* <p/> The following rules are used when handling null references:
|
||||
* <p> The following rules are used when handling null references:</p>
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
|
||||
@@ -30,10 +30,11 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p/>
|
||||
* <p>
|
||||
* XWork will automatically handle the most common type conversion for you. This includes support for converting to
|
||||
* and from Strings for each of the following:
|
||||
* <p/>
|
||||
* </p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>String</li>
|
||||
* <li>boolean / Boolean</li>
|
||||
@@ -44,9 +45,12 @@ import java.util.Map;
|
||||
* <li>collections - if not object type can be determined, it is assumed to be a String and a new ArrayList is
|
||||
* created</li>
|
||||
* </ul>
|
||||
* <p/> Note that with arrays the type conversion will defer to the type of the array elements and try to convert each
|
||||
*
|
||||
* <p> Note that with arrays the type conversion will defer to the type of the array elements and try to convert each
|
||||
* item individually. As with any other type conversion, if the conversion can't be performed the standard type
|
||||
* conversion error reporting is used to indicate a problem occurred while processing the type conversion.
|
||||
* </p>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* @author <a href="mailto:plightbo@gmail.com">Pat Lightbody</a>
|
||||
|
||||
@@ -40,74 +40,85 @@ import java.util.regex.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* XWorkConverter is a singleton used by many of the Struts 2's Ognl extention points,
|
||||
* <p>
|
||||
* XWorkConverter is a singleton used by many of the Struts 2's Ognl extension points,
|
||||
* such as InstantiatingNullHandler, XWorkListPropertyAccessor etc to do object
|
||||
* conversion.
|
||||
* <p/>
|
||||
* </p>
|
||||
*
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p/>
|
||||
*
|
||||
* <p>
|
||||
* Type conversion is great for situations where you need to turn a String in to a more complex object. Because the web
|
||||
* is type-agnostic (everything is a string in HTTP), Struts 2's type conversion features are very useful. For instance,
|
||||
* if you were prompting a user to enter in coordinates in the form of a string (such as "3, 22"), you could have
|
||||
* Struts 2 do the conversion both from String to Point and from Point to String.
|
||||
* <p/>
|
||||
* <p/> Using this "point" example, if your action (or another compound object in which you are setting properties on)
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Using this "point" example, if your action (or another compound object in which you are setting properties on)
|
||||
* has a corresponding ClassName-conversion.properties file, Struts 2 will use the configured type converters for
|
||||
* conversion to and from strings. So turning "3, 22" in to new Point(3, 22) is done by merely adding the following
|
||||
* entry to <b>ClassName-conversion.properties</b> (Note that the PointConverter should impl the TypeConverter
|
||||
* interface):
|
||||
* <p/>
|
||||
* <p/><b>point = com.acme.PointConverter</b>
|
||||
* <p/>
|
||||
* <p/> Your type converter should be sure to check what class type it is being requested to convert. Because it is used
|
||||
* </p>
|
||||
* <p><b>point = com.acme.PointConverter</b></p>
|
||||
*
|
||||
* <p>
|
||||
* Your type converter should be sure to check what class type it is being requested to convert. Because it is used
|
||||
* for both to and from strings, you will need to split the conversion method in to two parts: one that turns Strings in
|
||||
* to Points, and one that turns Points in to Strings.
|
||||
* <p/>
|
||||
* <p/> After this is done, you can now reference your point (using <s:property value="point"/> in JSP or ${point}
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* After this is done, you can now reference your point (using <s:property value="point"/> in JSP or ${point}
|
||||
* in FreeMarker) and it will be printed as "3, 22" again. As such, if you submit this back to an action, it will be
|
||||
* converted back to a Point once again.
|
||||
* <p/>
|
||||
* <p/> In some situations you may wish to apply a type converter globally. This can be done by editing the file
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* In some situations you may wish to apply a type converter globally. This can be done by editing the file
|
||||
* <b>xwork-conversion.properties</b> in the root of your class path (typically WEB-INF/classes) and providing a
|
||||
* property in the form of the class name of the object you wish to convert on the left hand side and the class name of
|
||||
* the type converter on the right hand side. For example, providing a type converter for all Point objects would mean
|
||||
* adding the following entry:
|
||||
* <p/>
|
||||
* <p/><b>com.acme.Point = com.acme.PointConverter</b>
|
||||
* <p/>
|
||||
* </p>
|
||||
*
|
||||
* <p><b>com.acme.Point = com.acme.PointConverter</b></p>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
* <p/>
|
||||
* <p/>
|
||||
* <p/>
|
||||
*
|
||||
*
|
||||
* <!-- START SNIPPET: i18n-note -->
|
||||
* <p/>
|
||||
* <p>
|
||||
* Type conversion should not be used as a substitute for i18n. It is not recommended to use this feature to print out
|
||||
* properly formatted dates. Rather, you should use the i18n features of Struts 2 (and consult the JavaDocs for JDK's
|
||||
* MessageFormat object) to see how a properly formatted date should be displayed.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <!-- END SNIPPET: i18n-note -->
|
||||
* <p/>
|
||||
* <p/>
|
||||
* <p/>
|
||||
*
|
||||
*
|
||||
* <!-- START SNIPPET: error-reporting -->
|
||||
* <p/>
|
||||
* <p>
|
||||
* Any error that occurs during type conversion may or may not wish to be reported. For example, reporting that the
|
||||
* input "abc" could not be converted to a number might be important. On the other hand, reporting that an empty string,
|
||||
* "", cannot be converted to a number might not be important - especially in a web environment where it is hard to
|
||||
* input "abc" could not be converted to a number might be important. On the other hand, reporting that an empty string,
|
||||
* "", cannot be converted to a number might not be important - especially in a web environment where it is hard to
|
||||
* distinguish between a user not entering a value vs. entering a blank value.
|
||||
* <p/>
|
||||
* <p/> By default, all conversion errors are reported using the generic i18n key <b>xwork.default.invalid.fieldvalue</b>,
|
||||
* </p>
|
||||
* <p> By default, all conversion errors are reported using the generic i18n key <b>xwork.default.invalid.fieldvalue</b>,
|
||||
* which you can override (the default text is <i>Invalid field value for field "xxx"</i>, where xxx is the field name)
|
||||
* in your global i18n resource bundle.
|
||||
* <p/>
|
||||
* <p/>However, sometimes you may wish to override this message on a per-field basis. You can do this by adding an i18n
|
||||
* </p>
|
||||
*
|
||||
* <p>However, sometimes you may wish to override this message on a per-field basis. You can do this by adding an i18n
|
||||
* key associated with just your action (Action.properties) using the pattern <b>invalid.fieldvalue.xxx</b>, where xxx
|
||||
* is the field name.
|
||||
* <p/>
|
||||
* <p/>It is important to know that none of these errors are actually reported directly. Rather, they are added to a map
|
||||
* </p>
|
||||
*
|
||||
* <p>It is important to know that none of these errors are actually reported directly. Rather, they are added to a map
|
||||
* called <i>conversionErrors</i> in the ActionContext. There are several ways this map can then be accessed and the
|
||||
* errors can be reported accordingly.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <!-- END SNIPPET: error-reporting -->
|
||||
*
|
||||
* @author <a href="mailto:plightbo@gmail.com">Pat Lightbody</a>
|
||||
|
||||
+5
-5
@@ -70,7 +70,7 @@ public class ConversionDescription {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Sets the property name to be inserted into the related conversion.properties file.<br/>
|
||||
* Sets the property name to be inserted into the related conversion.properties file.<br>
|
||||
* Note: Do not add COLLECTION_PREFIX or MAP_PREFIX keys to property names.
|
||||
* </p>
|
||||
*
|
||||
@@ -91,7 +91,7 @@ public class ConversionDescription {
|
||||
|
||||
/**
|
||||
* Sets the rule prefix for COLLECTION_PREFIX or MAP_PREFIX key.
|
||||
* Defaults to en emtpy String.
|
||||
* Defaults to en empty String.
|
||||
*
|
||||
* @param rule
|
||||
*/
|
||||
@@ -131,9 +131,9 @@ public class ConversionDescription {
|
||||
/**
|
||||
* Returns the conversion description as property entry.
|
||||
* <p>
|
||||
* Example:<br/>
|
||||
* property.name = converter.className<br/>
|
||||
* Collection_property.name = converter.className<br/>
|
||||
* Example:<br>
|
||||
* property.name = converter.className<br>
|
||||
* Collection_property.name = converter.className<br>
|
||||
* Map_property.name = converter.className
|
||||
* KeyProperty_name = id
|
||||
* </p>
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.logging.Logger;
|
||||
* dependency type and name uniquely identifies a dependency mapping; you can
|
||||
* use the same name for two different types. Not safe for concurrent use.
|
||||
*
|
||||
* <p>Adds the following factories by default:
|
||||
* <p>Adds the following factories by default:</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>Injects the current {@link Container}.
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
/**
|
||||
* Copyright (C) 2006 Google Inc.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Licensed 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
|
||||
* <p/>
|
||||
* </p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*/
|
||||
|
||||
package com.opensymphony.xwork2.inject;
|
||||
|
||||
@@ -95,10 +95,11 @@ public abstract class ReferenceCache<K, V> extends ReferenceMap<K, V> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p/>
|
||||
* <p>
|
||||
* If this map does not contain an entry for the given key and {@link
|
||||
* #create(Object)} has been overridden, this method will create a new
|
||||
* value, put it in the map, and return it.
|
||||
* </p>
|
||||
*
|
||||
* @throws NullPointerException if {@link #create(Object)} returns null.
|
||||
* @throws java.util.concurrent.CancellationException if the creation is
|
||||
|
||||
@@ -461,9 +461,10 @@ public class OgnlUtil {
|
||||
|
||||
/**
|
||||
* Creates a Map with read properties for the given source object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* If the source object does not have a read property (i.e. write-only) then
|
||||
* the property is added to the map with the value <code>here is no read method for property-name</code>.
|
||||
* </p>
|
||||
*
|
||||
* @param source the source object.
|
||||
* @return a Map with (key = read property name, value = value of read property).
|
||||
|
||||
+2
-1
@@ -27,8 +27,9 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Is able to access (set/get) properties on a given object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Uses Ognl internal.
|
||||
* </p>
|
||||
*
|
||||
* @author Gabe
|
||||
*/
|
||||
|
||||
@@ -44,9 +44,10 @@ public interface ValueStack {
|
||||
public abstract void setDefaultType(Class defaultType);
|
||||
|
||||
/**
|
||||
* Set a override map containing <code>key -> values</code> that takes precedent when doing find operations on the ValueStack.
|
||||
* <p/>
|
||||
* Set a override map containing <code> key -> values </code> that takes precedent when doing find operations on the ValueStack.
|
||||
* <p>
|
||||
* See the unit test for ValueStackTest for examples.
|
||||
* </p>
|
||||
*
|
||||
* @param overrides overrides map.
|
||||
*/
|
||||
|
||||
@@ -98,10 +98,11 @@ public interface ReflectionProvider {
|
||||
|
||||
/**
|
||||
* Creates a Map with read properties for the given source object.
|
||||
* <p/>
|
||||
* <p>
|
||||
* If the source object does not have a read property (i.e. write-only) then
|
||||
* the property is added to the map with the value <code>here is no read method for property-name</code>.
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @param source the source object.
|
||||
* @return a Map with (key = read property name, value = value of read property).
|
||||
* @throws IntrospectionException is thrown if an exception occurs during introspection.
|
||||
|
||||
Reference in New Issue
Block a user