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

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

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

ApplicationContext.setAttribute介绍

暂无

代码示例

代码示例来源: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 setExportsInApplicationContext(final ApplicationContext appContext, final Exports exports)
{
  appContext.setAttribute(Exports.class, exports);
}

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

/**
 * 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 void set(Object key, Object value) {
  applicationContext.setAttribute(key, value);
}

代码示例来源: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

/**
 * 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-core

public static void setExportsInApplicationContext(final ApplicationContext appContext, final Exports exports)
{
  appContext.setAttribute(Exports.class, exports);
}

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

public static void setExportsInApplicationContext(final ApplicationContext appContext, final Exports exports)
{
  appContext.setAttribute(Exports.class, exports);
}

代码示例来源: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: org.milyn/milyn-smooks-edi

/**
 * Get the mapping model table from the context.
 * @param context The context from which to extract the mapping table.
 * @return The mapping model talbe.
 */
protected static Hashtable getMappingTable(ApplicationContext context) {
  Hashtable mappingModelTable = (Hashtable) context.getAttribute(MAPPING_TABLE_CTX_KEY);
  if(mappingModelTable == null) {
    mappingModelTable = new Hashtable();
    context.setAttribute(MAPPING_TABLE_CTX_KEY, mappingModelTable);
  }
  return mappingModelTable;
}

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

public static Map<Class<?>, Map<String, BeanWriter>> getBeanWriters(ApplicationContext appContext) {
    Map<Class<?>, Map<String, BeanWriter>> beanWriters = (Map<Class<?>, Map<String, BeanWriter>>) appContext.getAttribute(BeanWriter.class);

    if(beanWriters == null) {
      beanWriters = new HashMap<Class<?>, Map<String, BeanWriter>>();
      appContext.setAttribute(BeanWriter.class, beanWriters);
    }

    return beanWriters;
  }
}

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

public static Map<Class<?>, Map<String, BeanWriter>> getBeanWriters(ApplicationContext appContext) {
    Map<Class<?>, Map<String, BeanWriter>> beanWriters = (Map<Class<?>, Map<String, BeanWriter>>) appContext.getAttribute(BeanWriter.class);

    if(beanWriters == null) {
      beanWriters = new HashMap<Class<?>, Map<String, BeanWriter>>();
      appContext.setAttribute(BeanWriter.class, beanWriters);
    }

    return beanWriters;
  }
}

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

@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: 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: org.milyn/milyn-smooks-all

public static Map<Class<?>, Map<String, BeanWriter>> getBeanWriters(ApplicationContext appContext) {
    Map<Class<?>, Map<String, BeanWriter>> beanWriters = (Map<Class<?>, Map<String, BeanWriter>>) appContext.getAttribute(BeanWriter.class);

    if(beanWriters == null) {
      beanWriters = new HashMap<Class<?>, Map<String, BeanWriter>>();
      appContext.setAttribute(BeanWriter.class, beanWriters);
    }

    return beanWriters;
  }
}

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

public static LocatorIndex getLocatorIndex(ApplicationContext applicationContext) {
  LocatorIndex counter = (LocatorIndex) applicationContext.getAttribute(CONTEXT);
  if(counter == null) {
    counter = new LocatorIndex();
    applicationContext.setAttribute(CONTEXT, counter);
  }
  return counter;
}

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

private static ResultSetContextObject getInstance(String rsAppContextKey, ApplicationContext appContext) {
    ResultSetContextObject rsContextObj = (ResultSetContextObject) appContext.getAttribute(rsAppContextKey);
    if(rsContextObj == null) {
      synchronized (appContext) {
        rsContextObj = (ResultSetContextObject) appContext.getAttribute(rsAppContextKey);
        if(rsContextObj == null) {
          rsContextObj = new ResultSetContextObject();
          appContext.setAttribute(rsAppContextKey, rsContextObj);
        }
      }
    }
    return rsContextObj;
  }
}

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

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

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

相关文章