mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Adding taglib annotations to JSP iterator tags
WW-1599 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@493679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+10
-11
@@ -24,6 +24,8 @@ import javax.servlet.jsp.JspException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts.annotations.StrutsTag;
|
||||
import org.apache.struts.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.util.IteratorGenerator;
|
||||
import org.apache.struts2.util.IteratorGenerator.Converter;
|
||||
import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
@@ -121,10 +123,9 @@ import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
* <!-- END SNIPPET: example -->
|
||||
*
|
||||
* @see org.apache.struts2.util.IteratorGenerator
|
||||
*
|
||||
* @s.tag name="generator" tld-body-content="JSP"
|
||||
* description="Generate an iterator for a iterable source."
|
||||
*/
|
||||
@StrutsTag(name="generator", tldTagClass="org.apache.struts2.views.jsp.iterator.IteratorGeneratorTag",
|
||||
description="Generate an iterator for a iterable source.")
|
||||
public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
private static final long serialVersionUID = 2968037295463973936L;
|
||||
@@ -140,10 +141,7 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
IteratorGenerator iteratorGenerator = null;
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
* description="the max number entries to be in the iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(type="Integer",description="The max number entries to be in the iterator")
|
||||
public void setCount(String count) {
|
||||
countAttr = count;
|
||||
}
|
||||
@@ -152,6 +150,7 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
* @s.tagattribute required="true" type="String"
|
||||
* description="the separator to be used in separating the <i>val</i> into entries of the iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(required=true, description="The separator to be used in separating the <i>val</i> into entries of the iterator")
|
||||
public void setSeparator(String separator) {
|
||||
separatorAttr = separator;
|
||||
}
|
||||
@@ -160,14 +159,13 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
* @s.tagattribute required="true"
|
||||
* description="the source to be parsed into an iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(required=true, description="The source to be parsed into an iterator")
|
||||
public void setVal(String val) {
|
||||
valueAttr = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false" type="org.apache.struts2.util.IteratorGenerator.Converter"
|
||||
* description="the converter to convert the String entry parsed from <i>val</i> into an object"
|
||||
*/
|
||||
@StrutsTagAttribute(type="org.apache.struts2.util.IteratorGenerator.Converter",
|
||||
description="The converter to convert the String entry parsed from <i>val</i> into an object")
|
||||
public void setConverter(String aConverter) {
|
||||
converterAttr = aConverter;
|
||||
}
|
||||
@@ -176,6 +174,7 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
|
||||
* @s.tagattribute required="false" type="String"
|
||||
* description="the id to store the resultant iterator into page context, if such id is supplied"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The id to store the resultant iterator into page context, if such id is supplied")
|
||||
public void setId(String string) {
|
||||
super.setId(string);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.Comparator;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
import org.apache.struts.annotations.StrutsTag;
|
||||
import org.apache.struts.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
import org.apache.struts2.util.SortIteratorFilter;
|
||||
import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
@@ -84,6 +86,8 @@ import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
* @s.tag name="sort" tld-body-content="JSP"
|
||||
* description="Sort a List using a Comparator both passed in as the tag attribute."
|
||||
*/
|
||||
@StrutsTag(name="sort", tldTagClass="org.apache.struts2.views.jsp.iterator.SortIteratorTag",
|
||||
description="Sort a List using a Comparator both passed in as the tag attribute.")
|
||||
public class SortIteratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
private static final long serialVersionUID = -7835719609764092235L;
|
||||
@@ -93,18 +97,12 @@ public class SortIteratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
SortIteratorFilter sortIteratorFilter = null;
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="true" type="java.util.Comparator"
|
||||
* description="The comparator to use"
|
||||
*/
|
||||
@StrutsTagAttribute(required=true,type="java.util.Comparator", description="The comparator to use")
|
||||
public void setComparator(String comparator) {
|
||||
comparatorAttr = comparator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false"
|
||||
* description="The iterable source to sort"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The iterable source to sort")
|
||||
public void setSource(String source) {
|
||||
sourceAttr = source;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import javax.servlet.jsp.JspException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts.annotations.StrutsTag;
|
||||
import org.apache.struts.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.util.SubsetIteratorFilter;
|
||||
import org.apache.struts2.util.SubsetIteratorFilter.Decider;
|
||||
import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
@@ -145,6 +147,8 @@ import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
|
||||
* @s.tag name="subset" tld-body-content="JSP"
|
||||
* description="Takes an iterator and outputs a subset of it"
|
||||
*/
|
||||
@StrutsTag(name="subset", tldTagClass="org.apache.struts2.views.jsp.iterator.SubsetIteratorTag",
|
||||
description="Takes an iterator and outputs a subset of it.")
|
||||
public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
private static final long serialVersionUID = -6252696081713080102L;
|
||||
@@ -159,18 +163,12 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
SubsetIteratorFilter subsetIteratorFilter = null;
|
||||
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
* description="Indicate the number of entries to be in the resulting subset iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(type="Integer", description="Indicate the number of entries to be in the resulting subset iterator")
|
||||
public void setCount(String count) {
|
||||
countAttr = count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false"
|
||||
* description="Indicate the source of which the resulting subset iterator is to be derived base on"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Indicate the source of which the resulting subset iterator is to be derived base on")
|
||||
public void setSource(String source) {
|
||||
sourceAttr = source;
|
||||
}
|
||||
@@ -179,14 +177,14 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
* description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(type="Integer",
|
||||
description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator")
|
||||
public void setStart(String start) {
|
||||
startAttr = start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @s.tagattribute required="false" type="org.apache.struts2.util.SubsetIteratorFilter.Decider"
|
||||
* description="Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator"
|
||||
*/
|
||||
@StrutsTagAttribute(type="org.apache.struts2.util.SubsetIteratorFilter.Decider",
|
||||
description="Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator")
|
||||
public void setDecider(String decider) {
|
||||
deciderAttr = decider;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
<!--
|
||||
This file is generated during the build by processing Component class annotations.
|
||||
Please do not edit it directly.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>generator</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Tag Name: generator</h1>
|
||||
<h2>Description</h2>
|
||||
<p>
|
||||
<!-- START SNIPPET: tagdescription -->
|
||||
Generate an iterator for a iterable source.
|
||||
<!-- END SNIPPET: tagdescription -->
|
||||
</p>
|
||||
|
||||
<h2>Attributes</h2>
|
||||
<!-- START SNIPPET: tagattributes -->
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th align="left" valign="top"><h4>Name</h4></th>
|
||||
<th align="left" valign="top"><h4>Required</h4></th>
|
||||
<th align="left" valign="top"><h4>Default</h4></th>
|
||||
<th align="left" valign="top"><h4>Evaluated</h4></th>
|
||||
<th align="left" valign="top"><h4>Type</h4></th>
|
||||
<th align="left" valign="top"><h4>Description</h4></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">converter</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">org.apache.struts2.util.IteratorGenerator.Converter</td>
|
||||
<td align="left" valign="top">The converter to convert the String entry parsed from <i>val</i> into an object</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">count</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">Integer</td>
|
||||
<td align="left" valign="top">The max number entries to be in the iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The id to store the resultant iterator into page context, if such id is supplied</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">separator</td>
|
||||
<td align="left" valign="top"><strong>true</strong></td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The separator to be used in separating the <i>val</i> into entries of the iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">val</td>
|
||||
<td align="left" valign="top"><strong>true</strong></td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The source to be parsed into an iterator</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END SNIPPET: tagattributes -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<!--
|
||||
This file is generated during the build by processing Component class annotations.
|
||||
Please do not edit it directly.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>sort</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Tag Name: sort</h1>
|
||||
<h2>Description</h2>
|
||||
<p>
|
||||
<!-- START SNIPPET: tagdescription -->
|
||||
Sort a List using a Comparator both passed in as the tag attribute.
|
||||
<!-- END SNIPPET: tagdescription -->
|
||||
</p>
|
||||
|
||||
<h2>Attributes</h2>
|
||||
<!-- START SNIPPET: tagattributes -->
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th align="left" valign="top"><h4>Name</h4></th>
|
||||
<th align="left" valign="top"><h4>Required</h4></th>
|
||||
<th align="left" valign="top"><h4>Default</h4></th>
|
||||
<th align="left" valign="top"><h4>Evaluated</h4></th>
|
||||
<th align="left" valign="top"><h4>Type</h4></th>
|
||||
<th align="left" valign="top"><h4>Description</h4></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">comparator</td>
|
||||
<td align="left" valign="top"><strong>true</strong></td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">java.util.Comparator</td>
|
||||
<td align="left" valign="top">The comparator to use</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">source</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The iterable source to sort</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END SNIPPET: tagattributes -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<!--
|
||||
This file is generated during the build by processing Component class annotations.
|
||||
Please do not edit it directly.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>subset</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Tag Name: subset</h1>
|
||||
<h2>Description</h2>
|
||||
<p>
|
||||
<!-- START SNIPPET: tagdescription -->
|
||||
Takes an iterator and outputs a subset of it.
|
||||
<!-- END SNIPPET: tagdescription -->
|
||||
</p>
|
||||
|
||||
<h2>Attributes</h2>
|
||||
<!-- START SNIPPET: tagattributes -->
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th align="left" valign="top"><h4>Name</h4></th>
|
||||
<th align="left" valign="top"><h4>Required</h4></th>
|
||||
<th align="left" valign="top"><h4>Default</h4></th>
|
||||
<th align="left" valign="top"><h4>Evaluated</h4></th>
|
||||
<th align="left" valign="top"><h4>Type</h4></th>
|
||||
<th align="left" valign="top"><h4>Description</h4></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">count</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">Integer</td>
|
||||
<td align="left" valign="top">Indicate the number of entries to be in the resulting subset iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">decider</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">org.apache.struts2.util.SubsetIteratorFilter.Decider</td>
|
||||
<td align="left" valign="top">Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">source</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Indicate the source of which the resulting subset iterator is to be derived base on</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">start</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">Integer</td>
|
||||
<td align="left" valign="top">Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END SNIPPET: tagattributes -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user