The Artima Developer Community
Sponsored Link

Java Buzz Forum
JSR-175: Custom Metadata for Java [Lone Star Software Symposium]

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
Michael Cote

Posts: 10306
Nickname: bushwald
Registered: May, 2003

Cote is a programmer in Austin, Texas.
JSR-175: Custom Metadata for Java [Lone Star Software Symposium] Posted: Jul 12, 2004 2:42 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Michael Cote.
Original Post: JSR-175: Custom Metadata for Java [Lone Star Software Symposium]
Feed Title: Cote's Weblog: Coding, Austin, etc.
Feed URL: https://cote.io/feed/
Feed Description: Using Java to get to the ideal state.
Latest Java Buzz Posts
Latest Java Buzz Posts by Michael Cote
Latest Posts From Cote's Weblog: Coding, Austin, etc.

Advertisement

Ted Neward did this one as well. Metadata, to shortcut to an explanation, is XDoclet built into the language, compiler, and runtime.

Metadata, or "annotations," can be used in places of marker interfaces (like Serializable or Cloneable), and in place of naming conventions like getProperty() and setProperty().

If you want to mark something as Serializable, you use an annotation to mark it. If you have modifier and an accessor methods for a property, you mark those methods with an annotation. Then, at runtime, instead of seeing if a class implement Serializable, or reflectively calling a method by naming convention, you lookup the annotations and use that metadata.

similar to asserts, you can enable annotations to be enabled or disabled at runtime. It's a little more complicated:

  • Annotations can be available to pre-processors only. Once it's running, or compiled, the annotations aren't available.
  • They can be available in the compiled code, for post-processors.
  • They can be available at runtime

I'm not sure if there's a hiarchy to these, or if they can be turned on and off independent of each other.

Read: JSR-175: Custom Metadata for Java [Lone Star Software Symposium]

Topic: XAML4J: Jelly gets new life Previous Topic   Next Topic Topic: Project Looking Glass : A Java-Based 3D Desktop Environment

Sponsored Links



Google
  Web Artima.com   

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