Submit Search
Upload
Annotations
•
Download as PPTX, PDF
•
0 likes
•
186 views
Ostap Maliuvanchuk
Follow
Magic behind the annotations in Java
Read less
Read more
Technology
Report
Share
Report
Share
1 of 19
Download now
Recommended
Learning Web Development with Django - Templates
Learning Web Development with Django - Templates
Hsuan-Wen Liu
Advanced R cheat sheet
Advanced R cheat sheet
Dr. Volkan OBAN
Filter
Filter
Soujanya V
Namespace and methods
Namespace and methods
JayanthiNeelampalli
Bio solr building a better search for bioinformatics
Bio solr building a better search for bioinformatics
Charlie Hull
Generics
Generics
Kongu Engineering College, Perundurai, Erode
Collections - Array List
Collections - Array List
Hitesh-Java
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot Potato
MongoDB
Recommended
Learning Web Development with Django - Templates
Learning Web Development with Django - Templates
Hsuan-Wen Liu
Advanced R cheat sheet
Advanced R cheat sheet
Dr. Volkan OBAN
Filter
Filter
Soujanya V
Namespace and methods
Namespace and methods
JayanthiNeelampalli
Bio solr building a better search for bioinformatics
Bio solr building a better search for bioinformatics
Charlie Hull
Generics
Generics
Kongu Engineering College, Perundurai, Erode
Collections - Array List
Collections - Array List
Hitesh-Java
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot Potato
MongoDB
Java interface
Java interface
GaneshKumarKanthiah
Java Collections
Java Collections
Kongu Engineering College, Perundurai, Erode
Java 103 intro to java data structures
Java 103 intro to java data structures
agorolabs
Collections - Lists, Sets
Collections - Lists, Sets
Hitesh-Java
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Lucidworks
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
PawanMM
Introduction java programming
Introduction java programming
Nanthini Kempaiyan
Introduction on Data Structures
Introduction on Data Structures
Nanthini Kempaiyan
Java Programming
Java Programming
Nanthini Kempaiyan
Java 8 and Best Practices
Java 8 and Best Practices
Buddhini Seneviratne
Lecture 9
Lecture 9
talha ijaz
Java script prototype_hack
Java script prototype_hack
LearningTech
Java keywords
Java keywords
Ravi_Kant_Sahu
List classes
List classes
Ravi_Kant_Sahu
Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Rohit Vipin Mathews
Reflection in C Sharp
Reflection in C Sharp
Harman Bajwa
Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics
Hitesh-Java
How to Teach the Haggadah
How to Teach the Haggadah
The Lookstein Center
Challenge of ASEAN
Challenge of ASEAN
Gus Agosto
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
Andrew Jang
雲端教戰
雲端教戰
豆泥 黃
Dixien LLC's Commitment to Sustainability
Dixien LLC's Commitment to Sustainability
Dixien, LLC
More Related Content
What's hot
Java interface
Java interface
GaneshKumarKanthiah
Java Collections
Java Collections
Kongu Engineering College, Perundurai, Erode
Java 103 intro to java data structures
Java 103 intro to java data structures
agorolabs
Collections - Lists, Sets
Collections - Lists, Sets
Hitesh-Java
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Lucidworks
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
PawanMM
Introduction java programming
Introduction java programming
Nanthini Kempaiyan
Introduction on Data Structures
Introduction on Data Structures
Nanthini Kempaiyan
Java Programming
Java Programming
Nanthini Kempaiyan
Java 8 and Best Practices
Java 8 and Best Practices
Buddhini Seneviratne
Lecture 9
Lecture 9
talha ijaz
Java script prototype_hack
Java script prototype_hack
LearningTech
Java keywords
Java keywords
Ravi_Kant_Sahu
List classes
List classes
Ravi_Kant_Sahu
Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Rohit Vipin Mathews
Reflection in C Sharp
Reflection in C Sharp
Harman Bajwa
Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics
Hitesh-Java
What's hot
(17)
Java interface
Java interface
Java Collections
Java Collections
Java 103 intro to java data structures
Java 103 intro to java data structures
Collections - Lists, Sets
Collections - Lists, Sets
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Searching the Stuff of Life - BioSolr: Presented by Matt Pearce & Alan Woodwa...
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
Introduction java programming
Introduction java programming
Introduction on Data Structures
Introduction on Data Structures
Java Programming
Java Programming
Java 8 and Best Practices
Java 8 and Best Practices
Lecture 9
Lecture 9
Java script prototype_hack
Java script prototype_hack
Java keywords
Java keywords
List classes
List classes
Reflection power pointpresentation ppt
Reflection power pointpresentation ppt
Reflection in C Sharp
Reflection in C Sharp
Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics
Viewers also liked
How to Teach the Haggadah
How to Teach the Haggadah
The Lookstein Center
Challenge of ASEAN
Challenge of ASEAN
Gus Agosto
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
Andrew Jang
雲端教戰
雲端教戰
豆泥 黃
Dixien LLC's Commitment to Sustainability
Dixien LLC's Commitment to Sustainability
Dixien, LLC
Presentacion rodrigo campos
Presentacion rodrigo campos
rcz24
English Idioms and Expressions 2
English Idioms and Expressions 2
BigTickProductions
Marketing Plan MyAzaria
Marketing Plan MyAzaria
Jasa Pembuatan Website
Race & Gender Discrimination in the U.S labor market
Race & Gender Discrimination in the U.S labor market
Moh'd A
Sesión 1.3. prevención de iaas
Sesión 1.3. prevención de iaas
Harrison Sandoval Castillo
Acta de Constitución de Podemos París
Acta de Constitución de Podemos París
Podemos París
Labour problem,industrailization, uranization
Labour problem,industrailization, uranization
Student
Lesson plan
Lesson plan
Rakesh Saini
Physiocarcy
Physiocarcy
Prabha Panth
Viewers also liked
(14)
How to Teach the Haggadah
How to Teach the Haggadah
Challenge of ASEAN
Challenge of ASEAN
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
Applying for Jobs in British Columbia's Public Schools | October 2013 | Make ...
雲端教戰
雲端教戰
Dixien LLC's Commitment to Sustainability
Dixien LLC's Commitment to Sustainability
Presentacion rodrigo campos
Presentacion rodrigo campos
English Idioms and Expressions 2
English Idioms and Expressions 2
Marketing Plan MyAzaria
Marketing Plan MyAzaria
Race & Gender Discrimination in the U.S labor market
Race & Gender Discrimination in the U.S labor market
Sesión 1.3. prevención de iaas
Sesión 1.3. prevención de iaas
Acta de Constitución de Podemos París
Acta de Constitución de Podemos París
Labour problem,industrailization, uranization
Labour problem,industrailization, uranization
Lesson plan
Lesson plan
Physiocarcy
Physiocarcy
Similar to Annotations
ITFT - Java
ITFT - Java
Blossom Sood
Android webinar class_java_review
Android webinar class_java_review
Edureka!
Java
Java
Prabhat gangwar
Array.pptx
Array.pptx
ssuser8698eb
Java Tutorials
Java Tutorials
Woxa Technologies
arrays in c# including Classes handling arrays
arrays in c# including Classes handling arrays
JayanthiM19
java training faridabad
java training faridabad
Woxa Technologies
Programming with Python - Week 3
Programming with Python - Week 3
Ahmet Bulut
OOP-java-variables.pptx
OOP-java-variables.pptx
ssuserb1a18d
Programming in java basics
Programming in java basics
LovelitJose
A brief tour of modern Java
A brief tour of modern Java
Sina Madani
Tuples, Dicts and Exception Handling
Tuples, Dicts and Exception Handling
PranavSB
Core java complete ppt(note)
Core java complete ppt(note)
arvind pandey
#_ varible function
#_ varible function
abdullah al mahamud rosi
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
Pray Desai
Java introduction
Java introduction
Samsung Electronics Egypt
Javascript
Javascript
Sunil Thakur
Core java concepts
Core java concepts
laratechnologies
C Sharp Course 101.5
C Sharp Course 101.5
Shahed Chowdhuri
Python with data Sciences
Python with data Sciences
Krishna Mohan Mishra
Similar to Annotations
(20)
ITFT - Java
ITFT - Java
Android webinar class_java_review
Android webinar class_java_review
Java
Java
Array.pptx
Array.pptx
Java Tutorials
Java Tutorials
arrays in c# including Classes handling arrays
arrays in c# including Classes handling arrays
java training faridabad
java training faridabad
Programming with Python - Week 3
Programming with Python - Week 3
OOP-java-variables.pptx
OOP-java-variables.pptx
Programming in java basics
Programming in java basics
A brief tour of modern Java
A brief tour of modern Java
Tuples, Dicts and Exception Handling
Tuples, Dicts and Exception Handling
Core java complete ppt(note)
Core java complete ppt(note)
#_ varible function
#_ varible function
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
Java introduction
Java introduction
Javascript
Javascript
Core java concepts
Core java concepts
C Sharp Course 101.5
C Sharp Course 101.5
Python with data Sciences
Python with data Sciences
Recently uploaded
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
The Digital Insurer
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
carlostorres15106
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Deakin University
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Wonjun Hwang
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Scott Keck-Warren
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Miki Katsuragi
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Fwdays
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Neo4j
Recently uploaded
(20)
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Annotations
1.
@Annotations
2.
Before Java 5 •
transient • comments & java doc (@deprecated) • interfaces
3.
Where to use? •
classes • fields • methods • packages • variables • types ( from Java 8)
4.
@NotNull String array1
[][]; String array2 @NotNull [][]; String array3 [] @NotNull[]; String @NotNull[][] array4; String @NotNull [] @NotNull[] array5; @NotNull String @NotNull[] @NotNull[] array6;
5.
@NonNull String name; List<@NonNull
String> names; class UnmodifiableList<T> implements @Readonly List<@Readonly T> {...} email = (@Email String) input; new @Information MyObject(); void doSomething() throws @ImportantForMe MyException { ... }
6.
Use cases • Information
for the compiler • Documentation • Code generation • Runtime processing
7.
@Retention • SOURCE • CLASS •
RUNTIME
8.
@Target • ANNOTATION_TYPE • CONSTRUCTOR •
FIELD • LOCAL_VARIABLE • METHOD • PACKAGE • TYPE_USE (TYPE_PARAMETER & TYPE)
9.
• @Deprecated • @Inherited •
@Deprecated • @SuppressWarnings • @Override • @SafeVarargs
10.
Java 8 • @Repeatable •
@FunctionalInterface
11.
Example @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.PARAMETER}) public @interface
Option { String value(); Class type() default String.class; boolean hasArg() default true; boolean isRequired() default false; }
12.
@Demo
13.
@Metaphor public interface Life
extends Box<Chocolate> { }
14.
@Oxymoron public interface DisassemblerFactory
{ Disassembler createDisassembler(); }
15.
@LOL @Facepalm @WTF("just use
Collections.reverse()") @Booyah private static <T> void invertOrdering(List<T> list) { for (int i = 0; i < list.size() / 2; i++) { int j = list.size() - 1 - i; T item1 = list.get(i); T item2 = list.get(j); list.set(i, item2); list.set(j, item1); } }
16.
@Magic public static int
negate(int n) { return new Byte((byte) 0xFF).hashCode() / (int) (short) 'uFFFF' * ~0 * Character.digit ('0', 0) * n * (Integer.MAX_VALUE * 2 + 1) / (Byte.MIN_VALUE >> 7) * (~1 | 1); }
17.
public void setBonusMultiplier(@ThisHadBetterNotBe(NEGATIVE) double multiplier)
{ this.multiplier = multiplier; }
18.
@ThisWouldBeOneLineIn( language = "haskell" toWit
= "product [1..n]") public int factorial(int n) { int fac = 1; for (int i = 1; i <= n; i++) { fac *= i; } return fac; }
19.
@Thanks
Download now