|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.Exporter
This class exports objects in XML
.
Field Summary | |
private static String |
AMP
|
private static String |
APOS
|
private static String |
GT
|
private String |
indent
--------------------------------------------- |
private ImportExportInfo |
info
|
private static String |
LT
|
private long |
nextUID
|
private static String |
QUOT
|
private static String |
RESOURCE
|
private Map |
uidCache
--------------------------------------------- |
private PrintWriter |
writer
|
Constructor Summary | |
Exporter(OutputStream ostream,
ImportExportInfo info)
Create an exporter that writes to the specified OutputStream using the character encoding
specified in this exporter's ImportExportInfo . |
Method Summary | |
void |
close()
Flush and close the OutputStream that this
exporter is writing to. |
protected void |
comment(String str)
Write a comment. |
protected void |
decreaseIndent()
|
private String |
encodeSpecialCharacters(String str)
Encode the following special characters using character entities: less than sign (<) greater than sign (>) ampersand (&) quotation mark (") apostrophe (') |
protected void |
endElement(String tag)
Output the end tag for an element with the specified name. |
abstract void |
export(WfContainer c)
Export the specified ProjectPlan
or SummaryActivity in
XML format. |
void |
exportBoolean(boolean boo,
String tag)
Export a boolean . |
void |
exportClass(Persistable p,
String tag)
Export the Class of the specified Persistable . |
void |
exportCurrency(Currency currency,
String tag)
Export a currency value. |
void |
exportDateTime(Date date,
String tag)
Export a date & time. |
void |
exportDateTime(Timestamp stamp,
String tag)
Export a date & time. |
void |
exportDuration(Date start,
Date finish,
String tag)
Export a duration. |
void |
exportDuration(long millis,
String tag)
Export a duration. |
void |
exportDuration(TimeToElapse duration,
String tag)
Export a duration. |
void |
exportEnumeratedType(EnumeratedType enum,
String tag)
Export a EnumeratedType . |
void |
exportInt(int i,
String tag)
Export an int . |
void |
exportNonNegInt(int i,
String tag)
Export a non-negative int . |
void |
exportOwner(Ownable o,
String tag)
Export the Owner of the specified
Ownable . |
void |
exportPercent(int i,
String tag)
Export an int as a percent represented as
a fraction. |
void |
exportPrincipal(WTPrincipalReference pRef,
String tag)
Export the Principal . |
void |
exportPrincipal(WTPrincipal p,
String tag)
Export the Principal . |
void |
exportRate(CurrencyRate rate,
String tag)
Export a currency rate value. |
void |
exportString(String str,
String tag)
Export a String . |
void |
exportUID(Persistable p,
String tag)
Export the UID of the specified Persistable . |
void |
exportWork(Work work,
String tag)
Export a work value. |
protected ImportExportInfo |
getInfo()
Get the ImportExportInfo that is
used to control this import process. |
protected void |
increaseIndent()
|
protected void |
startElement(String tag)
Output the start tag for an element with the specified name. |
protected void |
startElement(String tag,
String schemaName,
String schemaLoc)
Output the start tag for the document's root element. |
protected void |
writeElement(String tag,
boolean data)
Output an element. |
protected void |
writeElement(String tag,
double data)
Output an element. |
protected void |
writeElement(String tag,
EnumeratedType data)
Output an element. |
protected void |
writeElement(String tag,
float data)
Output an element. |
protected void |
writeElement(String tag,
int data)
Output an element. |
protected void |
writeElement(String tag,
long data)
Output an element. |
protected void |
writeElement(String tag,
String data)
Output an element. |
protected void |
writeElementData(String data)
Output the text data for an element. |
void |
writeHeader()
Write the XML header. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String LT
private static final String GT
private static final String AMP
private static final String QUOT
private static final String APOS
private static final String RESOURCE
private final PrintWriter writer
private ImportExportInfo info
private final Map uidCache
private long nextUID
private String indent
Constructor Detail |
public Exporter(OutputStream ostream, ImportExportInfo info) throws UnsupportedEncodingException
OutputStream
using the character encoding
specified in this exporter's ImportExportInfo
.
ostream
- the stream to write toMethod Detail |
protected final ImportExportInfo getInfo()
ImportExportInfo
that is
used to control this import process.
public abstract void export(WfContainer c) throws WTException, IOException
ProjectPlan
or SummaryActivity
in
XML
format.
The XML
is written to the OutputStream
that was passed in when this exporter was created.
c
- the ProjectPlan or SummaryActivity to export
WTException
IOException
public final void close()
OutputStream
that this
exporter is writing to.
public void exportUID(Persistable p, String tag)
UID
of the specified Persistable
.
p
- the persistable to exporttag
- the name of the tag that holds the UIDpublic void exportClass(Persistable p, String tag)
Class
of the specified Persistable
.
p
- the persistable to exporttag
- the name of the tag that holds the class namepublic void exportOwner(Ownable o, String tag) throws WTException
Owner
of the specified
Ownable
.
o
- the ownable object to exporttag
- the name of the tag that holds the owner
WTException
public void exportPrincipal(WTPrincipal p, String tag) throws WTException
Principal
.
p
- the principal to exporttag
- the name of the tag that holds the principal
WTException
public void exportPrincipal(WTPrincipalReference pRef, String tag)
Principal
.
pRef
- the principal to exporttag
- the name of the tag that holds the principalpublic void exportCurrency(Currency currency, String tag)
currency
- the currency to exporttag
- the name of the tag that holds the amountpublic void exportRate(CurrencyRate rate, String tag)
rate
- the currency rate to exporttag
- the name of the tag that holds the ratepublic void exportWork(Work work, String tag)
work
- the work to exporttag
- the name of the tag that holds the workpublic void exportDateTime(Date date, String tag)
ImportExportInfo
.
date
- the date & time to exporttag
- the name of the tag that holds the datepublic void exportDateTime(Timestamp stamp, String tag)
ImportExportInfo
.
stamp
- the date & time to exporttag
- the name of the tag that holds the datepublic void exportDuration(TimeToElapse duration, String tag)
duration
- the duration to exporttag
- the name of the tag that holds the durationpublic void exportDuration(Date start, Date finish, String tag)
start
- the start of the intervalfinish
- the end of the intervaltag
- the name of the tag that holds the durationpublic void exportDuration(long millis, String tag)
millis
- the duration to export expressed in millisecondstag
- the name of the tag that holds the durationpublic void exportEnumeratedType(EnumeratedType enum, String tag)
EnumeratedType
.
enum
- the enumerated type object to exporttag
- the name of the tag that holds the enumpublic void exportBoolean(boolean boo, String tag)
boolean
.
boo
- the boolean to exporttag
- the name of the tag that holds the booleanpublic final void exportInt(int i, String tag)
int
.
i
- the int to exporttag
- the name of the tag that holds the intpublic final void exportNonNegInt(int i, String tag)
int
. If the integer is
less than zero it is not exported.
i
- the int to exporttag
- the name of the tag that holds the intpublic void exportPercent(int i, String tag)
int
as a percent represented as
a fraction. If the int
is less than zero it
is not exported.
This exports (i/100.0F)
as long as (i >= 0)
.
i
- the percent to exporttag
- the name of the tag that holds the intpublic void exportString(String str, String tag)
String
.
str
- the string to exporttag
- the name of the tag that holds the textpublic final void writeHeader()
XML
header.
protected final void comment(String str)
protected final void writeElement(String tag, String data)
tag
- the name of the elementdata
- the element's text dataprotected final void writeElement(String tag, long data)
tag
- the name of the elementdata
- the element's numeric dataprotected final void writeElement(String tag, int data)
tag
- the name of the elementdata
- the element's numeric dataprotected final void writeElement(String tag, double data)
tag
- the name of the elementdata
- the element's numeric dataprotected final void writeElement(String tag, float data)
tag
- the name of the elementdata
- the element's numeric dataprotected final void writeElement(String tag, boolean data)
tag
- the name of the elementdata
- the element's boolean dataprotected final void writeElement(String tag, EnumeratedType data)
tag
- the name of the elementdata
- the element's enum type dataprotected final void writeElementData(String data)
data
- the element's text dataprotected final void startElement(String tag, String schemaName, String schemaLoc)
tag
- the document's root element nameschemaName
- the name of the document's schema or nullschemaLoc
- the schema's location or nullprotected final void startElement(String tag)
tag
- the name of the elementprotected final void endElement(String tag)
tag
- the name of the elementprotected final void increaseIndent()
protected final void decreaseIndent()
private final String encodeSpecialCharacters(String str)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |