Java Doc for ExpressionFactory.java in  » EJB-Server-GlassFish » servlet » javax » el » 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 » servlet » javax.el 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.el.ExpressionFactory

ExpressionFactory
abstract public class ExpressionFactory (Code)




Method Summary
abstract public  ObjectcoerceToType(Object obj, Class targetType)
     Coerces an object to a specific type according to the EL type conversion rules.
abstract public  MethodExpressioncreateMethodExpression(ELContext context, String expression, Class expectedReturnType, Class[] expectedParamTypes)
     Parses an expression into a MethodExpression for later evaluation.
abstract public  ValueExpressioncreateValueExpression(ELContext context, String expression, Class expectedType)
     Parses an expression into a ValueExpression for later evaluation.
abstract public  ValueExpressioncreateValueExpression(Object instance, Class expectedType)
     Creates a ValueExpression that wraps an object instance.
public static  ExpressionFactorynewInstance()
     Creates a new instance of a ExpressionFactory. This method uses the following ordered lookup procedure to determine the ExpressionFactory implementation class to load:
  • Use the Services API (as detailed in the JAR specification). If a resource with the name of META-INF/services/javax.el.ExpressionFactory exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
public static  ExpressionFactorynewInstance(Properties properties)
    

Create a new instance of a ExpressionFactory, with optional properties.




Method Detail
coerceToType
abstract public Object coerceToType(Object obj, Class targetType)(Code)
Coerces an object to a specific type according to the EL type conversion rules.

An ELException is thrown if an error results from applying the conversion rules.


Parameters:
  obj - The object to coerce.
Parameters:
  targetType - The target type for the coercion.
throws:
  ELException - thrown if an error results from applying theconversion rules.



createMethodExpression
abstract public MethodExpression createMethodExpression(ELContext context, String expression, Class expectedReturnType, Class[] expectedParamTypes)(Code)
Parses an expression into a MethodExpression for later evaluation. Use this method for expressions that refer to methods.

If the expression is a String literal, a MethodExpression is created, which when invoked, returns the String literal, coerced to expectedReturnType. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.16 Type Conversion").

This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an ELException.


Parameters:
  context - The EL context used to parse the expression.The FunctionMapper and VariableMapperstored in the ELContextare used to resolve functions and variables found inthe expression. They can be null, in whichcase functions or variables are not supported for this expression.The objectreturned must invoke the same functions and access the same variablemappingsregardless of whetherthe mappings in the provided FunctionMapperand VariableMapper instanceschange between callingExpressionFactory.createMethodExpression() and anymethod on MethodExpression.

Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.


Parameters:
  expression - The expression to parse
Parameters:
  expectedReturnType - The expected return type for the methodto be found. After evaluating the expression, theMethodExpression must check that the return type ofthe actual method matches this type. Passing in a value ofnull indicates the caller does not care what thereturn type is, and the check is disabled.
Parameters:
  expectedParamTypes - The expected parameter types for the method tobe found. Must be an array with no elements if there areno parameters expected. It is illegal to pass null. The parsed expression
throws:
  ELException - Thrown if there are syntactical errors in theprovided expression.
throws:
  NullPointerException - if paramTypes is null.



createValueExpression
abstract public ValueExpression createValueExpression(ELContext context, String expression, Class expectedType)(Code)
Parses an expression into a ValueExpression for later evaluation. Use this method for expressions that refer to values.

This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an ELException.


Parameters:
  context - The EL context used to parse the expression.The FunctionMapper and VariableMapperstored in the ELContextare used to resolve functions and variables found inthe expression. They can be null, in which casefunctions or variables are not supported for this expression.The objectreturned must invoke the same functions and access the samevariable mappings regardless of whetherthe mappings in the provided FunctionMapperand VariableMapper instanceschange between callingExpressionFactory.createValueExpression() and anymethod on ValueExpression.

Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.


Parameters:
  expression - The expression to parse
Parameters:
  expectedType - The type the result of the expressionwill be coerced to after evaluation. The parsed expression
throws:
  NullPointerException - Thrown if expectedType is null.
throws:
  ELException - Thrown if there are syntactical errors in theprovided expression.



createValueExpression
abstract public ValueExpression createValueExpression(Object instance, Class expectedType)(Code)
Creates a ValueExpression that wraps an object instance. This method can be used to pass any object as a ValueExpression. The wrapper ValueExpression is read only, and returns the wrapped object via its getValue() method, optionally coerced.
Parameters:
  instance - The object instance to be wrapped.
Parameters:
  expectedType - The type the result of the expressionwill be coerced to after evaluation. There will be nocoercion if it is Object.class,
throws:
  NullPointerException - Thrown if expectedType is null.



newInstance
public static ExpressionFactory newInstance()(Code)
Creates a new instance of a ExpressionFactory. This method uses the following ordered lookup procedure to determine the ExpressionFactory implementation class to load:
  • Use the Services API (as detailed in the JAR specification). If a resource with the name of META-INF/services/javax.el.ExpressionFactory exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
  • Use the properties file "lib/el.properties" in the JRE directory. If this file exists and it is readable by the java.util.Properties.load(InputStream) method, and it contains an entry whose key is "javax.el.ExpressionFactory", then the value of that entry is used as the name of the implementation class.
  • Use the javax.el.ExpressionFactory system property. If a system property with this name is defined, then its value is used as the name of the implementation class.
  • Use a platform default implementation.



newInstance
public static ExpressionFactory newInstance(Properties properties)(Code)

Create a new instance of a ExpressionFactory, with optional properties. This method uses the same lookup procedure as the one used in newInstance().

If the argument properties is not null, and if the implementation contains a constructor with a single parameter of type java.util.Properties, then the constructor is used to create the instance.

Properties are optional and can be ignored by an implementation.

The name of a property should start with "javax.el."

The following are some suggested names for properties.

  • javax.el.cacheSize


Parameters:
  properties - Properties passed to the implementation.If null, then no properties.



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.