gradle:
implementation("com.woyouyigegushi.common-ls:common-ls:1.0.5")
maven:
<dependency>
<groupId>com.woyouyigegushi.common-ls</groupId>
<artifactId>common-ls</artifactId>
<version>1.0.5</version>
</dependency>
This is a mybatis plugin with groovy script language driver.
doc: GroovySql.md
You can use the BeanConnector to access a java bean data.
Person person = new Person("Jan", 30);
BeanConnector connector = BeanConnector.connect(person);
System.out.println(connector.getProperty("age"));
System.out.println(connector.getProperty("name"));
Read configuration from multi place. For example, if a properties file in the jar file and the content is
example.key1=key1
example.key2=key2
And a properties file in the classpath(WEB-INF/classes or the home of a bach e.g.),and the content is
example.key1=cat
so, if you call
ConfigProperty configProperty = ConfigProperty.getInstance();
configProperty.setFileEncoding("UTF-8");
configProperty.setLocations(getResource());
configProperty.loadProperties();
configProperty.getProperty("example.key1", "default"); // return cat
configProperty.getProperty("example.key2", "default"); // return key2
List<Properties> history = configProperty.getAllPropertiesLoadedHistoryIncludeOverwrite(); // return all histories of all properties file loaded.
easy to use of Context.
Application: Application.getContext().setAttribute();
GlobalContext: GlobalContext.getContext().setAttribute();
ThreadLocalContext: ThreadLocalContext.getContext().setAttribute();
ServletContext: servlet information.
ServletContextFilter: a filter to web application.
CSVHeader header = CSV.openCsv("test.csv", "UTF-8", true).getHeader();
List<CSVRow> list = CSV.openCsv("test.csv", "UTF-8", true).getRows();
CSV.newCsv("header1", "header2", "header3").addRow(new String[]{"1", "2", "3"}).addRow("4", "5", "6").saveFile("test.csv", "UTF-8");