com.ibm.di.fc.emf
Class EmfXmlToSdo

java.lang.Object
  extended by com.ibm.di.fc.Function
      extended by com.ibm.di.fc.emf.EmfXmlToSdo
All Implemented Interfaces:
FunctionInterface, VersionInfoInterface

public class EmfXmlToSdo
extends Function

Function Component that using XML Schema converts an XML document to a tree structure of Data Objects. It also implements a discover schema functionality through its updateSchema method.


Field Summary
 
Fields inherited from class com.ibm.di.fc.Function
logger
 
Constructor Summary
EmfXmlToSdo()
           
 
Method Summary
 String getVersion()
          Returns function component's version
 void initialize(Object obj)
          Initializes the function component.
 Object perform(Object obj)
          Converts an XML document to Data Objects and sets the working entry attributes.
 boolean updateSchema(FunctionConfig config)
          Implements the discovery schema functionality.
 
Methods inherited from class com.ibm.di.fc.Function
debug, getConfiguration, getContext, getLog, getParam, getUI, initialize, logmsg, setConfiguration, setContext, setLog, setParam, terminate, verifyInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmfXmlToSdo

public EmfXmlToSdo()
Method Detail

initialize

public void initialize(Object obj)
                throws Exception
Initializes the function component. Sets instance members corresponding to the function component paramters.

Specified by:
initialize in interface FunctionInterface
Overrides:
initialize in class Function
Parameters:
obj - this object provides information to the Function Component needed on initialization
Throws:
Exception - if the xsdFile function component parameter is not specified if the file specified by xsdFile function component parameter is not found if the file specified by xsdFile function component parameter is not valid XML Schema file

perform

public Object perform(Object obj)
               throws Exception
Converts an XML document to Data Objects and sets the working entry attributes. The XML document is expected in xmlString Entry Attribute. The method creates Entry Attributes corresponding to the XML elements and attributes.

Parameters:
obj - the object is the working TDI Entry and should be of type com.ibm.di.entry.Entry.
Returns:
TDI Entry containing Entry Attributes coresponding to the XML elements and attributes.
Throws:
Exception - if the TDI Entry does not contain a xmlString attribute. if the xmlString does not contain valid XML document.

updateSchema

public boolean updateSchema(FunctionConfig config)
                     throws Exception
Implements the discovery schema functionality. The method reads the specified XML Schema File and creates Entry Attribute names based on the nesting of the XML elements.

Specified by:
updateSchema in interface FunctionInterface
Overrides:
updateSchema in class Function
Parameters:
config - contains the function configuration parameter.
Returns:
returns true on success
Throws:
Exception - if the the xsdFile parameter is not specified if the file specified by xsdFile parameter is not found if the file specified by xsdFile parameter is not valid XML Schema file

getVersion

public String getVersion()
Returns function component's version