Package org.pdfsam.console.business.dto.commands

Examples of org.pdfsam.console.business.dto.commands.AbstractParsedCommand


     * @return the parsed command
     * @throws Exception.
     */
    public synchronized AbstractParsedCommand parseAndValidate(String[] inputArguments) throws Exception {
        try {
            AbstractParsedCommand retVal = null;
            if (cmdParserManager.parse(inputArguments)) {
                retVal = cmdParserManager.validate();
            } else {
                LOG.error("Parse failed.");
            }
View Full Code Here


            if (args == null || args.length == 0) {
                args = new String[] { "-help" };
            }
            serviceFacade = new ConsoleServicesFacade();
            if (serviceFacade != null) {
                AbstractParsedCommand parsedCommand = serviceFacade.parseAndValidate(args);
                if (parsedCommand != null) {
                    serviceFacade.execute(parsedCommand);
                }
            } else {
                LOG.fatal("Unable to reach services, service facade is null.");
View Full Code Here

  }
         
  public void run() {
       try{
        ConsoleServicesFacade serviceFacade = Configuration.getInstance().getConsoleServicesFacade();
      AbstractParsedCommand cmd = serviceFacade.parseAndValidate(myStringArray);
      if(cmd != null){
        serviceFacade.execute(cmd);
        SoundPlayer.getInstance().playSound();
      }else{
        log.error(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Command validation returned an empty value."));
View Full Code Here

   * @throws ConsoleException
   */
  public AbstractParsedCommand validate() throws ConsoleException {
    stopWatch.reset();
    stopWatch.start();
    AbstractParsedCommand retVal = null;
    try {
      if (cmdHandler != null) {
        CmdLineHandler cmdLineHandler = cmdHandler.getCommandLineHandler();
        log.debug("Starting arguments validation.");
        if (cmdLineHandler != null) {
View Full Code Here

*/
public abstract class  AbstractCmdValidator implements CmdValidator{

  public AbstractParsedCommand validate(CmdLineHandler cmdLineHandler)
      throws ConsoleException {
    AbstractParsedCommand parsedCommand = validateArguments(cmdLineHandler);
    if(cmdLineHandler.getOption(AbstractParsedCommand.OVERWRITE_ARG) != null){
      parsedCommand.setOverwrite(((BooleanParam) cmdLineHandler.getOption(AbstractParsedCommand.OVERWRITE_ARG)).isTrue());     
    }
    if(cmdLineHandler.getOption(AbstractParsedCommand.COMPRESSED_ARG) != null){
      parsedCommand.setCompress(((BooleanParam) cmdLineHandler.getOption(AbstractParsedCommand.COMPRESSED_ARG)).isTrue());
    }
    if(cmdLineHandler.getOption(AbstractParsedCommand.PDFVERSION_ARG) != null){
          StringParam pdfversionOption = (StringParam) cmdLineHandler.getOption(AbstractParsedCommand.PDFVERSION_ARG);
          if (pdfversionOption.isSet()){
            parsedCommand.setOutputPdfVersion(pdfversionOption.getValue().charAt(0));
          }
        }
    return parsedCommand;
  }
View Full Code Here

TOP

Related Classes of org.pdfsam.console.business.dto.commands.AbstractParsedCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.