Home > 类库下载 > java类库 > body text

Top 16 Java utility libraries

高洛峰
Release: 2016-10-15 13:56:48
Original
1740 people have browsed it

In Java, there are many practical class libraries, and they usually define a series of methods with common functions. This article summarizes the most commonly used utility classes in Java and their most commonly used methods. Both classes and methods within classes are sorted by popularity.

The classes and methods listed in this article are commonly used class libraries and methods that have gone through a lot of practice, and we can use them directly. Of course, we can implement the functions implemented by these methods ourselves, but since there are already very mature methods for us to use, there is no need to define them ourselves. Many classes and methods can actually understand what they do through their names. Each method has a link to see how it is used in open source code.

The following list is derived by analyzing 50K open source projects.

1. org.apache.commons.io.IOUtils

closeQuietly ( )

toString ( )

copy ( )

toByteArray ( )

write ( )

toInputStream ( )

readLines ( )

copyLarge ()

writeStringToFile ( )

forceMkdir ( )

write ( )

listFiles ( )

copyDirectory ( )

forceDelete ( )

3. org.apache.commons.lang.StringUtils

isBlank ( )

isNotBlank ( )

isEmpty ( )

isNotEmpty ( )

equals ( )

join ( )

split ( )

EMPTY

trimToNull ( )

replace ( )

4. org.apache.http.util.Entity Utils

toString ( )

consume ( )

toByteArray ( )

consumeQuietly ( )

getContentCharSet ( )

5. isNotBlank ( )

isEmpty ( )

isNotEmpty ( )

join ( )

equals ( )

split ( )

EMPTY

replace ( )

capitalize ( )

6. org.apache.commons.io.FilenameUtils

getExtension ()

getBaseName ()

isExtension ( )

7. org.springframework.util.StringUtils

hasText ( )

hasLength ( )

isEmpty ( )

commaDelimitedListToStringArray ( )

collectionToDelimitedString ( )

replace ( )

de limitedListToStringArray ( )

uncapitalize ( )

collectionToCommaDelimitedString ( )

tokenizeToStringArray ( )

8. org.apache.commons.lang.ArrayUtils

contains ( )

addAll ( )

clone ( )

isEmpty ( )

add ( )

EMPTY_BYTE_ARRAY

subarray ()

escapeXml ( )

escapeSql ( )

unescapeJava ( )

escapeJava ( )

escapeJavaScript ( )

unescapeXml ( )

unescapeJavaScript ( )

10. org.apache.http.client.utils.URLEncodedUtils

format ( )

parse ()

sha512Hex ()

sha1 ()

find ( )

collect ( )

forAllDo ( )

addAll ( )

isEqualCollection ( )

13. org.apache.commons.lang3.ArrayUtils

contains ( )

isEmpty ( )

isNotEmpty ( )

add ( )

clone ( )

addAll ( )

subarray ( )

indexOf ( )

EMPTY_OBJECT_ARRAY

EMPTY_STRING_ARRAY

14. org.apache.commons.beanutils .PropertyUtils

getProperty ( )

setProperty ( )

getPropertyDescriptors ( )

isReadable ( )

copyProperties ( )

getPropertyDescriptor ( )

getSimpleProperty ( )

isWriteable ( )

setSimpleProperty ( )

getPropertyType ( )

15. org. apache.commons.lang3.StringEscapeUtils

unescapeHtml4 ( )

escapeHtml4 ( )

escapeXml ( )

unescapeXml ( )

escapeJava ( )

escapeEcmaScript ( )

unescapeJava ( )

escapeJson ( )

escapeXml10 ( )

16. org.apache.commons.beanutils.BeanUtils

copyProperties ( )

getProperty ( )

setProperty ( )

describe ( )

populate ( )

copyProperty ( )

cloneBean ( )

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!