From: <jen...@us...> - 2011-08-29 08:53:02
|
Revision: 3156 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3156&view=rev Author: jenslehmann Date: 2011-08-29 08:52:56 +0000 (Mon, 29 Aug 2011) Log Message: ----------- removed @Deprecated from valueObject and small improvements in CLI post processor Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/ConfFileOption2.java trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java trunk/scripts/src/main/java/org/dllearner/scripts/DocumentationHTMLGenerator.java Modified: trunk/interfaces/src/main/java/org/dllearner/cli/ConfFileOption2.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/ConfFileOption2.java 2011-08-28 18:34:39 UTC (rev 3155) +++ trunk/interfaces/src/main/java/org/dllearner/cli/ConfFileOption2.java 2011-08-29 08:52:56 UTC (rev 3156) @@ -26,8 +26,6 @@ * Programmatic representation of an option setting in a conf file: * bean.property = value; * - * TODO: Class is not stable yet. - * * @author Jens Lehmann * */ @@ -46,6 +44,8 @@ private Class<?> propertyType; + // the object should be either a primitive, a Collection<String> or a Map<String,String>, + // the actual mapping from Strings to datatypes is later done e.g. by property editors private Object valueObject; public ConfFileOption2() { @@ -84,12 +84,10 @@ this.propertyType = propertyType; } - @Deprecated public Object getValueObject() { return valueObject; } - @Deprecated public void setValueObject(Object valueObject) { this.valueObject = valueObject; } Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-08-28 18:34:39 UTC (rev 3155) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-08-29 08:52:56 UTC (rev 3156) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2011, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,7 +19,11 @@ */ package org.dllearner.confparser3; -import java.util.*; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import org.dllearner.cli.ConfFileOption2; @@ -58,11 +62,17 @@ valueObject = ((String) valueObject).replaceAll(prefix + ":", prefixes.get(prefix)); } - }else{ + } else if(valueObject instanceof Map) { + throw new Error("Map post processing not implemented yet"); + } else if(valueObject instanceof Collection){ // Check for collections of string if (valueObject instanceof Collection) { - processStringCollection(prefixes, (Collection) valueObject); + processStringCollection(prefixes, (Collection<?>) valueObject); } + } else if(valueObject instanceof Boolean || valueObject instanceof Integer || valueObject instanceof Double) { + // nothing needs to be done for booleans + } else { + throw new Error("Unknown conf option type " + valueObject.getClass()); } option.setValueObject(valueObject); Modified: trunk/scripts/src/main/java/org/dllearner/scripts/DocumentationHTMLGenerator.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/DocumentationHTMLGenerator.java 2011-08-28 18:34:39 UTC (rev 3155) +++ trunk/scripts/src/main/java/org/dllearner/scripts/DocumentationHTMLGenerator.java 2011-08-29 08:52:56 UTC (rev 3156) @@ -22,10 +22,9 @@ import java.io.File; import java.util.List; import java.util.Map; -import java.util.TreeMap; import java.util.Map.Entry; +import java.util.TreeMap; -import org.dllearner.algorithms.SimpleSubclassLearner; import org.dllearner.core.AnnComponentManager; import org.dllearner.core.Component; import org.dllearner.core.config.ConfigHelper; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |