Tutorial by Examples: ann

When declaring an annotation, meta-info can be included using the following meta-annotations: @Target: specifies the possible kinds of elements which can be annotated with the annotation (classes, functions, properties, expressions etc.) @Retention specifies whether the annotation is store...
Add any JSR 303 implementation to your classpath. Popular one used is Hibernate validator from Hibernate. <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependen...
What Are Notification Channels? Notification channels enable us app developers to group our notifications into groups—channels—with the user having the ability to modify notification settings for the entire channel at once. For example, for each channel, users can completely block all notifications...
Except main @conditional annotation there are set of similar annotation to be used for different cases. Class conditions The @ConditionalOnClass and @ConditionalOnMissingClass annotations allows configuration to be included based on the presence or absence of specific classes. E.g. when OObjectDa...
Prior to iOS 7 when you want to scan a QR code, we might need to rely on third party frameworks or libraries like zBar or zXing. But Apple introduced AVCaptureMetaDataOutput from iOS 7 for reading barcodes. To read QR code using AVFoundation we need to setup/create AVCaptureSession and use captureO...
If You have Role: +-----------------------------+ | roleId | name | discription | +-----------------------------+ Rights: +-----------------------------+ | rightId | name | discription| +-----------------------------+ rightrole +------------------+ | roleId | rightId | +----------...
public class Foo { private String name; public Foo(@NonNull String name){...}; ... } Here @NonNull is annotation which is processed compile time by the android studio to warn you that the particular function needs non null parameter.
There are three types of annotations. Marker Annotation - annotation that has no method @interface CustomAnnotation {} Single-Value Annotation - annotation that has one method @interface CustomAnnotation { int value(); } Multi-Value Annotation - annotation that...
For creating custom annotations we need to decide Target - on which these annotations will work on like field level, method level, type level etc. Retention - to what level annotation will be available. For this, we have built in custom annotations. Check out these mostly used ones: @Target...
Node's require is also very helpful when used in tandem with an NPM package. Say, for example, you would like to use the NPM package require in a file named getWeather.js. After NPM installing your package through your command line (git install request), you are ready to use it. Your getWeather.js f...
We use type annotations to avoid ambiguity. Type applications can be used for the same purpose. For example x :: Num a => a x = 5 main :: IO () main = print x This code has an ambiguity error. We know that a has a Num instance, and in order to print it we know it needs a Show instance. T...
Data annotations are a way of adding more contextual information to classes or members of a class. There are three main categories of annotations: Validation Attributes: add validation criteria to data Display Attributes: specify how the data should be displayed to the user Modelling Attributes...
An Annotation parameter can accept multiple values if it is defined as an array. For example the standard annotation @SuppressWarnings is defined like this: public @interface SuppressWarnings { String[] value(); } The value parameter is an array of Strings. You can set multiple values by u...
it can happen that you use a scanner with the System.in as parameter for the constructor, then you need to be aware that closing the scanner will close the InputStream too giving as next that every try to read the input on that (Or any other scanner object) will throw an java.util.NoSuchElementExcep...
Swift: mapView.showAnnotations(mapView.annotations, animated: true) Objective-C: [mapView showAnnotations:mapView.annotations animated:YES]; Demo:

Page 7 of 7