MCPcopy Create free account
hub / github.com/PCGen/pcgen / PCGenPropBundle

Class PCGenPropBundle

code/src/java/pcgen/system/PCGenPropBundle.java:41–256  ·  view source on GitHub ↗

This class is used to manage the properties of the PCGen application itself, such as its version, release date, etc.

Source from the content-addressed store, hash-verified

39 *
40 */
41public final class PCGenPropBundle
42{
43 private static ResourceBundle d_properties;
44 private static ResourceBundle autobuildProperties = null;
45
46 /*
47 * This static initializer loads the resources from the PCGenProp resource bundle.
48 */
49 static
50 {
51 d_properties = ResourceBundle.getBundle("pcgen.system.prop.PCGenProp");
52
53 try
54 {
55 File autobuildProps = new File("autobuild.properties");
56 if (autobuildProps.isFile() && autobuildProps.canRead())
57 {
58 FileInputStream fis = new FileInputStream(autobuildProps);
59 autobuildProperties = new PropertyResourceBundle(fis);
60 }
61 }
62 catch (MissingResourceException mre)
63 {
64 Logging.errorPrint("Failed to load autobuild.properties", mre);
65 autobuildProperties = null;
66 }
67 catch (IOException e)
68 {
69 Logging.errorPrint("autobuildProperties. failed", e);
70 }
71
72 //Safe as d_properties was constructed earlier in this block
73 try
74 {
75 TemplateModel wrappedVersion = ExportUtilities.getObjectWrapper().wrap(getVersionNumber());
76 OutputDB.addGlobalModel("version", wrappedVersion);
77 }
78 catch (TemplateModelException e)
79 {
80 Logging.errorPrint("Failed to load version for FreeMarker", e);
81 }
82 }
83
84 /**
85 * Constructor for PCGenPropBundle.
86 */
87 private PCGenPropBundle()
88 {
89 super();
90 }
91
92 /**
93 * This method gets the Code Monkeys.
94 * @return String containing the Code Monkeys
95 */
96 public static String getCodeMonkeys()
97 {
98 return getPropValue("CodeMonkeys", null);

Callers

nothing calls this directly

Calls 6

errorPrintMethod · 0.95
getObjectWrapperMethod · 0.95
getVersionNumberMethod · 0.95
addGlobalModelMethod · 0.95
getBundleMethod · 0.80
wrapMethod · 0.65

Tested by

no test coverage detected