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

File ScriptMacroParameters.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
6
6
1
103
37
6
1
1
6
1

Classes

Class Line # Actions
ScriptMacroParameters 30 6 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 61 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.script;
21   
22    import org.xwiki.properties.annotation.PropertyDescription;
23   
24    /**
25    * Parameters for the {@link AbstractScriptMacro} Macro.
26    *
27    * @version $Id: b840ecb9b1d7189363f1dd57cd102b47200ddb15 $
28    * @since 1.7M3
29    */
 
30    public class ScriptMacroParameters
31    {
32    /**
33    * @see #setOutput(boolean)
34    */
35    private boolean output = true;
36   
37    /**
38    * @see #setWiki(boolean)
39    */
40    private boolean wiki = true;
41   
42    /**
43    * @see #getJars()
44    */
45    private String jarURLsAsString;
46   
47    /**
48    * @param output indicate the output result has to be inserted back in the document.
49    */
 
50  24355 toggle @PropertyDescription("Specifies whether or not the output result should be inserted back in the document.")
51    public void setOutput(boolean output)
52    {
53  24356 this.output = output;
54    }
55   
56    /**
57    * @return indicate the output result has to be inserted back in the document.
58    */
 
59  526065 toggle public boolean isOutput()
60    {
61  526069 return this.output;
62    }
63   
64    /**
65    * @param wiki indicate if the result of the script execution has to be parsed by the current wiki parser. If not
66    * it's put in a verbatim block.
67    * @since 2.0M1
68    */
 
69  5692 toggle @PropertyDescription("Specifies whether or not the script output contains wiki markup.")
70    public void setWiki(boolean wiki)
71    {
72  5693 this.wiki = wiki;
73    }
74   
75    /**
76    * @return indicate if the result of the script execution has to be parsed by the current wiki parser.
77    * @since 2.0M1
78    */
 
79  238864 toggle public boolean isWiki()
80    {
81  238872 return this.wiki;
82    }
83   
84    /**
85    * @param jarURLsAsString see {@link #getJars()}
86    */
 
87  3 toggle @PropertyDescription("List of JARs to be added to the class loader used to execute this script. "
88    + "Example: \"attach:wiki:space.page@somefile.jar\", \"attach:somefile.jar\", \"attach:wiki:space.page\" "
89    + "(adds all JARs attached to the page) or URL to a JAR")
90    public void setJars(String jarURLsAsString)
91    {
92  3 this.jarURLsAsString = jarURLsAsString;
93    }
94   
95    /**
96    * @return the list of JARs to be added to the script execution class loader, see
97    * {@link org.xwiki.rendering.internal.macro.script.DefaultAttachmentClassLoaderFactory} for more details
98    */
 
99  262936 toggle public String getJars()
100    {
101  263120 return this.jarURLsAsString;
102    }
103    }