package com.mantis;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
@ConfigurationProperties( prefix="myProps") //接收application.yml中的myProps下面的属性
public class MyProps {
private String simpleProp;
private String arrayProps;
private List<Map<String,String>> listProp1=new ArrayList<>();
private List<String>listProp2=new ArrayList<>();
private Map<String,String>mapProps=new HashMap<>();
public void setMapProps(Map<String, String> mapProps) {
this.mapProps = mapProps;
}
public String getSimpleProp() {
return simpleProp;
}
public String getArrayProps() {
return arrayProps;
}
public List<Map<String, String>> getListProp1() {
return listProp1;
}
public List<String> getListProp2() {
return listProp2;
}
public void setSimpleProp(String simpleProp) {
this.simpleProp = simpleProp;
}
public void setArrayProps(String arrayProps) {
this.arrayProps = arrayProps;
}
public void setListProp1(List<Map<String, String>> listProp1) {
this.listProp1 = listProp1;
}
public void setListProp2(List<String> listProp2) {
this.listProp2 = listProp2;
}
public Map<String, String> getMapProps() {
return mapProps;
}
@Override
public String toString() {
return "MyProps{" +
"simpleProp='" + simpleProp + '\'' +
", arrayProps='" + arrayProps + '\'' +
", listProp1=" + listProp1 +
", listProp2=" + listProp2 +
", mapProps=" + mapProps +
'}';
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
idea读取YML配置文件readApplication (100个子文件)
fileHashes.bin 19KB
last-build.bin 1B
MyProps.class 3KB
MyPropsTest.class 1KB
ReadYMLApplication.class 879B
build.gradle 3KB
settings.gradle 40B
readApplication_main.iml 8KB
readApplication_test.iml 8KB
readApplication.iml 795B
spring-boot-configuration-processor-1.5.6.RELEASE.jar 59KB
MyProps.java 2KB
MyPropsTest.java 608B
ReadYMLApplication.java 602B
buildOutputCleanup.lock 17B
taskHistory.lock 17B
fileHashes.lock 17B
MANIFEST.MF 25B
readapplication.properties 322B
cache.properties 51B
gc.properties 0B
workspace.xml 98KB
Gradle___com_mantis___readApplication_1_0_SNAPSHOT_war__exploded_.xml 11KB
uiDesigner.xml 9KB
readapplication.xml 5KB
module_readapplication_test.xml 5KB
module_readapplication_main.xml 4KB
module_readapplication.xml 3KB
Gradle__org_springframework_boot_spring_boot_configuration_processor_1_5_4_RELEASE.xml 742B
Gradle__org_springframework_boot_spring_boot_test_autoconfigure_1_5_4_RELEASE.xml 718B
Gradle__org_springframework_boot_spring_boot_starter_data_redis_1_5_4_RELEASE.xml 718B
Gradle__org_springframework_boot_spring_boot_starter_logging_1_5_4_RELEASE.xml 703B
Gradle__org_springframework_boot_spring_boot_starter_tomcat_1_5_4_RELEASE.xml 698B
Gradle__org_springframework_boot_spring_boot_autoconfigure_1_5_4_RELEASE.xml 693B
Gradle__org_springframework_boot_spring_boot_starter_jdbc_1_5_4_RELEASE.xml 688B
Gradle__org_springframework_boot_spring_boot_starter_test_1_5_4_RELEASE.xml 688B
Gradle__org_springframework_boot_spring_boot_starter_aop_1_5_4_RELEASE.xml 683B
Gradle__org_springframework_boot_spring_boot_starter_web_1_5_4_RELEASE.xml 681B
Gradle__org_springframework_data_spring_data_keyvalue_1_2_4_RELEASE.xml 668B
Gradle__org_springframework_data_spring_data_commons_1_13_4_RELEASE.xml 668B
Gradle__org_springframework_spring_context_support_4_3_9_RELEASE.xml 663B
Gradle__org_springframework_boot_spring_boot_starter_1_5_4_RELEASE.xml 663B
Gradle__org_springframework_data_spring_data_redis_1_8_4_RELEASE.xml 653B
Gradle__org_springframework_boot_spring_boot_test_1_5_4_RELEASE.xml 648B
modules.xml 648B
Gradle__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_15.xml 640B
Gradle__org_springframework_spring_expression_4_3_9_RELEASE.xml 638B
Gradle__org_springframework_spring_context_4_3_9_RELEASE.xml 623B
Gradle__org_springframework_boot_spring_boot_1_5_4_RELEASE.xml 622B
Gradle__org_hibernate_hibernate_validator_5_3_5_Final.xml 619B
gradle.xml 619B
Gradle__org_springframework_spring_webmvc_4_3_9_RELEASE.xml 618B
Gradle__org_apache_tomcat_embed_tomcat_embed_core_8_5_15.xml 615B
Gradle__com_fasterxml_jackson_core_jackson_databind_2_8_8.xml 614B
Gradle__org_springframework_spring_beans_4_3_9_RELEASE.xml 613B
Gradle__org_springframework_spring_test_4_3_9_RELEASE.xml 608B
Gradle__org_springframework_spring_jdbc_4_3_9_RELEASE.xml 608B
Gradle__org_springframework_spring_core_4_3_9_RELEASE.xml 608B
Gradle__org_apache_tomcat_embed_tomcat_embed_el_8_5_15.xml 605B
Gradle__org_springframework_spring_aop_4_3_9_RELEASE.xml 603B
Gradle__org_springframework_spring_oxm_4_3_9_RELEASE.xml 603B
Gradle__org_springframework_spring_web_4_3_9_RELEASE.xml 603B
Gradle__org_springframework_spring_tx_4_3_9_RELEASE.xml 598B
Gradle__ch_qos_logback_logback_classic_1_1_11.xml 577B
Gradle__org_slf4j_log4j_over_slf4j_1_7_25.xml 568B
Gradle__org_apache_tomcat_tomcat_jdbc_8_5_15.xml 567B
Gradle__org_apache_tomcat_tomcat_juli_8_5_15.xml 567B
Gradle__ch_qos_logback_logback_core_1_1_11.xml 562B
Gradle__org_aspectj_aspectjweaver_1_8_10.xml 559B
Gradle__com_fasterxml_classmate_1_3_3.xml 540B
Gradle___com_mantis___readApplication_1_0_SNAPSHOT_war.xml 517B
Gradle__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml 361B
Gradle__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml 337B
profiles_settings.xml 335B
Gradle__javax_validation_validation_api_1_1_0_Final.xml 320B
Gradle__org_jboss_logging_jboss_logging_3_3_1_Final.xml 319B
Gradle__com_fasterxml_jackson_core_jackson_core_2_8_8.xml 316B
Gradle__org_apache_commons_commons_pool2_2_4_2.xml 303B
lib1.xml 299B
compiler.xml 298B
Gradle__org_hamcrest_hamcrest_library_1_3.xml 294B
Gradle__com_jayway_jsonpath_json_path_2_2_0.xml 293B
Gradle__org_mockito_mockito_core_1_10_19.xml 292B
Gradle__org_slf4j_jcl_over_slf4j_1_7_25.xml 291B
Gradle__net_minidev_accessors_smart_1_1.xml 289B
Gradle__org_skyscreamer_jsonassert_1_4_0.xml 288B
Gradle__org_assertj_assertj_core_2_6_0.xml 286B
Gradle__org_hamcrest_hamcrest_core_1_3.xml 285B
Gradle__org_slf4j_jul_to_slf4j_1_7_25.xml 285B
Gradle__net_minidev_json_smart_2_2_1.xml 280B
Gradle__org_slf4j_slf4j_api_1_7_25.xml 276B
Gradle__org_objenesis_objenesis_2_1.xml 275B
Gradle__redis_clients_jedis_2_9_0.xml 269B
Gradle__org_yaml_snakeyaml_1_17.xml 268B
lib.xml 266B
Gradle__org_ow2_asm_asm_5_0_3.xml 259B
misc.xml 258B
Gradle__junit_junit_4_12.xml 250B
application.yml 287B
application.yml 287B
共 100 条
- 1
资源评论
Master_Shifu_
- 粉丝: 166
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功