1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.annotation.renderer

File AnnotationEvent.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
4
3
2
87
25
3
0.75
1.33
1.5
1

Classes

Class Line # Actions
AnnotationEvent 31 4 0% 3 0
1.0100%
AnnotationEvent.AnnotationEventType 38 0 - 0 0
-1.0 -
 

Contributing tests

This file is covered by 62 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.annotation.renderer;
21   
22    import org.xwiki.annotation.Annotation;
23   
24    /**
25    * Class to hold information about an annotation event, namely its type (annotation start or end) and the annotation for
26    * which the event takes place.
27    *
28    * @version $Id: c2e0300737f2106c7dcfec20cdbce89d21f824cc $
29    * @since 2.3M1
30    */
 
31    public class AnnotationEvent
32    {
33    /**
34    * The type of annotation event that can occur during the processing.
35    *
36    * @version $Id: c2e0300737f2106c7dcfec20cdbce89d21f824cc $
37    */
 
38    public enum AnnotationEventType
39    {
40    /**
41    * Marks the start of an annotation.
42    */
43    START,
44    /**
45    * Marks the end of an annotation.
46    */
47    END
48    }
49   
50    /**
51    * The type of the annotation event that took place.
52    */
53    private AnnotationEventType type;
54   
55    /**
56    * The annotation for which this event took place.
57    */
58    private Annotation annotation;
59   
60    /**
61    * Builds an annotation event for the passed annotation and type.
62    *
63    * @param type the type of the annotation event
64    * @param ann the annotation for which the event took place
65    */
 
66  176 toggle public AnnotationEvent(AnnotationEventType type, Annotation ann)
67    {
68  176 this.type = type;
69  176 annotation = ann;
70    }
71   
72    /**
73    * @return the type
74    */
 
75  182 toggle public AnnotationEventType getType()
76    {
77  182 return type;
78    }
79   
80    /**
81    * @return the annotation
82    */
 
83  176 toggle public Annotation getAnnotation()
84    {
85  176 return annotation;
86    }
87    }