public class IlvGanttDocumentReader extends Object implements IlvSDXLConstants
IlvGanttDocumentReader class reads an IlvGanttModel
from an XML document. The document reader uses an IlvActivityReader,
an IlvResourceReader, an IlvConstraintReader, and an
IlvReservationReader to read the activities, resources, constraints,
and reservations, respectively. The usual sequence of reading an XML document
is:
IlvGanttDocumentReader docReader = new IlvGanttDocumentReader(); docReader.readGanttModel(anXMLDocument, aGanttModel);If the XML document does not specify a single activity as an explicit root, then the reader will set an
IlvNullActivity as the
root activity of the data model.
Similarly, if the XML document does not specify a single resource as an
explicit root, then the reader will set an IlvNullResource as the
root resource of the data model.| Modifier and Type | Class and Description |
|---|---|
static class |
IlvGanttDocumentReader.Context
The
IlvGanttDocumentReader.Context class is the context
object passed to the IlvActivityReader, IlvResourceReader,
IlvConstraintReader, and IlvReservationReader when an XML
document is
read
into a Gantt model. |
ACTIVITIES_ELEMENT, ACTIVITY_ELEMENT, CONSTRAINT_ELEMENT, CONSTRAINTS_ELEMENT, DATE_FORMAT_ATTRIBUTE, LANGUAGE_ATTRIBUTE, RESERVATION_ELEMENT, RESERVATIONS_ELEMENT, RESOURCE_ELEMENT, RESOURCES_ELEMENT, SCHEDULE_ELEMENT| Constructor and Description |
|---|
IlvGanttDocumentReader()
Creates an
IlvGanttDocumentReader that uses an
IlvGeneralActivityReader, an IlvGeneralResourceReader,
an IlvGeneralConstraintReader, and an
IlvGeneralReservationReader to read the activities, resources,
constraints, and reservations, respectively. |
| Modifier and Type | Method and Description |
|---|---|
IlvActivityReader |
getActivityReader()
Returns the activity reader.
|
IlvConstraintReader |
getConstraintReader()
Returns the constraint reader.
|
IlvReservationReader |
getReservationReader()
Returns the reservation reader.
|
IlvResourceReader |
getResourceReader()
Returns the resource reader.
|
void |
readGanttModel(Document document,
IlvGanttModel model)
Reads a Gantt model from the given XML document.
|
void |
readGanttModel(Element schedule,
IlvGanttModel model)
Reads an
IlvGanttModel from a given Element. |
void |
setActivityReader(IlvActivityReader reader)
Sets the activity reader.
|
void |
setConstraintReader(IlvConstraintReader reader)
Sets the constraint reader.
|
void |
setReservationReader(IlvReservationReader reader)
Sets the reservation reader.
|
void |
setResourceReader(IlvResourceReader reader)
Sets the resource reader.
|
public IlvGanttDocumentReader()
IlvGanttDocumentReader that uses an
IlvGeneralActivityReader, an IlvGeneralResourceReader,
an IlvGeneralConstraintReader, and an
IlvGeneralReservationReader to read the activities, resources,
constraints, and reservations, respectively.
Note that before the JViews 6.0 version, the readers used to be
IlvSimple*Readerpublic IlvActivityReader getActivityReader()
<activity> element.public void setActivityReader(IlvActivityReader reader)
<activity> element. By default,
the activity reader will not have a
time reader defined.
In this case, the document reader sets a time reader based upon the
format specified by the dateFormat attribute of the
<activities> element.reader - The new activity reader.public IlvResourceReader getResourceReader()
<resource> element.public void setResourceReader(IlvResourceReader reader)
<resource> element.reader - The new resource reader.public IlvConstraintReader getConstraintReader()
<constraint> element.public void setConstraintReader(IlvConstraintReader reader)
<constraint> element.reader - The new constraint reader.public IlvReservationReader getReservationReader()
<reservation> element.public void setReservationReader(IlvReservationReader reader)
<reservation> element.reader - The new reservation reader.public void readGanttModel(Document document, IlvGanttModel model) throws IlvGanttReaderException
schedule element.document - The document to read from.model - The target Gantt model.IlvGanttReaderExceptionpublic void readGanttModel(Element schedule, IlvGanttModel model) throws IlvGanttReaderException
IlvGanttModel from a given Element.schedule - The element to read from. Typically, this will be a
<schedule> element.model - The target Gantt model.IlvGanttReaderException© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.