Java Doc for VMProxyArg.java in  » Template-Engine » Velocity » org » apache » velocity » runtime » directive » 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 » Template Engine » Velocity » org.apache.velocity.runtime.directive 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.velocity.runtime.directive.VMProxyArg

VMProxyArg
public class VMProxyArg (Code)
The function of this class is to proxy for the calling parameter to the VM. This class is designed to be used in conjunction with the VMContext class which knows how to get and set values via it, rather than a simple get() or put() from a hashtable-like object. There is probably a lot of undocumented subtlty here, so step lightly. We rely on the observation that an instance of this object has a constant state throughout its lifetime as it's bound to the use-instance of a VM. In other words, it's created by the VelocimacroProxy class, to represent one of the arguments to a VM in a specific template. Since the template is fixed (it's a file...), we don't have to worry that the args to the VM will change. Yes, the VM will be called in other templates, or in other places on the same template, bit those are different use-instances. These arguments can be, in the lingo of the parser, one of :
  • Reference() : anything that starts with '$'
  • StringLiteral() : something like "$foo" or "hello geir"
  • IntegerLiteral() : 1, 2 etc
  • FloatingPointLiteral() : 1.2, 2e5 etc
  • IntegerRange() : [ 1..2] or [$foo .. $bar]
  • ObjectArray() : [ "a", "b", "c"]
  • True() : true
  • False() : false
  • Word() : not likely - this is simply allowed by the parser so we can have syntactical sugar like #foreach($a in $b) where 'in' is the Word
Now, Reference(), StringLit, IntegerLiteral, IntRange, ObjArr are all dynamic things, so their value is gotten with the use of a context. The others are constants. The trick we rely on is that the context rather than this class really represents the state of the argument. We are simply proxying for the thing, returning the proper value when asked, and storing the proper value in the appropriate context when asked. So, the hope here, so an instance of this can be shared across threads, is to keep any dynamic stuff out of it, relying on trick of having the appropriate context handed to us, and when a constant argument, letting VMContext punch that into a local context.
author:
   Geir Magnusson Jr.
version:
   $Id: VMProxyArg.java 473363 2006-11-10 15:19:09Z wglass $



Constructor Summary
public  VMProxyArg(RuntimeServices rs, String contextRef, String callerRef, int t)
     ctor for current impl takes the reference literal we are proxying for, the literal the VM we are for is called with...
public  VMProxyArg(VMProxyArg model, InternalContextAdapter c)
     not used in current impl Constructor for alternate impl where VelProxy class would make new VMProxyArg objects, and use this contructor to avoid reparsing the reference args that impl also had the VMProxyArg carry it's context.

Method Summary
public  StringgetCallerReference()
    
public  StringgetContextReference()
    
public  SimpleNodegetNodeTree()
    
public  ObjectgetObject(InternalContextAdapter context)
     returns the value of the reference.
public  ObjectgetStaticObject()
    
public  intgetType()
    
public  booleanisConstant()
     tells if arg we are poxying for is dynamic or constant.
public  ObjectsetObject(InternalContextAdapter context, Object o)
     Invoked by VMContext when Context.put() is called for a proxied reference.


Constructor Detail
VMProxyArg
public VMProxyArg(RuntimeServices rs, String contextRef, String callerRef, int t)(Code)
ctor for current impl takes the reference literal we are proxying for, the literal the VM we are for is called with...
Parameters:
  rs -
Parameters:
  contextRef - reference arg in the definition of the VM, used in the VM
Parameters:
  callerRef - reference used by the caller as an arg to the VM
Parameters:
  t - type of arg : JJTREFERENCE, JJTTRUE, etc



VMProxyArg
public VMProxyArg(VMProxyArg model, InternalContextAdapter c)(Code)
not used in current impl Constructor for alternate impl where VelProxy class would make new VMProxyArg objects, and use this contructor to avoid reparsing the reference args that impl also had the VMProxyArg carry it's context.
Parameters:
  model -
Parameters:
  c -




Method Detail
getCallerReference
public String getCallerReference()(Code)
The caller reference.



getContextReference
public String getContextReference()(Code)
The context reference.



getNodeTree
public SimpleNode getNodeTree()(Code)
The node tree.



getObject
public Object getObject(InternalContextAdapter context) throws MethodInvocationException(Code)
returns the value of the reference. Generally, this is only called for dynamic proxies, as the static ones should have been stored in the VMContext's localcontext store
Parameters:
  context - Context to use for getting current value Object value
exception:
  MethodInvocationException - passes on potential exception from reference method call



getStaticObject
public Object getStaticObject()(Code)
The static object.



getType
public int getType()(Code)
The type.



isConstant
public boolean isConstant()(Code)
tells if arg we are poxying for is dynamic or constant. true of constant, false otherwise



setObject
public Object setObject(InternalContextAdapter context, Object o)(Code)
Invoked by VMContext when Context.put() is called for a proxied reference.
Parameters:
  context - context to modify via direct placement, or AST.setValue()
Parameters:
  o - new value of reference Object currently null



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.