WW-2069 Drops "id" and "name" attributes" on the tags where they are deprecated.

This commit is contained in:
Aleksandr Mashchenko
2015-11-02 22:14:59 +02:00
parent 2b4d37908d
commit f8718f9187
31 changed files with 23 additions and 177 deletions
@@ -59,7 +59,7 @@ import java.util.List;
*
* <!-- START SNIPPET: params -->
* <ul>
* <li>id (String) - the id of which if supplied will have the resultant
* <li>var (String) - the name of which if supplied will have the resultant
* appended iterator stored under in the stack's context</li>
* </ul>
* <!-- END SNIPPET: params -->
@@ -48,17 +48,6 @@ public abstract class ContextBean extends Component {
}
}
/**
* To keep backward compatibility
* TODO remove after 2.1
*
* @param id the given id
*/
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String id) {
setVar(id);
}
protected String getVar() {
return this.var;
}
@@ -61,7 +61,7 @@ import java.util.List;
*
* <!-- START SNIPPET: params -->
* <ul>
* <li>id (String) - the id where the resultant merged iterator will be stored in the stack's context</li>
* <li>var (String) - the name where the resultant merged iterator will be stored in the stack's context</li>
* </ul>
* <!-- END SNIPPET: params -->
*
@@ -58,7 +58,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* <ul>
*
* <li>name* (String): The name of the new variable that is assigned the value of <i>value</i></li>
* <li>var* (String): The name of the new variable that is assigned the value of <i>value</i></li>
*
* <li>value (Object): The value that is assigned to the variable named <i>name</i></li>
*
@@ -123,19 +123,11 @@ public class Set extends ContextBean {
return super.end(writer, body);
}
/*
* TODO: set required=true when 'id' is dropped after 2.1
*/
@StrutsTagAttribute(description="Name used to reference the value pushed into the Value Stack")
@StrutsTagAttribute(required=true, description="Name used to reference the value pushed into the Value Stack")
public void setVar(String var) {
super.setVar(var);
}
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setName(String name) {
setVar(name);
}
@StrutsTagAttribute(description="The scope in which to assign the variable. Can be <b>application</b>" +
", <b>session</b>, <b>request</b>, <b>page</b>, or <b>action</b>.", defaultValue="action")
public void setScope(String scope) {
@@ -37,12 +37,4 @@ public abstract class ContextBeanTag extends ComponentTagSupport {
public void setVar(String var) {
this.var = var;
}
/**
* To keep backward compatibility
* TODO remove after 2.1
*/
public void setId(String id) {
setVar(id);
}
}
@@ -175,11 +175,6 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport {
converterAttr = aConverter;
}
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}
@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
@@ -48,7 +48,7 @@ import org.apache.struts2.views.jsp.StrutsBodyTagSupport;
* <!-- START SNIPPET: params -->
*
* <ul>
* <li>id (String) - if specified, the sorted iterator will be place with this id under page context</li>
* <li>var (String) - if specified, the sorted iterator will be place with this name under page context</li>
* <li>source (Object) - the source for the sort to take place (should be iteratable) else JspException will be thrown</li>
* <li>comparator* (Object) - the comparator used to do sorting (should be a type of Comparator or its decendent) else JspException will be thrown</li>
* </ul>
@@ -109,11 +109,6 @@ public class SortIteratorTag extends StrutsBodyTagSupport {
sourceAttr = source;
}
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}
@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
@@ -192,11 +192,6 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
deciderAttr = decider;
}
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}
@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
-8
View File
@@ -49,14 +49,6 @@ Please do not edit it directly.
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Whether the writer should be flush upon end of action component tag, default to true</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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">ignoreContextParams</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -33,14 +33,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -33,14 +33,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
-8
View File
@@ -41,14 +41,6 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Date or DateTime format pattern</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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
@@ -49,14 +49,6 @@ Please do not edit it directly.
<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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">separator</td>
<td align="left" valign="top"><strong>true</strong></td>
@@ -49,14 +49,6 @@ Please do not edit it directly.
<td align="left" valign="top">Integer</td>
<td align="left" valign="top">if specified the iteration will end on that index(inclusive)</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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">status</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -33,14 +33,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -49,14 +49,6 @@ Please do not edit it directly.
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Whether grouping is used</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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">maximumFractionDigits</td>
<td align="left" valign="top">false</td>
+1 -17
View File
@@ -33,22 +33,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">scope</td>
<td align="left" valign="top">false</td>
@@ -67,7 +51,7 @@ Please do not edit it directly.
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"><strong>true</strong></td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
-8
View File
@@ -41,14 +41,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">source</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -49,14 +49,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">source</td>
<td align="left" valign="top">false</td>
-8
View File
@@ -33,14 +33,6 @@ Please do not edit it directly.
<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">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
-8
View File
@@ -73,14 +73,6 @@ Please do not edit it directly.
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Specifies whether to force the addition of scheme, host and port or not</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">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">includeContext</td>
<td align="left" valign="top">false</td>
@@ -52,7 +52,7 @@ public class ActionTagTest extends AbstractTagTest {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName(TestConfigurationProvider.TEST_NAMESPACE_ACTION);
tag.setId(TestConfigurationProvider.TEST_NAMESPACE_ACTION);
tag.setVar(TestConfigurationProvider.TEST_NAMESPACE_ACTION);
try {
tag.doStartTag();
@@ -79,7 +79,7 @@ public class ActionTagTest extends AbstractTagTest {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName("testAction");
tag.setId("testAction");
tag.setVar("testAction");
int stackSize = stack.size();
@@ -117,7 +117,7 @@ public class ActionTagTest extends AbstractTagTest {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName("testAction");
tag.setId("testAction");
tag.setVar("testAction");
int stackSize = stack.size();
@@ -39,7 +39,7 @@ public class AppendIteratorTagTest extends AbstractTagTest {
public void testAppendingIteratorUsingArrayAsSource() throws Exception {
AppendIteratorTag tag = new AppendIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myAppendedIterator");
tag.setVar("myAppendedIterator");
ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
@@ -90,7 +90,7 @@ public class AppendIteratorTagTest extends AbstractTagTest {
public void testAppendingIteratorsUsingListAsSource() throws Exception {
AppendIteratorTag tag = new AppendIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myAppendedIterator");
tag.setVar("myAppendedIterator");
ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
@@ -138,7 +138,7 @@ public class IteratorGeneratorTagTest extends AbstractTagTest {
IteratorGeneratorTag tag = new IteratorGeneratorTag();
tag.setPageContext(pageContext);
tag.setVal("%{'aaa,bbb,ccc,ddd,eee'}");
tag.setId("myPageContextAttId");
tag.setVar("myPageContextAttId");
tag.doStartTag();
tag.doEndTag();
@@ -58,7 +58,7 @@ public class IteratorTagTest extends AbstractUITagTest {
stack.push(foo);
tag.setValue("list");
tag.setId("myId");
tag.setVar("myId");
// one
int result = tag.doStartTag();
@@ -116,7 +116,7 @@ public class IteratorTagTest extends AbstractUITagTest {
stack.push(foo);
tag.setValue("list");
tag.setId("myId");
tag.setVar("myId");
// one
int result = tag.doStartTag();
@@ -39,7 +39,7 @@ public class MergeIteratorTagTest extends AbstractTagTest {
public void testMergingIteratorWithArrayAsSource() throws Exception {
MergeIteratorTag tag = new MergeIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myMergedIterator");
tag.setVar("myMergedIterator");
ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
@@ -91,7 +91,7 @@ public class MergeIteratorTagTest extends AbstractTagTest {
public void testMergingIteratorsWithListAsSource() throws Exception {
MergeIteratorTag tag = new MergeIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myMergedIterator");
tag.setVar("myMergedIterator");
ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
@@ -76,7 +76,7 @@ public class SortIteratorTagTest extends AbstractTagTest {
SortIteratorTag tag = new SortIteratorTag();
tag.setId("myId");
tag.setVar("myId");
tag.setComparator("comparator");
tag.setSource("source");
@@ -113,7 +113,7 @@ public class SortIteratorTagTest extends AbstractTagTest {
public void testSortWithIdIteratorAvailableInPageContext() throws Exception {
SortIteratorTag tag = new SortIteratorTag();
tag.setId("myId");
tag.setVar("myId");
tag.setComparator("comparator");
tag.setSource("source");
@@ -172,7 +172,7 @@ public class SubsetIteratorTagTest extends AbstractTagTest {
SubsetIteratorTag tag = new SubsetIteratorTag();
tag.setPageContext(pageContext);
tag.setSource("myList");
tag.setId("myPageContextId1");
tag.setVar("myPageContextId1");
tag.doStartTag();
Iterator subsetIterator1 = (Iterator) stack.findValue("top");
@@ -194,7 +194,7 @@ public class SubsetIteratorTagTest extends AbstractTagTest {
SubsetIteratorTag tag = new SubsetIteratorTag();
tag.setPageContext(pageContext);
tag.setSource("myArray");
tag.setId("myPageContextId2");
tag.setVar("myPageContextId2");
tag.doStartTag();
Iterator subsetIterator1 = (Iterator) stack.findValue("top");
@@ -298,7 +298,7 @@ public class TextTagTest extends AbstractTagTest {
public void testPutId() throws Exception {
assertEquals(null, stack.findString("myId")); // nothing in stack
tag.setId("myId");
tag.setVar("myId");
tag.setName("bar.baz");
tag.doStartTag();
tag.doEndTag();
@@ -353,7 +353,7 @@ public class URLTagTest extends AbstractUITagTest {
public void testPutId() throws Exception {
tag.setValue("/public/about");
assertEquals(null, stack.findString("myId")); // nothing in stack
tag.setId("myId");
tag.setVar("myId");
tag.doStartTag();
tag.doEndTag();
assertEquals("", writer.toString());
@@ -147,7 +147,7 @@ public class DateTagTest extends AbstractTagTest {
tag.setName("myDate");
tag.setNice(false);
tag.setFormat(format);
tag.setId("myId");
tag.setVar("myId");
tag.doStartTag();
tag.doEndTag();
assertEquals(formatted, context.get("myId"));