1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.component.event

File ComponentDescriptorRemovedEvent.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
41% of files have more coverage

Code metrics

2
8
6
1
94
33
7
0.88
1.33
6
1.17

Classes

Class Line # Actions
ComponentDescriptorRemovedEvent 37 8 0% 7 2
0.87587.5%
 

Contributing tests

This file is covered by 47 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: d058a5a9f3aff33bb9d9c287e35ce8b5856d4971 $
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  90 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    */
 
50  76 toggle public ComponentDescriptorRemovedEvent(Class<?> role)
51    {
52  76 super(role);
53    }
54   
55    /**
56    * @param roleType the component role to watch (all components matching this role will trigger this event)
57    * @since 4.4RC1
58    */
 
59  1 toggle public ComponentDescriptorRemovedEvent(Type roleType)
60    {
61  1 super(roleType);
62    }
63   
64    /**
65    * @param role the component role to watch
66    * @param roleHint the component role hint to watch
67    */
 
68  0 toggle public ComponentDescriptorRemovedEvent(Class<?> role, String roleHint)
69    {
70  0 super(role, roleHint);
71    }
72   
73    /**
74    * @param roleType the component role to watch
75    * @param roleHint the component role hint to watch
76    * @since 4.4RC1
77    */
 
78  5811 toggle public ComponentDescriptorRemovedEvent(Type roleType, String roleHint)
79    {
80  5811 super(roleType, roleHint);
81    }
82   
 
83  5759 toggle @Override
84    public boolean matches(Object otherEvent)
85    {
86  5759 boolean result = false;
87   
88  5759 if (ComponentDescriptorRemovedEvent.class.isAssignableFrom(otherEvent.getClass())) {
89  5758 result = super.matches(otherEvent);
90    }
91   
92  5759 return result;
93    }
94    }