1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.extension.script.internal.safe

File SafeExtensionPlanAction.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

0
8
7
1
90
47
7
0.88
1.14
7
1

Classes

Class Line # Actions
SafeExtensionPlanAction 36 8 0% 7 15
0.00%
 

Contributing tests

No tests hitting this source file were found.

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.extension.script.internal.safe;
21   
22    import java.util.Collection;
23   
24    import org.xwiki.extension.Extension;
25    import org.xwiki.extension.InstalledExtension;
26    import org.xwiki.extension.job.plan.ExtensionPlanAction;
27    import org.xwiki.script.internal.safe.ScriptSafeProvider;
28    import org.xwiki.script.wrap.AbstractWrappingObject;
29   
30    /**
31    * Provide a public script access to an extension plan action.
32    *
33    * @version $Id: c4eefdf9880f33fe379b120f7b690d8a11d0516e $
34    * @since 4.0M2
35    */
 
36    public class SafeExtensionPlanAction extends AbstractWrappingObject<ExtensionPlanAction> implements ExtensionPlanAction
37    {
38    /**
39    * The provider of instances safe for public scripts.
40    */
41    private ScriptSafeProvider<Object> safeProvider;
42   
43    /**
44    * @param action the wrapped action
45    * @param safeProvider the provider of instances safe for public scripts
46    */
 
47  0 toggle public SafeExtensionPlanAction(ExtensionPlanAction action, ScriptSafeProvider<Object> safeProvider)
48    {
49  0 super(action);
50   
51  0 this.safeProvider = safeProvider;
52    }
53   
 
54  0 toggle @Override
55    public Extension getExtension()
56    {
57  0 return this.safeProvider.get(getWrapped().getExtension());
58    }
59   
 
60  0 toggle @Override
61    @Deprecated
62    public InstalledExtension getPreviousExtension()
63    {
64  0 return this.safeProvider.get(getWrapped().getPreviousExtension());
65    }
66   
 
67  0 toggle @Override
68    public Collection<InstalledExtension> getPreviousExtensions()
69    {
70  0 return this.safeProvider.get(getWrapped().getPreviousExtensions());
71    }
72   
 
73  0 toggle @Override
74    public Action getAction()
75    {
76  0 return getWrapped().getAction();
77    }
78   
 
79  0 toggle @Override
80    public String getNamespace()
81    {
82  0 return getWrapped().getNamespace();
83    }
84   
 
85  0 toggle @Override
86    public boolean isDependency()
87    {
88  0 return getWrapped().isDependency();
89    }
90    }