Code example for Annotation

Methods: annotationType

0
     * Method called to add specified annotation in the Map, but 
     * only if it didn't yet exist. 
     */ 
    public void addIfNotPresent(Annotation ann)
    { 
        if (_annotations == null || !_annotations.containsKey(ann.annotationType())) {
            _add(ann);
        } 
    } 
 
    /** 
     * Method called to add specified annotation in the Map. 
     */ 
    public void add(Annotation ann) {
        _add(ann);
    } 
 
    @Override 
    public String toString()
    { 
        if (_annotations == null) {
            return "[null]"; 
        } 
        return _annotations.toString();
    } 
 
    /* 
    /********************************************************** 
    /* Helper methods 
    /********************************************************** 
     */ 
 
    protected final void _add(Annotation ann)
    { 
        if (_annotations == null) {
            _annotations = new HashMap<Class<? extends Annotation>,Annotation>();
        } 
        _annotations.put(ann.annotationType(), ann);
    } 
} 
 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE