@SuppressWarnings("unchecked") private static Map<String, BeanRuntimeInfo> getRuntimeInfoMap(ApplicationContext appContext) { Map<String, BeanRuntimeInfo> runtimeInfoMap = (Map<String, BeanRuntimeInfo>) appContext.getAttribute(CONTEXT_KEY); if(runtimeInfoMap == null) { runtimeInfoMap = new HashMap<String, BeanRuntimeInfo>(); appContext.setAttribute(CONTEXT_KEY, runtimeInfoMap); } return runtimeInfoMap; }
private ContentHandlerExtractionStrategy(ApplicationContext applicationContext) { store = applicationContext.getStore(); }
@Initialize public void initialize() throws SmooksConfigurationException { beanId = appContext.getBeanIdStore().getBeanId(STATVAR); if(beanId == null) { beanId = appContext.getBeanIdStore().register(STATVAR); } }
/** * Gets the Map of RuleProviders that exist in the Smooks AppcliationContext. * * @param context The Smooks {@link ApplicationContext}. * @return Map<String, RuleProvider> The Map of rule providers. The String key is the name of the rule provider. */ @SuppressWarnings("unchecked") public static Map<String, RuleProvider> getRuleProviders(final ApplicationContext context) { return (Map<String, RuleProvider>) context.getAttribute(RuleProvider.class); }
/** * Set the namespace prefix-to-uri mappings. * @param namespaces The namespace mappings. * @param appContext The application context. */ public static void setMappings(Properties namespaces, ApplicationContext appContext) { appContext.setAttribute(NamespaceMappings.class, namespaces); }
public static void build(ApplicationContext appContext) { ModelSet modelSet = get(appContext); if(modelSet == null) { modelSet = new ModelSet(appContext.getStore().getUserDefinedResourceList()); appContext.setAttribute(ModelSet.class, modelSet); } }
ContainerResourceLocator resLocator = applicationContext.getResourceLocator();
private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
public SmooksResourceConfigurationList registerResources(String baseURI, InputStream resourceConfigStream) throws SAXException, IOException, URISyntaxException { SmooksResourceConfigurationList configList; if(baseURI == null || baseURI.trim().equals("")) { throw new IllegalArgumentException("null or empty 'name' arg in method call."); } if(resourceConfigStream == null) { throw new IllegalArgumentException("null 'resourceConfigStream' arg in method call."); } configList = XMLConfigDigester.digestConfig(resourceConfigStream, baseURI, applicationContext.getClassLoader()); addSmooksResourceConfigurationList(configList); return configList; }
/** * Set the resource configuration on the bean populator. * @throws SmooksConfigurationException Incorrectly configured resource. */ @Initialize public void initialize() throws SmooksConfigurationException { isAttribute = (valueAttributeName != null); beanId = appContext.getBeanIdStore().register(beanIdName); if(logger.isDebugEnabled()) { logger.debug("Value Binder created for [" + beanIdName + "]."); } }
public static Exports getExports(final ApplicationContext appContext) { Exports exports = (Exports) appContext.getAttribute(Exports.class); if (exports == null) { return NULL_EXPORTS; } return exports; }
/** * Set the namespace prefix-to-uri mappings. * @param namespaces The namespace mappings. * @param appContext The application context. */ public static void setMappings(Properties namespaces, ApplicationContext appContext) { appContext.setAttribute(NamespaceMappings.class, namespaces); }
public static void build(ApplicationContext appContext) { ModelSet modelSet = get(appContext); if(modelSet == null) { modelSet = new ModelSet(appContext.getStore().getUserDefinedResourceList()); appContext.setAttribute(ModelSet.class, modelSet); } }
ContainerResourceLocator resLocator = applicationContext.getResourceLocator();
@SuppressWarnings("ConstantConditions") private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
/** * Register the set of resources specified in the supplied XML configuration * stream. * @param baseURI The base URI to be associated with the configuration stream. * @param resourceConfigStream XML resource configuration stream. * @return The SmooksResourceConfigurationList created from the added resource configuration. * @throws SAXException Error parsing the resource stream. * @throws IOException Error reading resource stream. * @see SmooksResourceConfiguration */ public SmooksResourceConfigurationList registerResources(String baseURI, InputStream resourceConfigStream) throws SAXException, IOException, URISyntaxException { SmooksResourceConfigurationList configList; if(baseURI == null || baseURI.trim().equals("")) { throw new IllegalArgumentException("null or empty 'name' arg in method call."); } if(resourceConfigStream == null) { throw new IllegalArgumentException("null 'resourceConfigStream' arg in method call."); } configList = XMLConfigDigester.digestConfig(resourceConfigStream, baseURI, applicationContext.getClassLoader()); addSmooksResourceConfigurationList(configList); return configList; }
@SuppressWarnings("unchecked") private static Map<String, BeanRuntimeInfo> getRuntimeInfoMap(ApplicationContext appContext) { Map<String, BeanRuntimeInfo> runtimeInfoMap = (Map<String, BeanRuntimeInfo>) appContext.getAttribute(CONTEXT_KEY); if(runtimeInfoMap == null) { runtimeInfoMap = new HashMap<String, BeanRuntimeInfo>(); appContext.setAttribute(CONTEXT_KEY, runtimeInfoMap); } return runtimeInfoMap; }
/** * Set the resource configuration on the bean populator. * @throws SmooksConfigurationException Incorrectly configured resource. */ @Initialize public void initialize() throws SmooksConfigurationException { isAttribute = (valueAttributeName != null); beanId = appContext.getBeanIdStore().register(beanIdName); if(logger.isDebugEnabled()) { logger.debug("Value Binder created for [" + beanIdName + "]."); } }
public static Exports getExports(final ApplicationContext appContext) { Exports exports = (Exports) appContext.getAttribute(Exports.class); if (exports == null) { return NULL_EXPORTS; } return exports; }
/** * Set the namespace prefix-to-uri mappings. * @param namespaces The namespace mappings. * @param appContext The application context. */ public static void setMappings(Properties namespaces, ApplicationContext appContext) { appContext.setAttribute(NamespaceMappings.class, namespaces); }