jsdai.xml
Class InstanceReader

java.lang.Object
  extended byjsdai.lang.JsdaiLangAccessor
      extended byjsdai.xml.SdaiXmlReader
          extended byjsdai.xml.InstanceReader
All Implemented Interfaces:
org.xml.sax.XMLReader
Direct Known Subclasses:
LateBindingReader

public abstract class InstanceReader
extends SdaiXmlReader

This class is an abstract org.xml.sax.XMLReader implementation which reads JSDAI data and presents it in ISO 10303-28 representation. It allows extending classes to implement specific bindings. Objects of classes extending InstanceReader are primarily useful for exporting JSDAI populations to XML representation.


Method Summary
 void parse(org.xml.sax.InputSource input)
          Parses XML from JSDAI population.
 void serialize(java.io.OutputStream stream, SdaiInputSource inputSource)
          Serializes JSDAI population as XML text to the output stream.
 void setFeature(java.lang.String name, boolean value)
          Sets the state of the feature for this InstanceReader.
 
Methods inherited from class jsdai.xml.SdaiXmlReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
Sets the state of the feature for this InstanceReader. The following features are recognized:
schema-population-names
If true, name attribute is added to <schema-population> elements
which is the name attribute of SchemaInstances. This is the extension of ISO 10303-28. The default value is true.
make-schema-populations
If true, <schema-population> element is added immediately after the header otherwise this information is skipped. The default value is true.

Specified by:
setFeature in interface org.xml.sax.XMLReader
Overrides:
setFeature in class SdaiXmlReader
Parameters:
name - The feature name, see the list above for recognized features.
value - The true or false value.

serialize

public void serialize(java.io.OutputStream stream,
                      SdaiInputSource inputSource)
               throws javax.xml.transform.TransformerConfigurationException,
                      javax.xml.transform.TransformerException
Serializes JSDAI population as XML text to the output stream. This is a convenient method to get XML text output from JSDAI. It uses JAXP Transformer API for serialization.

Parameters:
stream - The output stream of the serialized output
inputSource - The SDAI input source which defines the population
Throws:
java.io.IOException - if an I/O error occurs
org.xml.sax.SAXException - if an error occurs during the operation or in underlying JSDAI operations
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException

parse

public void parse(org.xml.sax.InputSource input)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Parses XML from JSDAI population. This method contains the main logic in creating the XML.

Parameters:
input - The input source which has to be of class SdaiInputSource
Throws:
java.io.IOException - if an I/O error occurs
org.xml.sax.SAXException - if an error occurs during the operation or in underlying JSDAI operations

Copyright © LKSoftWare GmbH, 1999-2008