public class ConcreteConfiguration extends AbstractConfiguration2 { private static ConcreteConfiguration conf = null; protected ConcreteConfiguration2Impl() { addProperty("propBool", Boolean.TYPE, false); addProperty("propInt", Integer.class, 1); addProperty("propFile", File.class, null); } public static ConcreteConfiguration getInstance() { if (conf == null) { conf = new ConcreteConfiguration(); } return conf; } }
public class ConcreteConfiguration extends AbstractConfiguration2 { private static ConcreteConfiguration conf = null; protected ConcreteConfiguration2Impl() { addProperty("propBool", Boolean.TYPE, false); addProperty("propInt", Integer.class, 1); addProperty("propList", List.class, null, true); } protected void setCustomPropertyValue(String key, Object value) { if (key.equals("propList")) { propertiesValues.get("propList").setValue(value); } } protected Object getCustomPropertyValue(String key) { if (key.equals("propList")) { return propertiesValues.get("propList").getValue(); } else { return null; } } public static ConcreteConfiguration getInstance() { if (conf == null) { conf = new ConcreteConfiguration(); } return conf; } }
Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences