From: <jen...@us...> - 2011-08-04 11:50:26
|
Revision: 2990 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2990&view=rev Author: jenslehmann Date: 2011-08-04 11:50:20 +0000 (Thu, 04 Aug 2011) Log Message: ----------- generalised config helper; excluded pdb2rdf->slf4j dependency Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java trunk/scripts/pom.xml trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java Modified: trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java 2011-08-04 11:14:48 UTC (rev 2989) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java 2011-08-04 11:50:20 UTC (rev 2990) @@ -33,7 +33,7 @@ * @param configName the name of the config option * @param configValue the value of the config option */ - public static void configure(Component component, String configName, String configValue){ + public static <T> void configure(Component component, String configName, T configValue){ Field[] fields = component.getClass().getDeclaredFields(); for(Field f : fields){ ConfigOption option = f.getAnnotation(ConfigOption.class); @@ -41,7 +41,7 @@ if(option.name().equals(configName)){ try { PropertyEditor editor = (PropertyEditor) option.propertyEditorClass().newInstance(); - editor.setAsText(configValue); + editor.setAsText(configValue.toString()); Method method = component.getClass().getMethod("set" + Character.toUpperCase(f.getName().charAt(0)) + f.getName().substring(1), getClassForObject(editor.getValue())); method.invoke(component, editor.getValue()); } catch (IllegalArgumentException e) { Modified: trunk/scripts/pom.xml =================================================================== --- trunk/scripts/pom.xml 2011-08-04 11:14:48 UTC (rev 2989) +++ trunk/scripts/pom.xml 2011-08-04 11:50:20 UTC (rev 2990) @@ -40,6 +40,12 @@ <dependency> <groupId>com.dumontierlab</groupId> <artifactId>pdb2rdf-parser</artifactId> + <exclusions> + <exclusion> + <artifactId>slf4j-log4j12</artifactId> + <groupId>org.slf4j</groupId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>com.dumontierlab</groupId> Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-04 11:14:48 UTC (rev 2989) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-04 11:50:20 UTC (rev 2990) @@ -86,7 +86,7 @@ // SubPropertyOfAxiomLearner learner = new SubPropertyOfAxiomLearner(ks); AxiomLearningAlgorithm learner = cm.learningAlgorithm(algorithmClass, ks); ConfigHelper.configure(learner, "propertyToDescribe", property.toString()); -// ConfigHelper.configure(learner, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); + ConfigHelper.configure(learner, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); // learner.setPropertyToDescribe(property); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |