package gw.beantransfer uses gw.beantransfer.impl.BeanImportGraph uses org.w3c.dom.* uses javax.xml.namespace.NamespaceContext uses javax.xml.xpath.XPathConstants uses javax.xml.xpath.XPathFactory /** * This interface defines a handler (or observer) methods for exporting a KeyableBean. */ interface BeanExportHandler { /** * Callback for bean export. This method is called before the bean is exported. * * @param bean the KeyableBean to be exported * @return the processed bean to be exported; null if the bean is not to be exported. */ function handleBeanExport(bean : KeyableBean) : KeyableBean { return bean } /** * Callback for bean export. This method is called after the export. It is used to perform any post processing * related to this handler. * * @param graph the Graph representation of the bean XML */ function handlePostExport(graph : BeanImportGraph) {} /** * Create a Node containing the search criteria from the specified XPath in the XML Document. * * @param additionalInfoDoc the Document containing the additional information * @param namespaceContext the namespace context * @param stringExpression the XPath expression used to get the search criteria information * @return the Node containing the search criteria */ function createCriteriaNode(additionalInfoDoc : org.w3c.dom.Document, namespaceContext : NamespaceContext, stringExpression : String) : Node { var xpath = XPathFactory.newInstance().newXPath() xpath.setNamespaceContext(namespaceContext) return xpath.compile(stringExpression).evaluate(additionalInfoDoc, XPathConstants.NODE) as Node } }