Source Code Cross Referenced for AstIdentifier.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » el » parser » 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 » org.apache.el.parser 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Generated By:JJTree: Do not edit this line. AstIdentifier.java */
002:
003:        package org.apache.el.parser;
004:
005:        import javax.el.ELException;
006:        import javax.el.MethodExpression;
007:        import javax.el.MethodInfo;
008:        import javax.el.MethodNotFoundException;
009:        import javax.el.ValueExpression;
010:        import javax.el.VariableMapper;
011:
012:        import org.apache.el.lang.EvaluationContext;
013:
014:        /**
015:         * @author Jacob Hookom [jacob@hookom.net]
016:         * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
017:         */
018:        public final class AstIdentifier extends SimpleNode {
019:            public AstIdentifier(int id) {
020:                super (id);
021:            }
022:
023:            public Class getType(EvaluationContext ctx) throws ELException {
024:                VariableMapper varMapper = ctx.getVariableMapper();
025:                if (varMapper != null) {
026:                    ValueExpression expr = varMapper
027:                            .resolveVariable(this .image);
028:                    if (expr != null) {
029:                        return expr.getType(ctx.getELContext());
030:                    }
031:                }
032:                ctx.setPropertyResolved(false);
033:                return ctx.getELResolver().getType(ctx, null, this .image);
034:            }
035:
036:            public Object getValue(EvaluationContext ctx) throws ELException {
037:                VariableMapper varMapper = ctx.getVariableMapper();
038:                if (varMapper != null) {
039:                    ValueExpression expr = varMapper
040:                            .resolveVariable(this .image);
041:                    if (expr != null) {
042:                        return expr.getValue(ctx.getELContext());
043:                    }
044:                }
045:                ctx.setPropertyResolved(false);
046:                return ctx.getELResolver().getValue(ctx, null, this .image);
047:            }
048:
049:            public boolean isReadOnly(EvaluationContext ctx) throws ELException {
050:                VariableMapper varMapper = ctx.getVariableMapper();
051:                if (varMapper != null) {
052:                    ValueExpression expr = varMapper
053:                            .resolveVariable(this .image);
054:                    if (expr != null) {
055:                        return expr.isReadOnly(ctx.getELContext());
056:                    }
057:                }
058:                ctx.setPropertyResolved(false);
059:                return ctx.getELResolver().isReadOnly(ctx, null, this .image);
060:            }
061:
062:            public void setValue(EvaluationContext ctx, Object value)
063:                    throws ELException {
064:                VariableMapper varMapper = ctx.getVariableMapper();
065:                if (varMapper != null) {
066:                    ValueExpression expr = varMapper
067:                            .resolveVariable(this .image);
068:                    if (expr != null) {
069:                        expr.setValue(ctx.getELContext(), value);
070:                        return;
071:                    }
072:                }
073:                ctx.setPropertyResolved(false);
074:                ctx.getELResolver().setValue(ctx, null, this .image, value);
075:            }
076:
077:            private final Object invokeTarget(EvaluationContext ctx,
078:                    Object target, Object[] paramValues) throws ELException {
079:                if (target instanceof  MethodExpression) {
080:                    MethodExpression me = (MethodExpression) target;
081:                    return me.invoke(ctx.getELContext(), paramValues);
082:                } else if (target == null) {
083:                    throw new MethodNotFoundException("Identity '" + this .image
084:                            + "' was null and was unable to invoke");
085:                } else {
086:                    throw new ELException(
087:                            "Identity '"
088:                                    + this .image
089:                                    + "' does not reference a MethodExpression instance, returned type: "
090:                                    + target.getClass().getName());
091:                }
092:            }
093:
094:            public Object invoke(EvaluationContext ctx, Class[] paramTypes,
095:                    Object[] paramValues) throws ELException {
096:                return this .getMethodExpression(ctx).invoke(ctx.getELContext(),
097:                        paramValues);
098:            }
099:
100:            public MethodInfo getMethodInfo(EvaluationContext ctx,
101:                    Class[] paramTypes) throws ELException {
102:                return this .getMethodExpression(ctx).getMethodInfo(
103:                        ctx.getELContext());
104:            }
105:
106:            private final MethodExpression getMethodExpression(
107:                    EvaluationContext ctx) throws ELException {
108:                Object obj = null;
109:
110:                // case A: ValueExpression exists, getValue which must
111:                // be a MethodExpression
112:                VariableMapper varMapper = ctx.getVariableMapper();
113:                ValueExpression ve = null;
114:                if (varMapper != null) {
115:                    ve = varMapper.resolveVariable(this .image);
116:                    if (ve != null) {
117:                        obj = ve.getValue(ctx);
118:                    }
119:                }
120:
121:                // case B: evaluate the identity against the ELResolver, again, must be
122:                // a MethodExpression to be able to invoke
123:                if (ve == null) {
124:                    ctx.setPropertyResolved(false);
125:                    obj = ctx.getELResolver().getValue(ctx, null, this .image);
126:                }
127:
128:                // finally provide helpful hints
129:                if (obj instanceof  MethodExpression) {
130:                    return (MethodExpression) obj;
131:                } else if (obj == null) {
132:                    throw new MethodNotFoundException("Identity '" + this .image
133:                            + "' was null and was unable to invoke");
134:                } else {
135:                    throw new ELException(
136:                            "Identity '"
137:                                    + this .image
138:                                    + "' does not reference a MethodExpression instance, returned type: "
139:                                    + obj.getClass().getName());
140:                }
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.