Java Doc for LoopTagSupport.java in  » EJB-Server-GlassFish » appserv-jstl » javax » servlet » jsp » jstl » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server GlassFish » appserv jstl » javax.servlet.jsp.jstl.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.servlet.jsp.tagext.TagSupport
      javax.servlet.jsp.jstl.core.LoopTagSupport

All known Subclasses:   org.apache.taglibs.standard.tag.common.core.ForEachSupport,  org.apache.taglibs.standard.tag.common.xml.ForEachTag,  org.apache.taglibs.standard.tag.common.core.ForTokensSupport,
LoopTagSupport
abstract public class LoopTagSupport extends TagSupport implements LoopTag,IterationTag,TryCatchFinally(Code)

Base support class to facilitate implementation of iteration tags.

Since most iteration tags will behave identically with respect to actual iterative behavior, JSTL provides this base support class to facilitate implementation. Many iteration tags will extend this and merely implement the hasNext() and next() methods to provide contents for the handler to iterate over.

In particular, this base class provides support for:

  • Iteration control, based on protected prepare(), next(), and hasNext() methods
  • Subsetting (begin, end, step>functionality, including validation of subset parameters for sensibility)
  • item retrieval (getCurrent())
  • status retrieval (LoopTagStatus)
  • exposing attributes (set by var and varStatus attributes)

In providing support for these tasks, LoopTagSupport contains certain control variables that act to modify the iteration. Accessors are provided for these control variables when the variables represent information needed or wanted at translation time (e.g., var, varStatus). For other variables, accessors cannot be provided here since subclasses may differ on their implementations of how those accessors are received. For instance, one subclass might accept a String and convert it into an object of a specific type by using an expression evaluator; others might accept objects directly. Still others might not want to expose such information to outside control.


author:
   Shawn Bayern


Field Summary
protected  intbegin
    
protected  booleanbeginSpecified
     Boolean flag indicating whether 'begin' was specified.
protected  ValueExpressiondeferredExpression
    
protected  intend
     Ending index of the iteration ('end' attribute).
protected  booleanendSpecified
     Boolean flag indicating whether 'end' was specified.
protected  StringitemIdstatusId
    
protected  intstep
    
protected  booleanstepSpecified
     Boolean flag indicating whether 'step' was specified.

Constructor Summary
public  LoopTagSupport()
     Constructs a new LoopTagSupport.

Method Summary
public  intdoAfterBody()
     Continues the iteration when appropriate -- that is, if we (a) have more items and (b) don't run over our 'end' (given our 'step').
public  voiddoCatch(Throwable t)
     Rethrows the given Throwable.
public  voiddoFinally()
     Removes any attributes that this LoopTagSupport set.
public  intdoStartTag()
     Begins iterating by processing the first item.
public  ObjectgetCurrent()
    
protected  StringgetDelims()
    
public  LoopTagStatusgetLoopStatus()
    
abstract protected  booleanhasNext()
    

Returns information concerning the availability of more items over which to iterate.

abstract protected  Objectnext()
    

Returns the next object over which the tag should iterate.

abstract protected  voidprepare()
    

Prepares for a single tag invocation.

public  voidrelease()
     Releases any resources this LoopTagSupport may have (or inherit).
public  voidsetVar(String id)
     Sets the 'var' attribute.
public  voidsetVarStatus(String statusId)
     Sets the 'varStatus' attribute.
protected  voidvalidateBegin()
    
protected  voidvalidateEnd()
    
protected  voidvalidateStep()
    

Field Detail
begin
protected int begin(Code)
Starting index ('begin' attribute)



beginSpecified
protected boolean beginSpecified(Code)
Boolean flag indicating whether 'begin' was specified.



deferredExpression
protected ValueExpression deferredExpression(Code)
The deferred expression if any



end
protected int end(Code)
Ending index of the iteration ('end' attribute). A value of -1 internally indicates 'no end specified', although accessors for the core JSTL tags do not allow this value to be supplied directly by the user.



endSpecified
protected boolean endSpecified(Code)
Boolean flag indicating whether 'end' was specified.



itemIdstatusId
protected String itemIdstatusId(Code)
Attribute-exposing control



step
protected int step(Code)
Iteration step ('step' attribute)



stepSpecified
protected boolean stepSpecified(Code)
Boolean flag indicating whether 'step' was specified.




