GuideSchema.java
2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.aemds.guide.utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class GuideSchema {
private static List<String> localizableProp = new ArrayList<String>();
private static HashMap<String, List<String>> exclusiveLocalizable = new HashMap();
private static String[] supportedLocalizableProperties = new String[]{"jcr:title", "jcr:description", "customAssist", "shortDescription", "longDescription", "mandatoryMessage", "validateExpMessage", "formatMessage", "validatePictureClauseMessage", "placeholderText", "buttonText", "tncTextContent", "tncCheckBoxContent", "displayMsg", "options", "xAxisTitle", "yAxisTitle", "placeholderDay", "placeholderMonth", "placeholderYear", "titleMonth", "titleDay", "titleYear"};
public static void emptyLocalizableProperties() {
int localizablePropSize = localizableProp.size();
for (int i = GuideSchema.supportedLocalizableProperties.length; i < localizablePropSize; ++i) {
localizableProp.remove(supportedLocalizableProperties.length);
}
}
public static void addLocalizableProp(String compName, List<String> properties) {
if (compName == null) {
localizableProp.addAll(properties);
} else {
List existingProp = new ArrayList();
if (exclusiveLocalizable.containsKey(compName)) {
existingProp = exclusiveLocalizable.get(compName);
} else {
exclusiveLocalizable.put(compName, existingProp);
}
existingProp.addAll(properties);
}
}
public static boolean isLocalizableProperty(String compName, String propName) {
boolean localizable = false;
if (propName != null) {
if (compName != null && exclusiveLocalizable.get(compName) != null) {
localizable = exclusiveLocalizable.get(compName).contains(propName);
}
if (!localizable) {
localizable = localizableProp.contains(propName);
}
}
return localizable;
}
static {
GuideSchema.addLocalizableProp(null, Arrays.asList(supportedLocalizableProperties));
ArrayList<String> textDrawProp = new ArrayList<String>();
textDrawProp.add("_value");
GuideSchema.addLocalizableProp("guideTextDraw", textDrawProp);
}
}