net.sf.mpxj.mpx
Class MPXReader

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

public final class MPXReader
extends AbstractProjectReader

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


Nested Class Summary
protected static class MPXReader.DeferredRelationship
          This class is used to collect relationship data awaiting deferred processing.
 
Constructor Summary
MPXReader()
           
 
Method Summary
 void addProjectListener(ProjectListener listener)
          Add a listener to receive events as a project is being read.
 boolean getIgnoreTextModels()
          Retrieves the flag indicating that the text version of the Task and Resource Table Definition records should be ignored.
 Locale getLocale()
          This method returns the locale used by this MPX file.
 Locale[] getSupportedLocales()
          Retrieves an array of locales supported by this class.
 ProjectFile read(InputStream is)
          Read a file where the contents of the project file are supplied via an input stream.
 void setIgnoreTextModels(boolean flag)
          This method sets the flag indicating that the text version of the Task and Resource Table Definition records should be ignored.
 void setLocale(Locale locale)
          This method sets the locale to be used by this MPX 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

MPXReader

public MPXReader()
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

getLocale

public Locale getLocale()
This method returns the locale used by this MPX file.

Returns:
current locale

setLocale

public void setLocale(Locale locale)
This method sets the locale to be used by this MPX file.

Parameters:
locale - locale to be used

getSupportedLocales

public Locale[] getSupportedLocales()
Retrieves an array of locales supported by this class.

Returns:
array of supported locales

setIgnoreTextModels

public void setIgnoreTextModels(boolean flag)
This method sets the flag indicating that the text version of the Task and Resource Table Definition records should be ignored. Ignoring these records gets around the problem where MPX files have been generated with incorrect task or resource field names, but correct task or resource field numbers in the numeric version of the record.

Parameters:
flag - Boolean flag

getIgnoreTextModels

public boolean getIgnoreTextModels()
Retrieves the flag indicating that the text version of the Task and Resource Table Definition records should be ignored.

Returns:
Boolean flag


Copyright © 2012. All Rights Reserved.