1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.rendering.macro.descriptor

File DefaultParameterDescriptor.java

 

Coverage histogram

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

Code metrics

0
12
12
1
116
68
12
1
1
12
1

Classes

Class Line # Actions
DefaultParameterDescriptor 33 12 0% 12 4
0.833333383.3%
 

Contributing tests

This file is covered by 188 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.macro.descriptor;
21   
22    import java.lang.reflect.Type;
23   
24    import org.xwiki.properties.PropertyDescriptor;
25    import org.xwiki.properties.PropertyGroupDescriptor;
26   
27    /**
28    * The default implementation of {@link ParameterDescriptor}.
29    *
30    * @version $Id: fa90efb9e02ecf64b1e89c14d9f8ebe91c87f30a $
31    * @since 1.7M2
32    */
 
33    public class DefaultParameterDescriptor implements ParameterDescriptor
34    {
35    /**
36    * The description of the parameter.
37    */
38    private PropertyDescriptor propertyDescriptor;
39   
40    /**
41    * Creates a new {@link DefaultParameterDescriptor} instance using the given {@link PropertyDescriptor}.
42    *
43    * @param propertyDescriptor The {@link PropertyDescriptor} instance.
44    */
 
45  1803 toggle public DefaultParameterDescriptor(PropertyDescriptor propertyDescriptor)
46    {
47  1803 this.propertyDescriptor = propertyDescriptor;
48    }
49   
 
50  1808 toggle @Override
51    public String getId()
52    {
53  1808 return this.propertyDescriptor.getId();
54    }
55   
 
56  0 toggle @Override
57    public String getName()
58    {
59  0 return this.propertyDescriptor.getName();
60    }
61   
 
62  6 toggle @Override
63    public String getDescription()
64    {
65  6 return this.propertyDescriptor.getDescription();
66    }
67   
 
68  0 toggle @Override
69    @Deprecated
70    public Class<?> getType()
71    {
72  0 return this.propertyDescriptor.getPropertyClass();
73    }
74   
 
75  5 toggle @Override
76    public Type getParameterType()
77    {
78  5 return this.propertyDescriptor.getPropertyType();
79    }
80   
 
81  2 toggle @Override
82    public Object getDefaultValue()
83    {
84  2 return this.propertyDescriptor.getDefaultValue();
85    }
86   
 
87  5 toggle @Override
88    public boolean isMandatory()
89    {
90  5 return this.propertyDescriptor.isMandatory();
91    }
92   
 
93  2 toggle @Override
94    public boolean isDeprecated()
95    {
96  2 return this.propertyDescriptor.isDeprecated();
97    }
98   
 
99  2 toggle @Override
100    public boolean isAdvanced()
101    {
102  2 return this.propertyDescriptor.isAdvanced();
103    }
104   
 
105  6 toggle @Override
106    public PropertyGroupDescriptor getGroupDescriptor()
107    {
108  6 return this.propertyDescriptor.getGroupDescriptor();
109    }
110   
 
111  2 toggle @Override
112    public Type getDisplayType()
113    {
114  2 return this.propertyDescriptor.getDisplayType();
115    }
116    }