if(StringUtils.isBlank(inputString)){...} 替換 if(inputString == null || inputString.length == 0){......}
<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.4</version> </dependency>
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>19.0</version> </dependency>
<dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.9.3</version> </dependency>
<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.21</version> </dependency>
<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.5</version> </dependency>
<dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>0.9.28</version> <type>jar</type> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> <type>jar</type> </dependency>
ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally User user = mapper.readValue(new File("user.json"), User.class);
Gson gson = new Gson(); String[] strings = {"abc", "def", "ghi"}; gson.toJson(strings); // ==> ["abc", "def", "ghi"]
JasperReports提供了一套完整的報表解決方案,幫助用戶使用用Java語言來開發具備報告功能的程序。JasperReports的模版採用XML格式,從數據庫中抽取數據,並以PDF、HTML、XLS、CSV及XML等各類格式生成報表。它的一大優點是可以處理大數據量的報表。html
@Test public void lookupEmailAddresses() { assertThat(new CartoonCharacterEmailLookupService().getResults("looney"), allOf( not(empty()), containsInAnyOrder( allOf(instanceOf(Map.class), hasEntry("id", "56"), hasEntry("email", "roadrunner@fast.org")), allOf(instanceOf(Map.class), hasEntry("id", "76"), hasEntry("email", "wiley@acme.com")) ) )); }
<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.14</version> </dependency>
<dependency> <groupId>org.docx4j</groupId> <artifactId>docx4j</artifactId> <version>3.3.0</version> </dependency>
<dependency> <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> <version>2.0.2</version> </dependency>
<dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency>
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.11.0</version> </dependency>
Document doc = Jsoup.connect("http://en.wikipedia.org/").get(); Elements newsHeadlines = doc.select("#mp-itn b a");