|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.macewan.ims.enterprise.io.IMSEnterpriseProcessor ca.macewan.ims.enterprise.io.IMSEnterpriseExportProcessor ca.macewan.ims.enterprise.io.IMSEnterpriseBuilder
IMSEnterpriseBuilder
lets you write an IMS enterprise XML file as a series of
top level elements. This is as opposed to the IMSEnterpriseWriter
class, which writes an entire IMS enterprise XML document in one write action. The advantages
of this builder as opposed to the writer class are mainly in terms of resource management and
flexibility.
IMSEnterpriseBuilder builder = new IMSEnterpriseBuilder(someOutputStream); builder.writeComments(comments); builder.writePerson(person); ... builder.endDocument();The builder must finish with a call to
endDocument
, or else
the closing </enterprise> tag won't be written and the resulting XML file will be
invalid.
Constructor Summary | |
IMSEnterpriseBuilder(OutputStream out)
Creates an IMSEnterpriseBuilder with the given output stream, and using the
default system JSR173 XMLOutputFactory class for writing the XML document. |
|
IMSEnterpriseBuilder(String writerClass,
OutputStream out)
Creates an IMSEnterpriseBuilder where the writerClass argument is used to specify
the JSR173 XMLOutputFactory class to be used. |
|
IMSEnterpriseBuilder(String writerClass,
Writer out)
Creates an IMSEnterpriseBuilder where the writerClass argument is used to specify
the JSR173 XMLOutputFactory class to be used. |
|
IMSEnterpriseBuilder(Writer out)
Creates an IMSEnterpriseBuilder with the given writer, and using the
default system JSR173 XMLOutputFactory class for writing the XML document. |
Method Summary | |
void |
endDocument()
Finishes the XML document and closes the underlying writer or output stream. |
boolean |
isIMSValidating()
Returns true if IMS enterprise validation is turned on. |
void |
setIMSValidating(boolean v)
Turn IMS enterprise validation on or off. |
void |
writeComments(Comments comments)
Writes a comments object to the XML file. |
void |
writeGroup(Group group)
Writes a group object to the XML file. |
void |
writeMembership(Membership membership)
Writes a membership object to the XML file. |
void |
writePerson(Person person)
Writes a person object to the XML file. |
void |
writeProperties(Properties properties)
Writes a properties object to the XML file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IMSEnterpriseBuilder(OutputStream out) throws IMSEnterpriseException
IMSEnterpriseBuilder
with the given output stream, and using the
default system JSR173 XMLOutputFactory class for writing the XML document.
out
- The output stream to write to.public IMSEnterpriseBuilder(Writer out) throws IMSEnterpriseException
IMSEnterpriseBuilder
with the given writer, and using the
default system JSR173 XMLOutputFactory class for writing the XML document.
out
- The writer to write to.public IMSEnterpriseBuilder(String writerClass, OutputStream out) throws IMSEnterpriseException
IMSEnterpriseBuilder
where the writerClass argument is used to specify
the JSR173 XMLOutputFactory class to be used. Check the JSR173 documentation for more information.
writerClass
- The XMLOutputFactory class to use.out
- The output stream to write to.public IMSEnterpriseBuilder(String writerClass, Writer out) throws IMSEnterpriseException
IMSEnterpriseBuilder
where the writerClass argument is used to specify
the JSR173 XMLOutputFactory class to be used. Check the JSR173 documentation for more information.
writerClass
- The XMLOutputFactory class to use.out
- The writer to write to.Method Detail |
public void setIMSValidating(boolean v)
true
, the builder will call
the validate
method on the IMS enterprise objects being written, and any
writeXXXX() method may throw an IMSEnterpriseException
if the information in the XML file is not valid according to the IMS enterprise specification.
- Parameters:
v
- Whether or not to enable IMS enterprise validation.
public boolean isIMSValidating()
true
if IMS enterprise validation is turned on.
public void writeComments(Comments comments) throws IMSEnterpriseException
comments
- The IMS Comments
object to write.
IMSEnterpriseException
public void writeProperties(Properties properties) throws IMSEnterpriseException
properties
- The IMS Properties
object to write.
IMSEnterpriseException
public void writePerson(Person person) throws IMSEnterpriseException
person
- The IMS Person
object to write.
IMSEnterpriseException
public void writeGroup(Group group) throws IMSEnterpriseException
group
- The IMS Group
object to write.
IMSEnterpriseException
public void writeMembership(Membership membership) throws IMSEnterpriseException
membership
- The IMS Membership
object to write.
IMSEnterpriseException
public void endDocument() throws IMSEnterpriseException
IMSEnterpriseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |