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

File ComponentDescriptorAddedEvent.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
ComponentDescriptorAddedEvent 37 8 0% 7 2
0.87587.5%
 

Contributing tests

This file is covered by 135 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 registered.
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: 7087a3c5be3e8359c88c87291052d1aa57550d1d $
35    * @since 2.6RC2
36    */
 
37    public class ComponentDescriptorAddedEvent extends AbstractComponentDescriptorEvent
38    {
39    /**
40    * Watches all roles (whenever a component is added it'll trigger this event).
41    */
 
42  317 toggle public ComponentDescriptorAddedEvent()
43    {
44   
45    }
46   
47    /**
48    * @param role the component role to watch (all components matching this role will trigger this event)
49    */
 
50  219 toggle public ComponentDescriptorAddedEvent(Class<?> role)
51    {
52  219 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  5 toggle public ComponentDescriptorAddedEvent(Type roleType)
60    {
61  5 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 ComponentDescriptorAddedEvent(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  16313 toggle public ComponentDescriptorAddedEvent(Type roleType, String roleHint)
79    {
80  16313 super(roleType, roleHint);
81    }
82   
 
83  24529 toggle @Override
84    public boolean matches(Object otherEvent)
85    {
86  24529 boolean result = false;
87   
88  24529 if (ComponentDescriptorAddedEvent.class.isAssignableFrom(otherEvent.getClass())) {
89  24528 result = super.matches(otherEvent);
90    }
91   
92  24529 return result;
93    }
94    }