Created
May 26, 2011 23:44
-
-
Save dylanz/994371 to your computer and use it in GitHub Desktop.
TortugaParsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####### Annotation | |
[sun-2:Tortuga] cat src/TortugaTable.java | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface TortugaTable { | |
String tableName(); | |
} | |
####### Class | |
[sun-2:Tortuga] cat src/User.java | |
@TortugaTable(tableName = "users") | |
public class User { | |
public static void main(String[] args) { | |
TortugaTable table = User.class.getAnnotation(TortugaTable.class); | |
System.out.println(table.tableName()); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment