Changeset 718 for trunk/java-utils


Ignore:
Timestamp:
08/30/12 17:04:16 (12 years ago)
Author:
sherbold
Message:
  • added command man that prints manuals of commands to the console
  • added manuals für the commands exec, exit, listCommands, man, and trainMarkovModel
Location:
trunk/java-utils
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-utils/.classpath

    r482 r718  
    77                </attributes> 
    88        </classpathentry> 
     9        <classpathentry kind="src" path="src/main/resources"/> 
    910        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> 
    1011                <attributes> 
  • trunk/java-utils/pom.xml

    r529 r718  
    99                <url>https://quest.informatik.uni-goettingen.de/svn/quest/trunk/java-utils</url> 
    1010        </scm> 
     11        <dependencies> 
     12                <dependency> 
     13                        <groupId>org.apache.commons</groupId> 
     14                        <artifactId>commons-io</artifactId> 
     15                        <version>1.3.2</version> 
     16                </dependency> 
     17                <dependency> 
     18        <groupId>commons-lang</groupId> 
     19        <artifactId>commons-lang</artifactId> 
     20        <version>2.1</version> 
     21      </dependency> 
     22        </dependencies> 
    1123        <build> 
    1224                <plugins> 
  • trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java

    r669 r718  
    155155     *         otherwise 
    156156     */ 
    157     private Command loadCMD(String className) { 
     157    public Command loadCMD(String className) { 
    158158        Command cmd = null; 
    159159        try { 
     
    171171        catch (ClassCastException e) { 
    172172            Console.traceln(Level.WARNING, className + "found, but does not implement Command"); 
     173        } 
     174        return cmd; 
     175    } 
     176     
     177    /** 
     178     * <p> 
     179     * Helper method that loads a class and tries to cast it to {@link Command}. 
     180     * </p> 
     181     *  
     182     * @param className 
     183     *            qualified name of the class (including package name) 
     184     * @return if class is available and implement {@link Command} and instance of the class, null 
     185     *         otherwise 
     186     */ 
     187    public Command getCMD(String commandName) { 
     188        Command cmd = null; 
     189        for (int i = 0; cmd == null && i < commandPackageList.size(); i++) { 
     190            cmd = loadCMD(commandPackageList.get(i) + "." + cmdPrefix + commandName); 
     191        } 
     192        if (cmd == null) { // check if command is available as default command 
     193            cmd = loadCMD(defaultPackage + "." + cmdPrefix + commandName); 
    173194        } 
    174195        return cmd; 
Note: See TracChangeset for help on using the changeset viewer.