Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.RecordFormatException


            throw new IllegalArgumentException("sfm must not be null");
        }
        boolean hasStringRec = stringRec != null;
        boolean hasCachedStringFlag = formulaRec.hasCachedResultString();
    if (hasStringRec != hasCachedStringFlag) {
      throw new RecordFormatException("String record was "
          + (hasStringRec ? "": "not ") + " supplied but formula record flag is "
          + (hasCachedStringFlag ? "" : "not ") + " set");
    }
         
        if (formulaRec.isSharedFormula()) {
View Full Code Here


 
  public final short getSid() {
    return -1;
  }
  public int serialize(int offset, byte[] data) {
    throw new RecordFormatException("Cannot serialize a dummy record");
  }
View Full Code Here

  }
  public int serialize(int offset, byte[] data) {
    throw new RecordFormatException("Cannot serialize a dummy record");
  }
  protected final int getDataSize() {
    throw new RecordFormatException("Cannot serialize a dummy record");
  }
View Full Code Here

    if (svm == null) {
      throw new IllegalArgumentException("sfm must not be null");
    }
    if (formulaRec.hasCachedResultString()) {
      if (stringRec == null) {
        throw new RecordFormatException("Formula record flag is set but String record was not found");
      }
      _stringRecord = stringRec;
    } else {
      // Usually stringRec is null here (in agreement with what the formula rec says).
      // In the case where an extra StringRecord is erroneously present, Excel (2007)
View Full Code Here

   */
  private static void handleMissingSharedFormulaRecord(FormulaRecord formula) {
    // make sure 'unshared' formula is actually available
    Ptg firstToken = formula.getParsedExpression()[0];
    if (firstToken instanceof ExpPtg) {
      throw new RecordFormatException(
          "SharedFormulaRecord not found for FormulaRecord with (isSharedFormula=true)");
    }
    // could log an info message here since this is a fairly unusual occurrence.
    formula.setSharedFormula(false); // no point leaving the flag erroneously set
  }
View Full Code Here

      return field_2_first_col;
    }   

    public String toFormulaString(Workbook book)
    {
        throw new RecordFormatException("Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula by ValueRecordsAggregate, but it wasn't");
    }
View Full Code Here

                                ! (last_record instanceof ContinueRecord) && // include continuation records after
                                ! (last_record instanceof UnknownRecord) )   // unknown records or previous continuation records
                            {
                                if (last_record == null)
                                {
                                    throw new RecordFormatException(
                                        "First record is a ContinueRecord??");
                                }
                                last_record.processContinueRecord(data);
                            }
                            else
                            {
                                if (last_record != null) {
                                    if (throwRecordEvent(last_record) == false && abortable == true) {
                                        last_record = null;
                                        break;  
                                    }
                                }
                               
                                last_record = record;
                               
                                //records.add(record);
                            }
                        }
                    }
                }
            }
            while (rectype != 0);
           
            if (last_record != null) {
               throwRecordEvent(last_record);              
            }
        }
        catch (IOException e)
        {
            throw new RecordFormatException("Error reading bytes");
        }

        // Record[] retval = new Record[ records.size() ];
        // retval = ( Record [] ) records.toArray(retval);
    
View Full Code Here

            }
        }
        catch (Exception introspectionException)
        {
            introspectionException.printStackTrace();
            throw new RecordFormatException(
                "Unable to construct record instance, the following exception occured: " + introspectionException.getMessage());
        }
        if (retval instanceof RKRecord)
        {
            RKRecord     rk  = ( RKRecord ) retval;
View Full Code Here

                    short.class, short.class, byte [].class
                });
            }
            catch (Exception illegalArgumentException)
            {
                throw new RecordFormatException(
                    "Unable to determine record types");
            }
            result.put(new Short(sid), constructor);
        }
        return result;
View Full Code Here

        if (userCode != 0) break process;
      }
    }
    catch (IOException e)
    {
      throw new RecordFormatException("Error reading bytes" +
                        "while processing record sid="+sid);
    }
    return userCode;

    // Record[] retval = new Record[ records.size() ];
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.RecordFormatException

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.