|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.macewan.ims.enterprise.io.IMSEnterpriseProcessor
ca.macewan.ims.enterprise.io.IMSEnterpriseImportProcessor
ca.macewan.ims.enterprise.io.IMSEnterpriseReader
IMSEnterpriseReader
lets you read an entire IMS enterprise XML file in one
read action. This is as opposed to the IMSEnterpriseParser
class,
which reads the top-level elements of an IMS enterprise XML document one at a time, much like
an iterator. The advantages of this reader as opposed to the iterator-style parser
class are mainly in terms of coding simplicity and convenience. After reading the entire
document, it is still possible to use the
Enterprise.getIterator
method to iterate over the
document's top-level elements. Note, however, that using this reader to read large IMS
enterprise XML files can lead to out-of-memory issues.
IMSEnterpriseReader reader = new IMSEnterpriseReader(); Enterprise enterprise = reader.read(someInputStream);
Constructor Summary | |
IMSEnterpriseReader()
Creates a default IMSEnterpriseReader using the system JSR173 XMLInputFactory
class for parsing the XML document. |
|
IMSEnterpriseReader(String readerClass)
Creates an IMSEnterpriseReader where the method argument is used to specify the
JSR173 XMLInputFactory class to be used. |
Method Summary | |
boolean |
isIMSValidating()
Returns true if IMS enterprise validation is turned on. |
boolean |
isXMLValidating()
Returns true if XML validation is turned on. |
Enterprise |
read(InputStream in)
Attempts to read the complete XML enterprise information available on the InputStream and builds an Enterprise object
representing the information. |
void |
setIMSValidating(boolean v)
Turn IMS enterprise validation on or off. |
void |
setValidating(boolean v)
Convenience method to set both XML validation and IMS enterprise validation with one method. |
void |
setXMLValidating(boolean v)
Turn XML validation on or off. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IMSEnterpriseReader()
IMSEnterpriseReader
using the system JSR173 XMLInputFactory
class for parsing the XML document.
public IMSEnterpriseReader(String readerClass)
IMSEnterpriseReader
where the method argument is used to specify the
JSR173 XMLInputFactory class to be used. Check the JSR173 documentation for more information.
readerClass
- The XMLInputFactory class to use.Method Detail |
public void setValidating(boolean v)
setXMLValidating
and
setIMSValidating
.
v
- Whether or not to enable both IMS enterprise validation and
XML validation.public void setIMSValidating(boolean v)
true
, the reader will call
the validate
method on the IMS enterprise objects being read, and the
read
method may throw an
IMSEnterpriseException
if the information in the
XML file is not valid according to the IMS enterprise specification.
v
- Whether or not to enable IMS enterprise validation.public boolean isIMSValidating()
true
if IMS enterprise validation is turned on.
public void setXMLValidating(boolean v)
setIMSValidating
). The
read
method may throw an
IMSEnterpriseException
wrapping any XML exceptions.
v
- Whether or not to enable XML validation.public boolean isXMLValidating()
true
if XML validation is turned on.
public Enterprise read(InputStream in) throws IMSEnterpriseException
InputStream
and builds an Enterprise
object
representing the information.
in
- The stream to read the XML data from.
Enterprise
object.
IMSEnterpriseException
- Exceptions may be thrown regarding IMS enterprise
validation (see setIMSValidating
), XML validation
(see setXMLValidating
) or general XML reading
errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |