1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.listener.descriptor

File ListenerElement.java

 

Coverage histogram

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

Code metrics

0
9
9
1
134
49
9
1
1
9
1

Classes

Class Line # Actions
ListenerElement 36 9 0% 9 2
0.888888988.9%
 

Contributing tests

This file is covered by 2 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.rendering.listener.descriptor;
21   
22    import java.lang.reflect.Method;
23    import java.lang.reflect.Type;
24    import java.util.ArrayList;
25    import java.util.List;
26   
27    /**
28    * An element of the listener.
29    * <p>
30    * An element is defined by either an <code>on</code> event of a combination of <code>begin</code> and <code>end</code>
31    * events.
32    *
33    * @version $Id: 5d4d0db57c11e9e541a54dbb6e8f2296d42bd881 $
34    * @since 3.3M1
35    */
 
36    public class ListenerElement
37    {
38    /**
39    * @see #getName()
40    */
41    private String name;
42   
43    /**
44    * @see #getParameters()
45    */
46    private List<Type> parameters = new ArrayList<Type>();
47   
48    /**
49    * @see #getBeginMethod()
50    */
51    private Method beginMethod;
52   
53    /**
54    * @see #getEndMethod()
55    */
56    private Method endMethod;
57   
58    /**
59    * @see #getOnMethod()
60    */
61    private Method onMethod;
62   
63    /**
64    * @param name the name of the element
65    */
 
66  62 toggle public ListenerElement(String name)
67    {
68  62 this.name = name;
69    }
70   
71    /**
72    * @return the name of the element
73    */
 
74  0 toggle public String getName()
75    {
76  0 return this.name;
77    }
78   
79    /**
80    * @return the parameters of the element
81    */
 
82  186 toggle public List<Type> getParameters()
83    {
84  186 return this.parameters;
85    }
86   
87    /**
88    * @return the begin method, null if it's a <code>on</code> event based element
89    */
 
90  40 toggle public Method getBeginMethod()
91    {
92  40 return this.beginMethod;
93    }
94   
95    /**
96    * @param beginMethod the begin method, null if it's a <code>on</code> event based element
97    */
 
98  40 toggle public void setBeginMethod(Method beginMethod)
99    {
100  40 this.beginMethod = beginMethod;
101    }
102   
103    /**
104    * @return the end method, null if it's a <code>on</code> event based element
105    */
 
106  40 toggle public Method getEndMethod()
107    {
108  40 return this.endMethod;
109    }
110   
111    /**
112    * @param endMethod the end method, null if it's a <code>on</code> event based element
113    */
 
114  40 toggle public void setEndMethod(Method endMethod)
115    {
116  40 this.endMethod = endMethod;
117    }
118   
119    /**
120    * @return the on method, null if it's a <code>begin/end</code> event based element
121    */
 
122  22 toggle public Method getOnMethod()
123    {
124  22 return this.onMethod;
125    }
126   
127    /**
128    * @param onMethod the on method, null if it's a <code>begin/end</code> event based element
129    */
 
130  22 toggle public void setOnMethod(Method onMethod)
131    {
132  22 this.onMethod = onMethod;
133    }
134    }