Java Doc for TypeChecker.java in  » XML » XPath-Saxon » net » sf » saxon » expr » 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 » XML » XPath Saxon » net.sf.saxon.expr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.expr.TypeChecker

TypeChecker
final public class TypeChecker (Code)
This class provides Saxon's type checking capability. It contains a static method, staticTypeCheck, which is called at compile time to perform type checking of an expression. This class is never instantiated.




Method Summary
public static  XPathExceptionebvError(Expression exp, TypeHierarchy th)
     Test whether a given expression is capable of returning a value that has an effective boolean value.
public static  ExpressionstaticTypeCheck(Expression supplied, SequenceType req, boolean backwardsCompatible, RoleLocator role, StaticContext env)
     Check an expression against a required type, modifying it if necessary.

This method takes the supplied expression and checks to see whether it is known statically to conform to the specified type.

public static  ExpressionstrictTypeCheck(Expression supplied, SequenceType req, RoleLocator role, StaticContext env)
     Check an expression against a required type, modifying it if necessary.
public static  DynamicErrortestConformance(Value val, SequenceType requiredType, Configuration config)
    



Method Detail
ebvError
public static XPathException ebvError(Expression exp, TypeHierarchy th)(Code)
Test whether a given expression is capable of returning a value that has an effective boolean value. null if the expression is OK (optimistically), an exception object if not



staticTypeCheck
public static Expression staticTypeCheck(Expression supplied, SequenceType req, boolean backwardsCompatible, RoleLocator role, StaticContext env) throws StaticError(Code)
Check an expression against a required type, modifying it if necessary.

This method takes the supplied expression and checks to see whether it is known statically to conform to the specified type. There are three possible outcomes. If the static type of the expression is a subtype of the required type, the method returns the expression unchanged. If the static type of the expression is incompatible with the required type (for example, if the supplied type is integer and the required type is string) the method throws an exception (this results in a compile-time type error being reported). If the static type is a supertype of the required type, then a new expression is constructed that evaluates the original expression and checks the dynamic type of the result; this new expression is returned as the result of the method.

The rules applied are those for function calling in XPath, that is, the rules that the argument of a function call must obey in relation to the signature of the function. Some contexts require slightly different rules (for example, operands of polymorphic operators such as "+"). In such cases this method cannot be used.

Note that this method does not do recursive type-checking of the sub-expressions.


Parameters:
  supplied - The expression to be type-checked
Parameters:
  req - The required type for the context in which the expression is used
Parameters:
  backwardsCompatible - True if XPath 1.0 backwards compatibility mode is applicable
Parameters:
  role - Information about the role of the subexpression within thecontaining expression, used to provide useful error messages
Parameters:
  env - The static context containing the types being checked. At presentthis is used only to locate a NamePool The original expression if it is type-safe, or the expressionwrapped in a run-time type checking expression if not.
throws:
  net.sf.saxon.trans.StaticError - if the supplied type is statically inconsistent with therequired type (that is, if they have no common subtype)



strictTypeCheck
public static Expression strictTypeCheck(Expression supplied, SequenceType req, RoleLocator role, StaticContext env) throws StaticError(Code)
Check an expression against a required type, modifying it if necessary. This is a variant of the method TypeChecker.staticTypeCheck used for expressions that declare variables in XQuery. In these contexts, conversions such as numeric type promotion and atomization are not allowed.
Parameters:
  supplied - The expression to be type-checked
Parameters:
  req - The required type for the context in which the expression is used
Parameters:
  role - Information about the role of the subexpression within thecontaining expression, used to provide useful error messages
Parameters:
  env - The static context containing the types being checked. At presentthis is used only to locate a NamePool The original expression if it is type-safe, or the expressionwrapped in a run-time type checking expression if not.
throws:
  net.sf.saxon.trans.StaticError - if the supplied type is statically inconsistent with therequired type (that is, if they have no common subtype)



testConformance
public static DynamicError testConformance(Value val, SequenceType requiredType, Configuration config)(Code)
Test whether a given value conforms to a given type
Parameters:
  val - the value
Parameters:
  requiredType - the required type
Parameters:
  config - a DynamicError describing the error condition if the value doesn't conform;or null if it does.



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.