net.sf.mpxj.mpp
Class MPPReader

java.lang.Object
  extended by net.sf.mpxj.reader.AbstractProjectReader
      extended by net.sf.mpxj.mpp.MPPReader
All Implemented Interfaces:
ProjectReader

public final class MPPReader
extends AbstractProjectReader

This class creates a new ProjectFile instance by reading an MPP file.


Constructor Summary
MPPReader()
           
 
Method Summary
 void addProjectListener(ProjectListener listener)
          Add a listener to receive events as a project is being read.
 boolean getPreserveNoteFormatting()
          This method retrieves the state of the preserve note formatting flag.
 String getReadPassword()
          Internal only.
 boolean getReadPresentationData()
          Retrieves a flag which indicates whether presentation data will be read from the MPP file.
 boolean getUseRawTimephasedData()
          If this flag is true, raw timephased data will be retrieved from MS Project: no normalisation will take place.
 String getWritePassword()
          Internal only.
 ProjectFile read(InputStream is)
          Read a file where the contents of the project file are supplied via an input stream.
 ProjectFile read(org.apache.poi.poifs.filesystem.POIFSFileSystem fs)
          Alternative entry point allowing an MPP file to be read from a user-supplied POI file stream.
 void setPreserveNoteFormatting(boolean preserveNoteFormatting)
          This method sets a flag to indicate whether the RTF formatting associated with notes should be preserved or removed.
 void setReadPassword(String password)
          Set the read password for this Project file.
 void setReadPresentationData(boolean readPresentationData)
          Flag to allow time and memory to be saved by not reading presentation data from the MPP file.
 void setUseRawTimephasedData(boolean useRawTimephasedData)
          If this flag is true, raw timephased data will be retrieved from MS Project: no normalisation will take place.
 void setWritePassword(String password)
          Set the write password for this Project file.
 
Methods inherited from class net.sf.mpxj.reader.AbstractProjectReader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPPReader

public MPPReader()
Method Detail

addProjectListener

public void addProjectListener(ProjectListener listener)
Add a listener to receive events as a project is being read.

Parameters:
listener - ProjectListener instance

read

public ProjectFile read(InputStream is)
                 throws MPXJException
Read a file where the contents of the project file are supplied via an input stream.

Parameters:
is - InputStream instance
Returns:
ProjectFile instance
Throws:
MPXJException

read

public ProjectFile read(org.apache.poi.poifs.filesystem.POIFSFileSystem fs)
                 throws MPXJException
Alternative entry point allowing an MPP file to be read from a user-supplied POI file stream.

Parameters:
fs - POI file stream
Returns:
ProjectFile instance
Throws:
MPXJException

getPreserveNoteFormatting

public boolean getPreserveNoteFormatting()
This method retrieves the state of the preserve note formatting flag.

Returns:
boolean flag

setPreserveNoteFormatting

public void setPreserveNoteFormatting(boolean preserveNoteFormatting)
This method sets a flag to indicate whether the RTF formatting associated with notes should be preserved or removed. By default the formatting is removed.

Parameters:
preserveNoteFormatting - boolean flag

getUseRawTimephasedData

public boolean getUseRawTimephasedData()
If this flag is true, raw timephased data will be retrieved from MS Project: no normalisation will take place.

Returns:
boolean flag

setUseRawTimephasedData

public void setUseRawTimephasedData(boolean useRawTimephasedData)
If this flag is true, raw timephased data will be retrieved from MS Project: no normalisation will take place.

Parameters:
useRawTimephasedData - boolean flag

getReadPresentationData

public boolean getReadPresentationData()
Retrieves a flag which indicates whether presentation data will be read from the MPP file. Not reading this data saves time and memory.

Returns:
presentation data flag

setReadPresentationData

public void setReadPresentationData(boolean readPresentationData)
Flag to allow time and memory to be saved by not reading presentation data from the MPP file.

Parameters:
readPresentationData - set to false to prevent presentation data being read

setReadPassword

public void setReadPassword(String password)
Set the read password for this Project file. This is needed in order to be allowed to read a read-protected Project file. Note: Set this each time before calling the read method.

Parameters:
password - password text

getReadPassword

public String getReadPassword()
Internal only. Get the read password for this Project file. This is needed in order to be allowed to read a read-protected Project file.

Returns:
password password text

setWritePassword

public void setWritePassword(String password)
Set the write password for this Project file. Currently not used. Note: Set this each time before calling the read method.

Parameters:
password - password text

getWritePassword

public String getWritePassword()
Internal only. Get the write password for this Project file. Currently not used.

Returns:
password


Copyright © 2012. All Rights Reserved.