Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
XWikiIconTransformationConfiguration | 42 | 3 | 0% | 1 | 0 |
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.internal.transformation.icon; | |
21 | ||
22 | import org.xwiki.component.annotation.Component; | |
23 | import org.xwiki.configuration.ConfigurationSource; | |
24 | ||
25 | import java.util.Properties; | |
26 | ||
27 | import javax.inject.Inject; | |
28 | import javax.inject.Singleton; | |
29 | ||
30 | /** | |
31 | * All configuration options for the Icon transformation. | |
32 | * <p> | |
33 | * You can override the default values for each of the configuration properties below by defining them in XWiki's global | |
34 | * configuration file using a prefix of "rendering.transformation.icon" followed by the property name. For example: | |
35 | * <code>rendering.transformation.icon.mappings = ...</code> | |
36 | * | |
37 | * @version $Id: febeb5643cc4a055b42e6815980c0ebfcf2e8f91 $ | |
38 | * @since 2.6RC1 | |
39 | */ | |
40 | @Component | |
41 | @Singleton | |
42 | public class XWikiIconTransformationConfiguration extends DefaultIconTransformationConfiguration | |
43 | { | |
44 | /** | |
45 | * Prefix for configuration keys for the Icon transformation module. | |
46 | */ | |
47 | private static final String PREFIX = "rendering.transformation.icon."; | |
48 | ||
49 | /** | |
50 | * Configuration source from where to read configuration data from. | |
51 | */ | |
52 | @Inject | |
53 | private ConfigurationSource configuration; | |
54 | ||
55 | 32 | @Override |
56 | public Properties getMappings() | |
57 | { | |
58 | // Merge default properties and properties defined in the configuration | |
59 | 32 | Properties props = super.getMappings(); |
60 | 32 | props.putAll(this.configuration.getProperty(PREFIX + "mappings", Properties.class)); |
61 | 32 | return props; |
62 | } | |
63 | } |