add functions to obtain Java classes to java.base
See original GitHub issueAs part of my continuing campaign to alleviate the need to use ceylon.interop.java
for most programming tasks, I propose adding the following functions to java.base
(in java.lang
, I guess):
Class<out T> classForInstance<T>(T instance)
Class<out T> classForModel<T>(ClassOrInterface<T> model)
Class<out Anything> classForDeclaration(ClassOrInterfaceDeclaration declaration)
classForAnnotation()
???ObjectArray<StackTraceElement> stackTrace(Throwable throwable)
This would alleviate the need to use ceylon.interop.java
for anything except collection adaptors.
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (23 by maintainers)
Top Results From Across the Web
java add function to extended class [duplicate] - Stack Overflow
getmDataset() you are trying to access a static method of the class MainAdapter and getmDataset() is not static. Use as (new MainAdapter()).
Read more >Java Programming Tutorial - 07 - Adding a Method to a Class
Get more lessons like this at http://www.MathTutorDVD.comLearn how to program in java with our online tutorial. We will cover variables, ...
Read more >Java Class Methods - W3Schools
Access Methods With an Object · 1) We created a custom Main class with the class keyword. · 2) We created the fullThrottle()...
Read more >Inheritance - Learning the Java Language
In the Java language, classes can be derived from other classes, thereby inheriting fields and methods from those classes.
Read more >Functions - Learn Java - Free Interactive Java Tutorial
Non static methods in Java are used more than static methods. Those methods can only be run on objects and not on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There would be Ceylon source code for a Ceylon module called
java.lang
which would include declarations for everything added tojava.lang
. All declarations would benative
. Ceylon-docs for this module would be published to Herd.Users wouldn’t actually import this module. From their perspective, these declarations would be made available by importing
java.base
, just as thejava.lang
declarations in Oracle’s Java-docs are made available by importingjava.base
.Well, I could have, but as was suggested here above, it’s weird that there would be toplevel functions in
java.lang
when Java doesn’t have toplevel functions.