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

File ComponentDescriptorRemovedEvent.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

2
8
6
1
98
35
7
0.88
1.33
6
1.17

Classes

Class Line # Actions
ComponentDescriptorRemovedEvent 37 8 0% 7 4
0.7575%
 

Contributing tests

This file is covered by 35 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.component.event;
21   
22    import java.lang.reflect.Type;
23   
24    /**
25    * Event sent to tell that a new Component Descriptor has been unregistered.
26    * <p>
27    * The event also send the following parameters:
28    * </p>
29    * <ul>
30    * <li>source: the {@link org.xwiki.component.manager.ComponentManager} where the component was registered</li>
31    * <li>data: the {@link org.xwiki.component.descriptor.ComponentDescriptor} instance</li>
32    * </ul>
33    *
34    * @version $Id: 7bc17ea8d005109c8313c552acb204647cb4e1d0 $
35    * @since 2.6RC2
36    */
 
37    public class ComponentDescriptorRemovedEvent extends AbstractComponentDescriptorEvent
38    {
39    /**
40    * Watches all roles (whenever a component is added it'll trigger this event).
41    */
 
42  2 toggle public ComponentDescriptorRemovedEvent()
43    {
44   
45    }
46   
47    /**
48    * @param role the component role to watch (all components matching this role will trigger this event)
49    * @deprecated since 4.4RC1 use {@link #ComponentDescriptorRemovedEvent(Type)} instead
50    */
 
51  0 toggle @Deprecated
52    public ComponentDescriptorRemovedEvent(Class<?> role)
53    {
54  0 super(role);
55    }
56   
57    /**
58    * @param roleType the component role to watch (all components matching this role will trigger this event)
59    * @since 4.4RC1
60    */
 
61  1 toggle public ComponentDescriptorRemovedEvent(Type roleType)
62    {
63  1 super(roleType);
64    }
65   
66    /**
67    * @param role the component role to watch
68    * @param roleHint the component role hint to watch
69    * @deprecated since 4.4RC1 use {@link #ComponentDescriptorRemovedEvent(Type, String)} instead
70    */
 
71  0 toggle @Deprecated
72    public ComponentDescriptorRemovedEvent(Class<?> role, String roleHint)
73    {
74  0 super(role, roleHint);
75    }
76   
77    /**
78    * @param roleType the component role to watch
79    * @param roleHint the component role hint to watch
80    * @since 4.4RC1
81    */
 
82  3100 toggle public ComponentDescriptorRemovedEvent(Type roleType, String roleHint)
83    {
84  3100 super(roleType, roleHint);
85    }
86   
 
87  4 toggle @Override
88    public boolean matches(Object otherEvent)
89    {
90  4 boolean result = false;
91   
92  4 if (ComponentDescriptorRemovedEvent.class.isAssignableFrom(otherEvent.getClass())) {
93  3 result = super.matches(otherEvent);
94    }
95   
96  4 return result;
97    }
98    }