Java Doc for VariableInfo.java in  » Sevlet-Container » apache-tomcat-6.0.14 » javax » servlet » jsp » tagext » 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 » Sevlet Container » apache tomcat 6.0.14 » javax.servlet.jsp.tagext 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.servlet.jsp.tagext.VariableInfo

VariableInfo
public class VariableInfo (Code)
Information on the scripting variables that are created/modified by a tag (at run-time). This information is provided by TagExtraInfo classes and it is used by the translation phase of JSP.

Scripting variables generated by a custom action have an associated scope of either AT_BEGIN, NESTED, or AT_END.

The class name (VariableInfo.getClassName) in the returned objects is used to determine the types of the scripting variables. Note that because scripting variables are assigned their values from scoped attributes which cannot be of primitive types, "boxed" types such as java.lang.Integer must be used instead of primitives.

The class name may be a Fully Qualified Class Name, or a short class name.

If a Fully Qualified Class Name is provided, it should refer to a class that should be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error.

If a short class name is given in the VariableInfo objects, then the class name must be that of a public class in the context of the import directives of the page where the custom action appears. The class must also be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error.

Usage Comments

Frequently a fully qualified class name will refer to a class that is known to the tag library and thus, delivered in the same JAR file as the tag handlers. In most other remaining cases it will refer to a class that is in the platform on which the JSP processor is built (like J2EE). Using fully qualified class names in this manner makes the usage relatively resistant to configuration errors.

A short name is usually generated by the tag library based on some attributes passed through from the custom action user (the author), and it is thus less robust: for instance a missing import directive in the referring JSP page will lead to an invalid short name class and a translation error.

Synchronization Protocol

The result of the invocation on getVariableInfo is an array of VariableInfo objects. Each such object describes a scripting variable by providing its name, its type, whether the variable is new or not, and what its scope is. Scope is best described through a picture:

NESTED, AT_BEGIN and AT_END Variable Scopes

The JSP 2.0 specification defines the interpretation of 3 values:

  • NESTED, if the scripting variable is available between the start tag and the end tag of the action that defines it.
  • AT_BEGIN, if the scripting variable is available from the start tag of the action that defines it until the end of the scope.
  • AT_END, if the scripting variable is available after the end tag of the action that defines it until the end of the scope.
The scope value for a variable implies what methods may affect its value and thus where synchronization is needed as illustrated by the table below. Note: the synchronization of the variable(s) will occur after the respective method has been called.
Variable Synchronization Points
  doStartTag() doInitBody() doAfterBody() doEndTag() doTag()
Tag
AT_BEGIN, NESTED


AT_BEGIN, AT_END

IterationTag
AT_BEGIN, NESTED

AT_BEGIN, NESTED
AT_BEGIN, AT_END

BodyTag
AT_BEGIN, NESTED1
AT_BEGIN, NESTED1
AT_BEGIN, NESTED
AT_BEGIN, AT_END

SimpleTag




AT_BEGIN, AT_END
1 Called after doStartTag() if EVAL_BODY_INCLUDE is returned, or after doInitBody() otherwise.

Variable Information in the TLD

Scripting variable information can also be encoded directly for most cases into the Tag Library Descriptor using the <variable> subelement of the <tag> element. See the JSP specification.



Field Summary
final public static  intAT_BEGIN
     Scope information that scripting variable is visible after start tag.
final public static  intAT_END
     Scope information that scripting variable is visible after end tag.
final public static  intNESTED
     Scope information that scripting variable is visible only within the start/end tags.

Constructor Summary
public  VariableInfo(String varName, String className, boolean declare, int scope)
     Constructor These objects can be created (at translation time) by the TagExtraInfo instances.

Method Summary
public  StringgetClassName()
     Returns the type of this variable.
public  booleangetDeclare()
     Returns whether this is a new variable.
public  intgetScope()
     Returns the lexical scope of the variable.
public  StringgetVarName()
     Returns the name of the scripting variable.

Field Detail
AT_BEGIN
final public static int AT_BEGIN(Code)
Scope information that scripting variable is visible after start tag.



AT_END
final public static int AT_END(Code)
Scope information that scripting variable is visible after end tag.



NESTED
final public static int NESTED(Code)
Scope information that scripting variable is visible only within the start/end tags.




Constructor Detail
VariableInfo
public VariableInfo(String varName, String className, boolean declare, int scope)(Code)
Constructor These objects can be created (at translation time) by the TagExtraInfo instances.
Parameters:
  varName - The name of the scripting variable
Parameters:
  className - The type of this variable
Parameters:
  declare - If true, it is a new variable (in some languages this willrequire a declaration)
Parameters:
  scope - Indication on the lexical scope of the variable




Method Detail
getClassName
public String getClassName()(Code)
Returns the type of this variable. the type of this variable



getDeclare
public boolean getDeclare()(Code)
Returns whether this is a new variable. If so, in some languages this will require a declaration. whether this is a new variable.



getScope
public int getScope()(Code)
Returns the lexical scope of the variable. the lexical scope of the variable, either AT_BEGIN, AT_END,or NESTED.
See Also:   VariableInfo.AT_BEGIN
See Also:   VariableInfo.AT_END
See Also:   VariableInfo.NESTED



getVarName
public String getVarName()(Code)
Returns the name of the scripting variable. the name of the scripting variable



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.