Examples of ShellException


Examples of org.jnode.shell.ShellException

                res = new Primary(null, Math.round(Math.pow(operand1.getValue(), operand2.getValue())));
                break;
            case SLASH:
                value = operand2.getValue();
                if (value == 0) {
                    throw new ShellException("Divide by zero in expression");
                }
                res = new Primary(null, operand1.getValue() / value);
                break;
            case PERCENT:
                value = operand2.getValue();
                if (value == 0) {
                    throw new ShellException("Remainder by zero in expression");
                }
                res = new Primary(null, operand1.getValue() % value);
                break;
            default:
                throw new ShellFailureException("operator not supported");
View Full Code Here

Examples of org.jnode.shell.ShellException

    }

    public CommandInterpreter createInterpreter(String name) throws ShellException {
        CommandInterpreter.Factory factory = interpreterFactories.get(name);
        if (factory == null) {
            throw new ShellException("Unknown interpreter '" + name + "'");
        }
        return factory.create();
    }
View Full Code Here

Examples of org.jnode.shell.ShellException

    public SimpleCommandInvoker createInvoker(String name, CommandShell shell)
        throws ShellException {
        SimpleCommandInvoker.Factory factory = invokerFactories.get(name);
        if (factory == null) {
            throw new ShellException("Unknown invoker '" + name + "'");
        }
        return factory.create(shell);
    }
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

    case Node.COMMENT_NODE:
      write((Comment) node);
      break;

    default:
      throw new ShellException(getString("RuntimeError.18", Short.toString(type))); //$NON-NLS-1$
    }
  }
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

    // created
    // if it does not already exist

    File project = new File(targetProject);
    if (!project.isDirectory()) {
      throw new ShellException(getString("Warning.9", //$NON-NLS-1$
          targetProject));
    }

    StringBuilder sb = new StringBuilder();
    StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
    while (st.hasMoreTokens()) {
      sb.append(st.nextToken());
      sb.append(File.separatorChar);
    }

    File directory = new File(project, sb.toString());
    if (!directory.isDirectory()) {
      boolean rc = directory.mkdirs();
      if (!rc) {
        throw new ShellException(getString("Warning.10", //$NON-NLS-1$
            directory.getAbsolutePath()));
      }
    }

    return directory;
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

    try {
      return getMergedSource(new InputSource(new StringReader(generatedXmlFile.getFormattedContent())),
          new InputSource(new FileReader(existingFile)), existingFile.getName());
    } catch (IOException e) {
      throw new ShellException(getString("Warning.13", //$NON-NLS-1$
          existingFile.getName()), e);
    } catch (SAXException e) {
      throw new ShellException(getString("Warning.13", //$NON-NLS-1$
          existingFile.getName()), e);
    } catch (ParserConfigurationException e) {
      throw new ShellException(getString("Warning.13", //$NON-NLS-1$
          existingFile.getName()), e);
    }
  }
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

    DocumentType newDocType = newDocument.getDoctype();
    DocumentType existingDocType = existingDocument.getDoctype();

    if (!newDocType.getName().equals(existingDocType.getName())) {
      throw new ShellException(getString("Warning.12", //$NON-NLS-1$
          existingFileName));
    }

    Element existingRootElement = existingDocument.getDocumentElement();
    Element newRootElement = newDocument.getDocumentElement();
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

        try {
            return getMergedSource(new InputSource(new StringReader(generatedXmlFile.getFormattedContent())),
                new InputSource(new InputStreamReader(new FileInputStream(existingFile), "UTF-8")), //$NON-NLS-1$
                existingFile.getName());
        } catch (IOException e) {
            throw new ShellException(getString("Warning.13", //$NON-NLS-1$
                    existingFile.getName()), e);
        } catch (SAXException e) {
            throw new ShellException(getString("Warning.13", //$NON-NLS-1$
                    existingFile.getName()), e);
        } catch (ParserConfigurationException e) {
            throw new ShellException(getString("Warning.13", //$NON-NLS-1$
                    existingFile.getName()), e);
        }
    }
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

        DocumentType newDocType = newDocument.getDoctype();
        DocumentType existingDocType = existingDocument.getDoctype();

        if (!newDocType.getName().equals(existingDocType.getName())) {
            throw new ShellException(getString("Warning.12", //$NON-NLS-1$
                    existingFileName));
        }

        Element existingRootElement = existingDocument.getDocumentElement();
        Element newRootElement = newDocument.getDocumentElement();
View Full Code Here

Examples of org.mybatis.generator.exception.ShellException

        case Node.COMMENT_NODE:
            write((Comment) node);
            break;

        default:
            throw new ShellException(getString(
                    "RuntimeError.18", Short.toString(type))); //$NON-NLS-1$
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.