public final class UniversalProjectReader extends AbstractProjectReader
Modifier and Type | Class and Description |
---|---|
static interface |
UniversalProjectReader.ProjectReaderProxy
The classes implementing this interface provide access to an instance of
the
ProjectReader class (via the getProjectReader method)
which is the class that UniversalProjectReader has determined
should be used to read the file or stream you have passed it. |
Constructor and Description |
---|
UniversalProjectReader() |
Modifier and Type | Method and Description |
---|---|
UniversalProjectReader.ProjectReaderProxy |
getProjectReaderProxy(File file)
Retrieve a
ProjectReaderProxy instance which provides access to
the ProjectReader required to read a schedule from the supplied
File instance . |
UniversalProjectReader.ProjectReaderProxy |
getProjectReaderProxy(InputStream inputStream)
Retrieve a
ProjectReaderProxy instance which provides access to
the ProjectReader required to read a schedule from the supplied
InputStream instance . |
UniversalProjectReader.ProjectReaderProxy |
getProjectReaderProxy(String fileName)
Retrieve a
ProjectReaderProxy instance which provides access to
the ProjectReader required to read a schedule from the named file. |
ProjectFile |
read(File file)
Read a single schedule from a file where a File instance is supplied.
|
ProjectFile |
read(InputStream inputStream)
Read a single schedule from a file where the contents of the project file
are supplied via an input stream.
|
ProjectFile |
read(String fileName)
Read a single schedule from a file where the file name is supplied.
|
List<ProjectFile> |
readAll(File file)
Read all schedules from a file where a File instance is supplied.
|
List<ProjectFile> |
readAll(InputStream inputStream)
Read all schedules from a file where the contents of the project file
are supplied via an input stream.
|
List<ProjectFile> |
readAll(String fileName)
Read all schedules from a file where the file name is supplied.
|
ProjectReader |
setProperties(Properties props)
Deprecated.
|
addListenersToProject, addListenersToReader, addProjectListener, setCharset
@Deprecated public ProjectReader setProperties(Properties props)
UniversalProjectReader
to read a schedule. Users of UniversalProjectReader
are
not expected to know what type of schedule they are working with ahead of time, so
UniversalProjectReader
will select the correct reader for the supplied file type
use it to read the file.
Users of UniversalProjectReader
may still want to configure the behavior of the individual reader
classes, but as UniversalProjectReader
hides their use from callers, an alternative
mechanism is required to allow configuration information to be passed. In this case a Properties
instance can be passed containing properties in this form:
<class name>.<property name>=<property value>
.
Here's an example of a single property value:
net.sf.mpxj.phoenix.PhoenixReader.UseActivityCodesForTaskHierarchy=trueThis approach allows properties for multiple different reader classes to be specified, in one
Properties
instance, with only the relevant properties being applied to the reader
class actually used by UniversalProjectReader
to read the supplied schedule.setProperties
in interface ProjectReader
setProperties
in class AbstractProjectReader
props
- properties to setpublic ProjectFile read(String fileName) throws MPXJException
ProjectReader
fileName
- file nameMPXJException
public List<ProjectFile> readAll(String fileName) throws MPXJException
ProjectReader
fileName
- file nameMPXJException
public ProjectFile read(File file) throws MPXJException
ProjectReader
file
- File instanceMPXJException
public List<ProjectFile> readAll(File file) throws MPXJException
ProjectReader
file
- File instanceMPXJException
public ProjectFile read(InputStream inputStream) throws MPXJException
ProjectReader
inputStream
- InputStream instanceMPXJException
public List<ProjectFile> readAll(InputStream inputStream) throws MPXJException
ProjectReader
inputStream
- InputStream instanceMPXJException
public UniversalProjectReader.ProjectReaderProxy getProjectReaderProxy(String fileName) throws MPXJException
ProjectReaderProxy
instance which provides access to
the ProjectReader
required to read a schedule from the named file.fileName
- name of file containing schedule dataProjectReaderProxy
instance or null if no suitable reader can be foundMPXJException
public UniversalProjectReader.ProjectReaderProxy getProjectReaderProxy(File file) throws MPXJException
ProjectReaderProxy
instance which provides access to
the ProjectReader
required to read a schedule from the supplied
File instance
.file
- file containing schedule dataProjectReaderProxy
instance or null if no suitable reader can be foundMPXJException
public UniversalProjectReader.ProjectReaderProxy getProjectReaderProxy(InputStream inputStream) throws MPXJException
ProjectReaderProxy
instance which provides access to
the ProjectReader
required to read a schedule from the supplied
InputStream instance
.inputStream
- stream containing schedule dataProjectReaderProxy
instance or null if no suitable reader can be foundMPXJException
Copyright © 2000–2024 Packwood Software. All rights reserved.