当前位置: 首页>>代码示例>>Java>>正文


Java Inject类代码示例

本文整理汇总了Java中com.opensymphony.xwork2.inject.Inject的典型用法代码示例。如果您正苦于以下问题:Java Inject类的具体用法?Java Inject怎么用?Java Inject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Inject类属于com.opensymphony.xwork2.inject包,在下文中一共展示了Inject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPrefixBasedActionProxyFactories

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionProxyFactories(String list) {
    if (list != null) {
        String[] factories = list.split(",");
        for (String factory : factories) {
            String[] thisFactory = factory.split(":");
            if (thisFactory.length == 2) {
                String factoryPrefix = thisFactory[0].trim();
                String factoryName = thisFactory[1].trim();
                ActionProxyFactory obj = container.getInstance(ActionProxyFactory.class, factoryName);
                if (obj != null) {
                    actionProxyFactories.put(factoryPrefix, obj);
                } else {
                    LOG.warn("Invalid PrefixBasedActionProxyFactory config entry: [{}]", factory);
                }
            }
        }
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:20,代码来源:PrefixBasedActionProxyFactory.java

示例2: setContainer

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setContainer(Container container) {
    this.container = container;
    try {
        build();
    } catch (Exception e) {
        throw new ConfigurationException(e);
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:10,代码来源:DefaultUnknownHandlerManager.java

示例3: setContainer

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setContainer(Container container) {
    Map<String, TagLibraryModelProvider> map = new HashMap<>();
    Set<String> prefixes = container.getInstanceNames(TagLibraryModelProvider.class);
    for (String prefix : prefixes) {
        map.put(prefix, container.getInstance(TagLibraryModelProvider.class, prefix));
    }
    this.tagLibraries = Collections.unmodifiableMap(map);
}
 
开发者ID:txazo,项目名称:struts2,代码行数:10,代码来源:FreemarkerManager.java

示例4: setExtensions

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_ACTION_EXTENSION)
public void setExtensions(String extensions) {
    if (StringUtils.isNotEmpty(extensions)) {
        List<String> list = new ArrayList<>();
        String[] tokens = extensions.split(",");
        Collections.addAll(list, tokens);
        if (extensions.endsWith(",")) {
            list.add("");
        }
        this.extensions = Collections.unmodifiableList(list);
    } else {
        this.extensions = null;
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:15,代码来源:DefaultActionMapper.java

示例5: CompositeActionMapper

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public CompositeActionMapper(Container container,
                             @Inject(value = StrutsConstants.STRUTS_MAPPER_COMPOSITE) String list) {
    String[] arr = StringUtils.split(StringUtils.trimToEmpty(list), ",");
    for (String name : arr) {
        Object obj = container.getInstance(ActionMapper.class, name);
        if (obj != null) {
            actionMappers.add((ActionMapper) obj);
        }
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:12,代码来源:CompositeActionMapper.java

示例6: setEnableEvalExpression

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value = XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION, required = false)
public void setEnableEvalExpression(String evalExpression) {
    enableEvalExpression = "true".equals(evalExpression);
    if(enableEvalExpression){
        LOG.warn("Enabling OGNL expression evaluation may introduce security risks " +
                "(see http://struts.apache.org/release/2.3.x/docs/s2-013.html for further details)");
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:9,代码来源:OgnlUtil.java

示例7: setMultiTextvalueSeparator

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value=MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY, required = false)
public void setMultiTextvalueSeparator(String type) {
    multiTextvalueSeparator = type;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:DefaultValidatorFileParser.java

示例8: setTextProvider

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setTextProvider(TextProvider textProvider) {
    this.textProvider = textProvider;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:TextProviderFactory.java

示例9: setFreemarkerManager

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setFreemarkerManager(FreemarkerManager mgr) {
    this.freemarkerManager = mgr;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerResult.java

示例10: setActionMapper

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setActionMapper(ActionMapper mapper) {
    this.actionMapper = mapper;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FormButton.java

示例11: setTemplateEngine

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject("ftl")
public void setTemplateEngine(TemplateEngine templateEngine) {
    this.templateEngine = templateEngine;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerThemeTemplateLoader.java

示例12: setWrapperAltMap

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_FREEMARKER_WRAPPER_ALT_MAP)
public void setWrapperAltMap(String val) {
    altMapWrapper = "true".equals(val);
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java

示例13: setApplicationContextPath

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value="applicationContextPath",required=false)
public void setApplicationContextPath(String ctx) {
    if (ctx != null) {
        setApplicationContext(new ClassPathXmlApplicationContext(ctx));
    }
}
 
开发者ID:txazo,项目名称:struts2,代码行数:7,代码来源:SpringObjectFactory.java

示例14: setObjectFactory

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setObjectFactory(ObjectFactory objectFactory) {
    this.objectFactory = objectFactory;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:DefaultActionFactory.java

示例15: setReflectionProvider

import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setReflectionProvider(ReflectionProvider reflectionProvider) {
    this.reflectionProvider = reflectionProvider;
}
 
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:DefaultValidatorFactory.java


注:本文中的com.opensymphony.xwork2.inject.Inject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。