001package org.unix4j.codegen.command.def; 002 003import java.util.ArrayList; 004import java.util.LinkedHashMap; 005import java.util.List; 006import java.util.Map; 007 008import org.unix4j.codegen.def.AbstractElementDef; 009import org.unix4j.codegen.def.PackageDef; 010import org.unix4j.codegen.def.TypeDef; 011 012public class CommandDef extends AbstractElementDef { 013 014 public CommandDef(String commandName, String className, String commandPackage, String name, String synopsis, String description) { 015 this.commandName = commandName; 016 this.command = new TypeDef(className); 017 this.pkg = new PackageDef(commandPackage); 018 this.name = name; 019 this.synopsis = synopsis; 020 this.description = description; 021 } 022 023 public final String commandName; //the command name, such as "ls" 024 public final TypeDef command; //the comand type, e.g. org.unix4j.unix.Ls 025 public final PackageDef pkg; //package with command specific classes, e.g. org.unix4j.unix.ls 026 public final String name; //e.g. ls - list directory contents 027 public final String synopsis; //e.g. ls [-ahlRrt] [file...] 028 public final String description; //the html file body 029 public final List<String> notes = new ArrayList<String>(); 030 public final List<MethodDef> methods = new ArrayList<MethodDef>(); 031 public final Map<String, OptionDef> options = new LinkedHashMap<String, OptionDef>(); //by (long) name 032 public final Map<String, OperandDef> operands = new LinkedHashMap<String, OperandDef>(); //by name 033 public final List<String> defaultOperands = new ArrayList<String>(1); //operand names for default operands 034 035 @Override 036 public String toString() { 037 return toString("\t"); 038 } 039}