The Artima Developer Community
Sponsored Link

Java Buzz Forum
Announce - Orthodox Type Reflection Library

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Vernum

Posts: 58
Nickname: tpv
Registered: Dec, 2002

Tim Vernum is passionate about designing secure systems
Announce - Orthodox Type Reflection Library Posted: Feb 22, 2008 5:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Tim Vernum.
Original Post: Announce - Orthodox Type Reflection Library
Feed Title: A word used to describe something
Feed URL: http://blog.adjective.org/feed/category/Development/rss2
Feed Description: Tim's random musings on software development, java, jetty and other such frivolities.
Latest Java Buzz Posts
Latest Java Buzz Posts by Tim Vernum
Latest Posts From A word used to describe something

Advertisement

Prior to the release of Java 5, the Java library had 1 class that provided access to type information at runtime - java.lang.Class. However, with the introduction of generics in Java 5, this has been extended significantly. Dealing with all these classes, and working with them at runtime, is overly complex, and reduces the power of generics.

Orthodox is a library that makes it easier to work with the Java type system at runtime.

In Java 5, the type system includes the interfaces:

  • java.lang.reflect.Type
  • java.lang.reflect.ParameterizedType
  • java.lang.reflect.WildcardType
  • java.lang.reflect.TypeVariable
  • java.lang.reflect.GenericArrayType
  • java.lang.reflect.GenericDeclaration

Have you ever tried to use those interfaces? It's not straight forward.

Imagine a class com.example.Bean has a method getList() that returns an object of type java.util.List. You want to know what type of object that list will contain. Is it a list of Objects? A list of Strings? Something else?

If we look at the source code, we might see:

List< ? extends CharSequence > getList() { /* ... */ }

But how do we get access to that information at runtime? You might think it's impossible, due to type erasure, but the information is actually there, it's just that it's hard to get to because of all those different ways of representing a type.

Orthodox makes it easy to get at that information (and much more).

At the moment it's a 0.5 release, because it hasn't had enough real world usage to be sure that the API is right. Since the whole point of orthodox is to put a better API on top of java.lang.reflect.Type, getting the API right is important. And I don't want to declare it a 1.0 release until I'm happy that I've achieved that.

However, don't let the 0.5 tag scare you into thinking it's unstable or untested - I've put it through its paces, and it works like a charm.

Read: Announce - Orthodox Type Reflection Library

Topic: January 2008 Javva The Hutt Previous Topic   Next Topic Topic: Unsatisfied

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use