Java Doc for Types.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » bsh » 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 » Swing Library » jEdit » org.gjt.sp.jedit.bsh 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.jedit.bsh.Types

Types
class Types (Code)
Static routines supporing type comparison and conversion in BeanShell. The following are notes on type comparison and conversion in BeanShell.


Field Summary
final static  intCASTASSIGNMENT
    
final static  intFIRST_ROUND_ASSIGNABLELAST_ROUND_ASSIGNABLE
    
static  PrimitiveINVALID_CAST
    
final static  intJAVA_BASE_ASSIGNABLEJAVA_BOX_TYPES_ASSIGABLEJAVA_VARARGS_ASSIGNABLEBSH_ASSIGNABLE
    
static  PrimitiveVALID_CAST
     Special value that indicates by identity that the result of a cast operation was a valid cast.


Method Summary
static  UtilEvalErrorcastError(Class lhsType, Class rhsType, int operation)
    
static  UtilEvalErrorcastError(String lhs, String rhs, int operation)
    
public static  ObjectcastObject(Object fromValue, Class toType, int operation)
     Attempt to cast an object instance to a new type if possible via BeanShell extended syntax rules.
public static  Class[]getTypes(Object[] args)
     Get the Java types of the arguments.
static  booleanisBshAssignable(Class toType, Class fromType)
     Test if a type can be converted to another type via BeanShell extended syntax rules (a superset of Java conversion rules).
static  booleanisJavaAssignable(Class lhsType, Class rhsType)
     Test if a conversion of the rhsType type to the lhsType type is legal via standard Java assignment conversion rules (i.e.
static  booleanisJavaBaseAssignable(Class lhsType, Class rhsType)
     Is the assignment legal via original Java (up to version 1.4) assignment rules, not including auto-boxing/unboxing.
static  booleanisJavaBoxTypesAssignable(Class lhsType, Class rhsType)
     Determine if the type is assignable via Java boxing/unboxing rules.
static  booleanisSignatureAssignable(Class[] from, Class[] to, int round)
     Is the 'from' signature (argument types) assignable to the 'to' signature (candidate method types) This method handles the special case of null values in 'to' types indicating a loose type and matching anything.

Field Detail
CASTASSIGNMENT
final static int CASTASSIGNMENT(Code)



FIRST_ROUND_ASSIGNABLELAST_ROUND_ASSIGNABLE
final static int FIRST_ROUND_ASSIGNABLELAST_ROUND_ASSIGNABLE(Code)



INVALID_CAST
static Primitive INVALID_CAST(Code)



JAVA_BASE_ASSIGNABLEJAVA_BOX_TYPES_ASSIGABLEJAVA_VARARGS_ASSIGNABLEBSH_ASSIGNABLE
final static int JAVA_BASE_ASSIGNABLEJAVA_BOX_TYPES_ASSIGABLEJAVA_VARARGS_ASSIGNABLEBSH_ASSIGNABLE(Code)



VALID_CAST
static Primitive VALID_CAST(Code)
Special value that indicates by identity that the result of a cast operation was a valid cast. This is used by castObject() and castPrimitive() in the checkOnly mode of operation. This value is a Primitive type so that it can be returned by castPrimitive.





Method Detail
castError
static UtilEvalError castError(Class lhsType, Class rhsType, int operation)(Code)
Return a UtilEvalError or UtilTargetError wrapping a ClassCastException describing an illegal assignment or illegal cast, respectively.



castError
static UtilEvalError castError(String lhs, String rhs, int operation)(Code)



castObject
public static Object castObject(Object fromValue, Class toType, int operation) throws UtilEvalError(Code)
Attempt to cast an object instance to a new type if possible via BeanShell extended syntax rules. These rules are always a superset of Java conversion rules. If you wish to impose context sensitive conversion rules then you must test before calling this method.

This method can handle fromValue Primitive types (representing primitive casts) as well as fromValue object casts requiring interface generation, etc.
Parameters:
  toType - the class type of the cast result, which may includeprimitive types, e.g. Byte.TYPE
Parameters:
  fromValue - an Object or bsh.Primitive primitive value (includingPrimitive.NULL or Primitive.VOID )
See Also:   Types.isBshAssignable(Class,Class)




getTypes
public static Class[] getTypes(Object[] args)(Code)
Get the Java types of the arguments.



isBshAssignable
static boolean isBshAssignable(Class toType, Class fromType)(Code)
Test if a type can be converted to another type via BeanShell extended syntax rules (a superset of Java conversion rules).



isJavaAssignable
static boolean isJavaAssignable(Class lhsType, Class rhsType)(Code)
Test if a conversion of the rhsType type to the lhsType type is legal via standard Java assignment conversion rules (i.e. without a cast). The rules include Java 5 autoboxing/unboxing.

For Java primitive TYPE classes this method takes primitive promotion into account. The ordinary Class.isAssignableFrom() does not take primitive promotion conversions into account. Note that Java allows additional assignments without a cast in combination with variable declarations and array allocations. Those are handled elsewhere (maybe should be here with a flag?)

This class accepts a null rhsType type indicating that the rhsType was the value Primitive.NULL and allows it to be assigned to any reference lhsType type (non primitive).

Note that the getAssignableForm() method is the primary bsh method for checking assignability. It adds additional bsh conversions, etc.
See Also:   Types.isBshAssignable(Class,Class)
Parameters:
  lhsType - assigning from rhsType to lhsType
Parameters:
  rhsType - assigning from rhsType to lhsType




isJavaBaseAssignable
static boolean isJavaBaseAssignable(Class lhsType, Class rhsType)(Code)
Is the assignment legal via original Java (up to version 1.4) assignment rules, not including auto-boxing/unboxing.
Parameters:
  rhsType - may be null to indicate primitive null value



isJavaBoxTypesAssignable
static boolean isJavaBoxTypesAssignable(Class lhsType, Class rhsType)(Code)
Determine if the type is assignable via Java boxing/unboxing rules.



isSignatureAssignable
static boolean isSignatureAssignable(Class[] from, Class[] to, int round)(Code)
Is the 'from' signature (argument types) assignable to the 'to' signature (candidate method types) This method handles the special case of null values in 'to' types indicating a loose type and matching anything.



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.