Constructor Detail
LoopTagSupport
public LoopTagSupport()(Code)
Constructs a new LoopTagSupport. As with TagSupport, subclasses should not implement constructors with arguments, and no-arguments constructors implemented by subclasses must call the superclass constructor.




Method Detail
doAfterBody
public int doAfterBody() throws JspException(Code)
Continues the iteration when appropriate -- that is, if we (a) have more items and (b) don't run over our 'end' (given our 'step').



doCatch
public void doCatch(Throwable t) throws Throwable(Code)
Rethrows the given Throwable.



doFinally
public void doFinally()(Code)
Removes any attributes that this LoopTagSupport set.

These attributes are intended to support scripting variables with NESTED scope, so we don't want to pollute attribute space by leaving them lying around.




doStartTag
public int doStartTag() throws JspException(Code)
Begins iterating by processing the first item.



getCurrent
public Object getCurrent()(Code)



getDelims
protected String getDelims()(Code)



getLoopStatus
public LoopTagStatus getLoopStatus()(Code)



hasNext
abstract protected boolean hasNext() throws JspTagException(Code)

Returns information concerning the availability of more items over which to iterate. This method must be provided by concrete subclasses of LoopTagSupport to assist the iterative logic provided by the supporting base class.

See next for more information about the purpose and expectations behind this tag.

true if there is at least one more item to iterateover, false otherwise
exception:
  javax.servlet.jsp.JspTagException -
See Also:   LoopTagSupport.next



next
abstract protected Object next() throws JspTagException(Code)

Returns the next object over which the tag should iterate. This method must be provided by concrete subclasses of LoopTagSupport to inform the base logic about what objects it should iterate over.

It is expected that this method will generally be backed by an Iterator, but this will not always be the case. In particular, if retrieving the next object raises the possibility of an exception being thrown, this method allows that exception to propagate back to the JSP container as a JspTagException; a standalone Iterator would not be able to do this. (This explains why LoopTagSupport does not simply call for an Iterator from its subtags.)

the java.lang.Object to use in the next round of iteration
exception:
  java.util.NoSuchElementException - if next() is called but no new elements are available
exception:
  javax.servlet.jsp.JspTagException - for other, unexpected exceptions



prepare
abstract protected void prepare() throws JspTagException(Code)

Prepares for a single tag invocation. Specifically, allows subclasses to prepare for calls to hasNext() and next(). Subclasses can assume that prepare() will be called once for each invocation of doStartTag() in the superclass.


exception:
  javax.servlet.jsp.JspTagException -



release
public void release()(Code)
Releases any resources this LoopTagSupport may have (or inherit).



setVar
public void setVar(String id)(Code)
Sets the 'var' attribute.
Parameters:
  id - Name of the exported scoped variable storing the current itemof the iteration.



setVarStatus
public void setVarStatus(String statusId)(Code)
Sets the 'varStatus' attribute.
Parameters:
  statusId - Name of the exported scoped variable storing the statusof the iteration.



validateBegin
protected void validateBegin() throws JspTagException(Code)
Ensures the "begin" property is sensible, throwing an exception expected to propagate up if it isn't



validateEnd
protected void validateEnd() throws JspTagException(Code)
Ensures the "end" property is sensible, throwing an exception expected to propagate up if it isn't



validateStep
protected void validateStep() throws JspTagException(Code)
Ensures the "step" property is sensible, throwing an exception expected to propagate up if it isn't



Fields inherited from javax.servlet.jsp.tagext.TagSupport
protected String id(Code)(Java Doc)
protected PageContext pageContext(Code)(Java Doc)

Methods inherited from javax.servlet.jsp.tagext.TagSupport
public int doAfterBody() throws JspException(Code)(Java Doc)
public int doEndTag() throws JspException(Code)(Java Doc)
public int doStartTag() throws JspException(Code)(Java Doc)
final public static Tag findAncestorWithClass(Tag from, Class klass)(Code)(Java Doc)
public String getId()(Code)(Java Doc)
public Tag getParent()(Code)(Java Doc)
public Object getValue(String k)(Code)(Java Doc)
public Enumeration getValues()(Code)(Java Doc)
public void release()(Code)(Java Doc)
public void removeValue(String k)(Code)(Java Doc)
public void setId(String id)(Code)(Java Doc)
public void setPageContext(PageContext pageContext)(Code)(Java Doc)
public void setParent(Tag t)(Code)(Java Doc)
public void setValue(String k, Object o)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.