Package com.ebay.xcelite.exceptions

Examples of com.ebay.xcelite.exceptions.XceliteException


  private void buildHeader() {
    header = Sets.newLinkedHashSet();
    rowIterator = sheet.getNativeSheet().rowIterator();
    Row row = rowIterator.next();
    if (row == null) {
      throw new XceliteException("First row in sheet is empty. First row must contain header");
    }
    Iterator<Cell> itr = row.cellIterator();
    while (itr.hasNext()) {
      Cell cell = itr.next();
      header.add(cell.getStringCellValue());
View Full Code Here


  @SuppressWarnings("unchecked")
  private void extractAnyColumn() {
    Set<Field> anyColumnFields = ReflectionUtils.getAllFields(type, withAnnotation(AnyColumn.class));   
    if (anyColumnFields.size() > 0) {
      if (anyColumnFields.size() > 1) {
        throw new XceliteException("Multiple AnyColumn fields are not allowed");
      }
      Field anyColumnField = anyColumnFields.iterator().next();
      if (!anyColumnField.getType().isAssignableFrom(Map.class)) {
        throw new XceliteException(
            String.format("AnyColumn field \"%s\" should be of type Map.class or assignable from Map.class",
                anyColumnField.getName()));
      }
      anyColumn = new Col(anyColumnField.getName(), anyColumnField.getName());
      anyColumn.setAnyColumn(true);
View Full Code Here

   * @return XceliteSheet object
   */
  public XceliteSheet getSheet(int sheetIndex) {
    Sheet sheet = workbook.getSheetAt(sheetIndex);
    if (sheet == null) {
      throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex));
    }
    return new XceliteSheetImpl(sheet, file);
  }
View Full Code Here

   * @return XceliteSheet object
   */
  public XceliteSheet getSheet(String sheetName) {
    Sheet sheet = workbook.getSheet(sheetName);
    if (sheet == null) {
      throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName));
    }
    return new XceliteSheetImpl(sheet, file);
  }
View Full Code Here

   * Saves data to the same file given in construction. If no such file
   * specified an exception is thrown.
   */
  public void write() {
    if (file == null) {
      throw new XceliteException("No file given in Xcelite object construction. Consider using method write(file)");
    }
    write(file);
  }
View Full Code Here

TOP

Related Classes of com.ebay.xcelite.exceptions.XceliteException

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.