1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.filter.instance.input

File InstanceInputProperties.java

 

Coverage histogram

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

Code metrics

2
6
5
1
82
39
6
1
1.2
5
1.2

Classes

Class Line # Actions
InstanceInputProperties 39 6 0% 6 2
0.8461538684.6%
 

Contributing tests

This file is covered by 21 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.filter.instance.input;
21   
22    import java.util.HashMap;
23   
24    import org.xwiki.filter.FilterStreamProperties;
25    import org.xwiki.model.reference.EntityReferenceSet;
26    import org.xwiki.properties.RawProperties;
27    import org.xwiki.properties.annotation.PropertyDescription;
28    import org.xwiki.properties.annotation.PropertyHidden;
29    import org.xwiki.properties.annotation.PropertyName;
30   
31    /**
32    * The properties passed to the instance input wiki stream.
33    * <p>
34    * The properties are also passed to implementations of {@link InstanceInputEventGenerator}.
35    *
36    * @version $Id: bff510d4a92026e978b4d784502ba2a797c4f3e4 $
37    * @since 6.2M1
38    */
 
39    public class InstanceInputProperties extends HashMap<String, Object> implements RawProperties, FilterStreamProperties
40    {
41    private static final String PROPNAME_ENTITIES = "entities";
42   
43    /**
44    * @return The entities to generate events from
45    */
 
46  545 toggle @PropertyName("Entities")
47    @PropertyDescription("The entities to generate events from")
48    // TODO: implement Converter for EntityReferenceSet
49    @PropertyHidden
50    public EntityReferenceSet getEntities()
51    {
52  545 return (EntityReferenceSet) get(PROPNAME_ENTITIES);
53    }
54   
55    /**
56    * @param entities The entities to generate events from
57    */
 
58  5 toggle public void setEntities(EntityReferenceSet entities)
59    {
60  5 put(PROPNAME_ENTITIES, entities);
61    }
62   
 
63  122 toggle @Override
64    public boolean isVerbose()
65    {
66  122 Boolean verbose = (Boolean) get(PROPNAME_VERBOSE);
67   
68  122 return verbose == Boolean.FALSE ? false : true;
69    }
70   
 
71  15159 toggle @Override
72    public void setVerbose(boolean verbose)
73    {
74  15159 put(PROPNAME_VERBOSE, verbose);
75    }
76   
 
77  0 toggle @Override
78    public void set(String propertyName, Object value)
79    {
80  0 put(propertyName, value);
81    }
82    }