org.springframework.context.ApplicationContext.getAliases()方法的使用及代码示例

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

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

ApplicationContext.getAliases介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Checks name and aliases of the given bean for URLs, starting with "/".
 */
@Override
protected String[] determineUrlsForHandler(String beanName) {
  List<String> urls = new ArrayList<>();
  if (beanName.startsWith("/")) {
    urls.add(beanName);
  }
  String[] aliases = obtainApplicationContext().getAliases(beanName);
  for (String alias : aliases) {
    if (alias.startsWith("/")) {
      urls.add(alias);
    }
  }
  return StringUtils.toStringArray(urls);
}

代码示例来源:origin: org.springframework/spring-webmvc

/**
 * Checks name and aliases of the given bean for URLs, starting with "/".
 */
@Override
protected String[] determineUrlsForHandler(String beanName) {
  List<String> urls = new ArrayList<>();
  if (beanName.startsWith("/")) {
    urls.add(beanName);
  }
  String[] aliases = obtainApplicationContext().getAliases(beanName);
  for (String alias : aliases) {
    if (alias.startsWith("/")) {
      urls.add(alias);
    }
  }
  return StringUtils.toStringArray(urls);
}

代码示例来源:origin: stackoverflow.com

for(String s:context.getBeanDefinitionNames()){
  System.out.println(s);
  for(String t:context.getAliases(s)){
    System.out.println("\t" + t);

代码示例来源:origin: Nepxion/Discovery

public String[] getAliases(String name) {
  return applicationContext.getAliases(name);
}

代码示例来源:origin: net.sf.taverna.t2.infrastructure/platform-spring

/**
 * Delegates to internal ApplicationContext supplied by constructor
 */
public final String[] getAliases(String arg0) {
  return context.getAliases(arg0);
}

代码示例来源:origin: daijiejay/daijie

/**
   * 如果给定的bean名字在bean定义中有别名,则返回这些别名
   *
   * @param name bean注册名
   * @return String[] 别名
   * @throws NoSuchBeanDefinitionException 抛出异常
   */
  public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
    return applicationContext.getAliases(name);
  }
}

代码示例来源:origin: xuminwlt/j360-datasource

/**
   * 如果给定的bean名字在bean定义中有别名,则返回这些别名
   * 
   * @param name
   * @return
   * @throws NoSuchBeanDefinitionException
   */
  public static String[] getAliases(String name)
      throws NoSuchBeanDefinitionException {
    return applicationContext.getAliases(name);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

/**
 * @param arg0
 * @return
 * @see org.springframework.beans.factory.BeanFactory#getAliases(java.lang.String)
 */
public String[] getAliases(String arg0) {
  return target.getAliases(arg0);
}

代码示例来源:origin: com.consol.citrus/citrus-ws

public String[] getAliases(String name) {
  return applicationContext.getAliases(name);
}
public boolean containsBean(String name) {

代码示例来源:origin: Yirendai/cicada

/**
 * 如果给定的bean名字在bean定义中有别名,则返回这些别名.
 * 
 */
public static String[] getAliases(final String name) throws NoSuchBeanDefinitionException {
 return applicationContext.getAliases(name);
}

代码示例来源:origin: org.kuali.student.core/ks-common-util

@Override
public String[] getAliases(String name) {
  return applicationContext.getAliases(name);
}

代码示例来源:origin: org.kuali.student.common/ks-common-util

public String[] getAliases(String name) {
  return applicationContext.getAliases(name);
}

代码示例来源:origin: net.javacrumbs/smock-http

public String[] getAliases(String name) {
  return wrappedApplicationContext.getAliases(name);
}

代码示例来源:origin: com.nepxion/aquarius-common

public static String[] getAliases(String name) {
  return applicationContext.getAliases(name);
}

代码示例来源:origin: unic/neba

@Override
public String[] getAliases(String name) {
  return wrapped.getAliases(name);
}

代码示例来源:origin: com.intoverflow.booster/booster-core

public static String[] getAliasesQuietly(String name) {
  try {
    return getApplicationContext().getAliases(name);
  } catch (NoSuchBeanDefinitionException e) {
    return new String[0];
  }
}

代码示例来源:origin: apache/archiva

@Override
public String[] getAliases( String s )
{
  return applicationContext.getAliases( s );
}

代码示例来源:origin: com.github.fartherp/framework-core

/**
 * 如果给定的bean名字在bean定义中有别名,则返回这些别名
 *
 * @param name 名称
 * @return String[]
 */
public static String[] getAliases(String name) {
  return getFactory().getAliases(name);
}

代码示例来源:origin: com.intoverflow.booster/booster-core

public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
  return getApplicationContext().getAliases(name);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
protected String[] buildUrlsForHandler(String beanName, Class<?> beanClass) {
  List<String> urls = new ArrayList<String>();
  urls.add(generatePathMapping(beanName));
  String[] aliases = getApplicationContext().getAliases(beanName);
  for (String alias : aliases) {
    urls.add(generatePathMapping(alias));
  }
  return StringUtils.toStringArray(urls);
}

相关文章