/** * Create a {@link ExecutionContext} instance for use on this Smooks instance. * <p/> * The created context is profile agnostic and should be used where profile based targeting is not in use. * <p/> * The context returned from this method is used in subsequent calls to * {@link #filterSource(org.milyn.container.ExecutionContext, javax.xml.transform.Source, javax.xml.transform.Result...)} * It allows access to the execution context instance * before and after calls on this method. This means the caller has an opportunity to set and get data * {@link org.milyn.container.BoundAttributeStore bound} to the execution context (before and after the calls), providing the * caller with a mechanism for interacting with the content {@link org.milyn.delivery.dom.SmooksDOMFilter filtering} phases. * * @return Execution context instance. */ public ExecutionContext createExecutionContext() { return createExecutionContext(Profile.DEFAULT_PROFILE); }
/** * Create a {@link ExecutionContext} instance for use on this Smooks instance. * <p/> * The created context is profile agnostic and should be used where profile based targeting is not in use. * <p/> * The context returned from this method is used in subsequent calls to * {@link #filterSource(org.milyn.container.ExecutionContext, javax.xml.transform.Source, javax.xml.transform.Result...)} * It allows access to the execution context instance * before and after calls on this method. This means the caller has an opportunity to set and get data * {@link org.milyn.container.BoundAttributeStore bound} to the execution context (before and after the calls), providing the * caller with a mechanism for interacting with the content {@link org.milyn.delivery.dom.SmooksDOMFilter filtering} phases. * * @return Execution context instance. */ public ExecutionContext createExecutionContext() { return createExecutionContext(Profile.DEFAULT_PROFILE); }
/** * Create a {@link ExecutionContext} instance for use on this Smooks instance. * <p/> * The created context is profile agnostic and should be used where profile based targeting is not in use. * <p/> * The context returned from this method is used in subsequent calls to * {@link #filterSource(org.milyn.container.ExecutionContext, javax.xml.transform.Source, javax.xml.transform.Result...)} * It allows access to the execution context instance * before and after calls on this method. This means the caller has an opportunity to set and get data * {@link org.milyn.container.BoundAttributeStore bound} to the execution context (before and after the calls), providing the * caller with a mechanism for interacting with the content {@link org.milyn.delivery.dom.SmooksDOMFilter filtering} phases. * * @return Execution context instance. */ public ExecutionContext createExecutionContext() { return createExecutionContext(Profile.DEFAULT_PROFILE); }
/** * Create a {@link ExecutionContext} instance for use on this Smooks instance. * * The created context is profile agnostic and should be used where profile based targeting is not in use. * * The context returned from this method is used in subsequent calls to * {@link #filterSource(org.milyn.container.ExecutionContext, javax.xml.transform.Source, javax.xml.transform.Result...)} * It allows access to the execution context instance * before and after calls on this method. This means the caller has an opportunity to set and get data * {@link org.milyn.container.BoundAttributeStore bound} to the execution context (before and after the calls), providing the * caller with a mechanism for interacting with the content {@link org.milyn.delivery.dom.SmooksDOMFilter filtering} phases. * * @return Execution context instance. */ public ExecutionContext createExecutionContext() { return createExecutionContext(Profile.DEFAULT_PROFILE); }
/** * Filter the content in the supplied {@link Source} instance, outputing data * to the supplied {@link Result} instances. * * @param source The filter Source. * @param results The filter Results. * @throws SmooksException Failed to filter. */ public void filterSource(Source source, Result... results) throws SmooksException { filterSource(createExecutionContext(), source, results); }
/** * Initialize the binding instance. */ public AbstractBinding intiailize() { assertNotInitialized(); smooks.createExecutionContext(); this.allConfigsAdded = true; this.initialized = true; return this; }
/** * Filter the content in the supplied {@link Source} instance. * <p/> * Not producing a {@link Result}. * * @param source The content Source. * @throws SmooksException Failed to filter. */ public void filterSource(Source source) throws SmooksException { filterSource(createExecutionContext(), source, null); }
/** * Filter the content in the supplied {@link Source} instance, outputing data * to the supplied {@link Result} instances. * * @param source The filter Source. * @param results The filter Results. * @throws SmooksException Failed to filter. */ public void filterSource(Source source, Result... results) throws SmooksException { filterSource(createExecutionContext(), source, results); }
/** * Initialize the binding instance. */ public AbstractBinding intiailize() { assertNotInitialized(); smooks.createExecutionContext(); this.allConfigsAdded = true; this.initialized = true; return this; }
/** * Initialize the binding instance. */ public AbstractBinding intiailize() { assertNotInitialized(); smooks.createExecutionContext(); this.allConfigsAdded = true; this.initialized = true; return this; }
/** * Filter the content in the supplied {@link Source} instance. * <p/> * Not producing a {@link Result}. * * @param source The content Source. * @throws SmooksException Failed to filter. */ public void filterSource(Source source) throws SmooksException { filterSource(createExecutionContext(), source, null); }
/** * Filter the content in the supplied {@link Source} instance, outputing data * to the supplied {@link Result} instances. * * @param source The filter Source. * @param results The filter Results. * @throws SmooksException Failed to filter. */ public void filterSource(Source source, Result... results) throws SmooksException { filterSource(createExecutionContext(), source, results); }
/** * Filter the content in the supplied {@link Source} instance, outputing data * to the supplied {@link Result} instances. * * @param source The filter Source. * @param results The filter Results. * @throws SmooksException Failed to filter. */ public void filterSource(Source source, Result... results) throws SmooksException { filterSource(createExecutionContext(), source, results); }
/** * Filter the content in the supplied {@link Source} instance. * <p/> * Not producing a {@link Result}. * * @param source The content Source. * @throws SmooksException Failed to filter. */ public void filterSource(Source source) throws SmooksException { filterSource(createExecutionContext(), source, null); }
/** * Filter the content in the supplied {@link Source} instance. * * Not producing a {@link Result}. * * @param source The content Source. * @throws SmooksException Failed to filter. */ public void filterSource(Source source) throws SmooksException { filterSource(createExecutionContext(), source, null); }
/** * Unmarshals the fromStream to an Object. * </p> * The Camel framework will call this method from {@link UnMarshalProcessor#process(Exchange)} * and it will take care of setting the returned Object on the Out Message's body. * * @param exchange The Camel {@link Exchange}. * @param fromStream The InputStream that will be unmarshalled into an Object instance. */ public Object unmarshal(final Exchange exchange, final InputStream fromStream) throws Exception { final ExecutionContext execContext = smooks.createExecutionContext(); final Exports exports = Exports.getExports(smooks.getApplicationContext()); final Result[] results = exports.createResults(); smooks.filterSource(execContext, new StreamSource(fromStream), results); return getResult(exports, results, exchange); }
@SuppressWarnings("ConfusingArgumentToVarargsMethod") private void digestExtendedResourceConfig(Element configElement, String defaultSelector, String defaultNamespace, String defaultProfile, String defaultConditionRef) { String configNamespace = configElement.getNamespaceURI(); Smooks configDigester = getExtenededConfigDigester(configNamespace); ExecutionContext executionContext = configDigester.createExecutionContext(); ExtensionContext extentionContext; Element conditionElement = DomUtils.getElement(configElement, "condition", 1); // Create the ExtenstionContext and set it on the ExecutionContext... if(conditionElement != null && (conditionElement.getNamespaceURI().equals(XSD_V10) || conditionElement.getNamespaceURI().equals(XSD_V11))) { extentionContext = new ExtensionContext(this, defaultSelector, defaultNamespace, defaultProfile, digestCondition(conditionElement)); } else if(defaultConditionRef != null) { extentionContext = new ExtensionContext(this, defaultSelector, defaultNamespace, defaultProfile, getConditionEvaluator(defaultConditionRef)); } else { extentionContext = new ExtensionContext(this, defaultSelector, defaultNamespace, defaultProfile, null); } ExtensionContext.setExtensionContext(extentionContext, executionContext); // Filter the extension element through Smooks... configDigester.filterSource(executionContext, new DOMSource(configElement), null); // Copy the created resources from the ExtensionContext and onto the SmooksResourceConfigurationList... List<SmooksResourceConfiguration> resources = extentionContext.getResources(); for (SmooksResourceConfiguration resource : resources) { resourcelist.add(resource); } }
private void configure() { Smooks smooks = descriptor.getSmooks(); smooks.addVisitor(new NamespaceReaper()); //descriptor.getSmooks().addVisitor(new UnknownElementDataReaper(), "*"); smooks.setFilterSettings(FilterSettings.newDOMSettings()); ParameterAccessor.setParameter(BeanInstancePopulator.NOTIFY_POPULATE, "true", smooks); // Create the execution context so as to force resolution of the config... smooks.createExecutionContext(); }
private void configure() { Smooks smooks = descriptor.getSmooks(); smooks.addVisitor(new NamespaceReaper()); //descriptor.getSmooks().addVisitor(new UnknownElementDataReaper(), "*"); smooks.setFilterSettings(FilterSettings.newDOMSettings()); ParameterAccessor.setParameter(BeanInstancePopulator.NOTIFY_POPULATE, "true", smooks); // Create the execution context so as to force resolution of the config... smooks.createExecutionContext(); }
private void configure() { Smooks smooks = descriptor.getSmooks(); smooks.addVisitor(new NamespaceReaper()); //descriptor.getSmooks().addVisitor(new UnknownElementDataReaper(), "*"); smooks.setFilterSettings(FilterSettings.newDOMSettings()); ParameterAccessor.setParameter(BeanInstancePopulator.NOTIFY_POPULATE, "true", smooks); // Create the execution context so as to force resolution of the config... smooks.createExecutionContext(); }