org.milyn.container.ApplicationContext.getResourceLocator()方法的使用及代码示例

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

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

ApplicationContext.getResourceLocator介绍

[英]Get the container resource locator for the context.
[中]获取上下文的容器资源定位器。

代码示例

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

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

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

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

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

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

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

ContainerResourceLocator resLocator = applicationContext.getResourceLocator();

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

@Initialize
public void intialize() {
  String trimmedTemplateConfig = templateConfig.trim();
  // Only attempt to load as a template resource URI if the configured 'template'
  // value is all on one line.  If it has line breaks then we know it's not an
  // external resource...
  if(trimmedTemplateConfig.trim().indexOf('\n') == -1) {
    try {
      InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig);
      if(templateStream != null) {
        templateConfig = StreamUtils.readStreamAsString(templateStream);                    
      }
    } catch (IOException e) {
      logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template.  Using configured value as the actual template.");
    }
  }
  // Create the template instance...
  template = new FreeMarkerTemplate(templateConfig);
}

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

@Initialize
public void intialize() {
  String trimmedTemplateConfig = templateConfig.trim();
  // Only attempt to load as a template resource URI if the configured 'template'
  // value is all on one line.  If it has line breaks then we know it's not an
  // external resource...
  if(trimmedTemplateConfig.trim().indexOf('\n') == -1) {
    try {
      InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig);
      if(templateStream != null) {
        templateConfig = StreamUtils.readStreamAsString(templateStream);                    
      }
    } catch (IOException e) {
      logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template.  Using configured value as the actual template.");
    }
  }
  // Create the template instance...
  template = new FreeMarkerTemplate(templateConfig);
}

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

@Initialize
public void intialize() {
  String trimmedTemplateConfig = templateConfig.trim();
  // Only attempt to load as a template resource URI if the configured 'template'
  // value is all on one line.  If it has line breaks then we know it's not an
  // external resource...
  if(trimmedTemplateConfig.trim().indexOf('\n') == -1) {
    try {
      InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig);
      if(templateStream != null) {
        templateConfig = StreamUtils.readStreamAsString(templateStream);                    
      }
    } catch (IOException e) {
      logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template.  Using configured value as the actual template.");
    }
  }
  // Create the template instance...
  template = new FreeMarkerTemplate(templateConfig);
}

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

@Override
public void parse(InputSource unedifactInterchange) throws IOException,
    SAXException {
  ignoreNewLines(ignoreNewLines);
  ignoreEmptyNodes(ignoreEmptyNodes);
  validate(validate);
  // Default Mappings Registry is already set to LazyMappingsRegistry
  // only if mappingModel is defined we should set another instance
  if (!StringUtils.isEmpty(mappingModel)) {
    setMappingsRegistry(new DefaultMappingsRegistry(mappingModel, applicationContext.getResourceLocator().getBaseURI()));
  }
  super.parse(unedifactInterchange);
}

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

@Override
public void parse(InputSource unedifactInterchange) throws IOException,
    SAXException {
  ignoreNewLines(ignoreNewLines);
  ignoreEmptyNodes(ignoreEmptyNodes);
  validate(validate);
  // Default Mappings Registry is already set to LazyMappingsRegistry
  // only if mappingModel is defined we should set another instance
  if (!StringUtils.isEmpty(mappingModel)) {
    setMappingsRegistry(new DefaultMappingsRegistry(mappingModel, applicationContext.getResourceLocator().getBaseURI()));
  }
  super.parse(unedifactInterchange);
}

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

if(edifactModel == null) {
  try {
    ContainerResourceLocator resourceLocator = applicationContext.getResourceLocator();

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

if(edifactModel == null) {
  try {
    ContainerResourceLocator resourceLocator = applicationContext.getResourceLocator();

相关文章