org.milyn.container.ApplicationContext类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.milyn.container.ApplicationContext类的一些代码示例,展示了ApplicationContext类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext类的具体详情如下:
包路径:org.milyn.container.ApplicationContext
类名称:ApplicationContext

ApplicationContext介绍

[英]Smooks Application context interface definition.
[中]Smooks应用程序上下文接口定义。

代码示例

代码示例来源:origin: smooks/smooks

@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;
}

代码示例来源:origin: smooks/smooks

private ContentHandlerExtractionStrategy(ApplicationContext applicationContext) {
  store = applicationContext.getStore();
}

代码示例来源:origin: smooks/smooks

@Initialize
public void initialize() throws SmooksConfigurationException {
  beanId = appContext.getBeanIdStore().getBeanId(STATVAR);
  if(beanId == null) {
    beanId = appContext.getBeanIdStore().register(STATVAR);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
 * 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);
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

/**
 * 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);
}

代码示例来源:origin: smooks/smooks

public static void build(ApplicationContext appContext) {
  ModelSet modelSet = get(appContext);
  if(modelSet == null) {
    modelSet = new ModelSet(appContext.getStore().getUserDefinedResourceList());
    appContext.setAttribute(ModelSet.class, modelSet);
  }
}

代码示例来源:origin: smooks/smooks

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

代码示例来源:origin: org.virtuslab/milyn-smooks-core

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);
    }
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

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;
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
 * 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 + "].");
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static Exports getExports(final ApplicationContext appContext)
{
  Exports exports = (Exports) appContext.getAttribute(Exports.class);
  if (exports == null)
  {
    return NULL_EXPORTS;
  }
  return exports;
}

代码示例来源:origin: org.milyn/milyn-smooks-core

/**
 * 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);
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static void build(ApplicationContext appContext) {
  ModelSet modelSet = get(appContext);
  if(modelSet == null) {
    modelSet = new ModelSet(appContext.getStore().getUserDefinedResourceList());
    appContext.setAttribute(ModelSet.class, modelSet);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

代码示例来源:origin: smooks/smooks

@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);
    }
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
 * 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;
}

代码示例来源:origin: org.milyn/milyn-smooks-javabean

@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;
}

代码示例来源:origin: smooks/smooks

/**
 * 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 + "].");
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public static Exports getExports(final ApplicationContext appContext)
{
  Exports exports = (Exports) appContext.getAttribute(Exports.class);
  if (exports == null)
  {
    return NULL_EXPORTS;
  }
  return exports;
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
 * 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);
}

相关文章