1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.objects.meta; |
21 |
|
|
22 |
|
import javax.inject.Named; |
23 |
|
import javax.inject.Singleton; |
24 |
|
|
25 |
|
import org.xwiki.component.annotation.Component; |
26 |
|
|
27 |
|
import com.xpn.xwiki.objects.classes.PasswordClass; |
28 |
|
import com.xpn.xwiki.objects.classes.PropertyClassInterface; |
29 |
|
import com.xpn.xwiki.objects.classes.StaticListClass; |
30 |
|
import com.xpn.xwiki.objects.classes.StringClass; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
|
37 |
|
@Component |
38 |
|
@Named("Password") |
39 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 2 |
Complexity Density: 0.12 |
|
40 |
|
public class PasswordMetaClass extends StringMetaClass |
41 |
|
{ |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
public static final String STORAGE_TYPE = "storageType"; |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
public static final String CLEAR = "Clear"; |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
public static final String ENCRYPTED = "Encrypted"; |
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
public static final String HASH = "Hash"; |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
@link |
65 |
|
|
66 |
|
public static final String SEPARATOR = "|"; |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
public static final String ALGORITHM_KEY = "algorithm"; |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
|
76 |
60 |
public PasswordMetaClass()... |
77 |
|
{ |
78 |
60 |
setPrettyName("Password"); |
79 |
60 |
setName(getClass().getAnnotation(Named.class).value()); |
80 |
|
|
81 |
60 |
StaticListClass storageTypeClass = new StaticListClass(this); |
82 |
60 |
storageTypeClass.setName(STORAGE_TYPE); |
83 |
60 |
storageTypeClass.setPrettyName("Storage type"); |
84 |
60 |
storageTypeClass.setValues(HASH + SEPARATOR + CLEAR); |
85 |
60 |
storageTypeClass.setRelationalStorage(false); |
86 |
60 |
storageTypeClass.setDisplayType("select"); |
87 |
60 |
storageTypeClass.setMultiSelect(false); |
88 |
60 |
storageTypeClass.setSize(1); |
89 |
60 |
safeput(storageTypeClass.getName(), storageTypeClass); |
90 |
|
|
91 |
60 |
StringClass encryptAlgorithmClass = new StringClass(this); |
92 |
60 |
encryptAlgorithmClass.setName(ALGORITHM_KEY); |
93 |
60 |
encryptAlgorithmClass.setPrettyName("Encryption/hash algorithm"); |
94 |
60 |
encryptAlgorithmClass.setSize(20); |
95 |
60 |
safeput(encryptAlgorithmClass.getName(), encryptAlgorithmClass); |
96 |
|
} |
97 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
98 |
157 |
@Override... |
99 |
|
public PropertyClassInterface getInstance() |
100 |
|
{ |
101 |
157 |
return new PasswordClass(); |
102 |
|
} |
103 |
|
} |