Java开发过程中的常用工具类库
Apache Commons类库
Apache?Commons是一个非常有用的工具包,为解决各种实际的问题提供了通用现成的代码,不需要我们程序员再重复造轮子。关于这个类库的详细介绍可以访问官网介绍。下面表格列出了部分的工具包。我们平时开发过程中可以根据自己的需要挑选合适的工具包。
Components Description Latest Version ReleasedBCELByte Code Engineering Library – analyze, create, and manipulate Java class files6.3.12019/3/24BeanUtilsEasy-to-use wrappers around the Java reflection and introspection APIs.1.9.32016/9/26BSFBean Scripting Framework – interface to scripting languages, including JSR-2233.12010/6/24ChainChain of Responsibility pattern implemention.1.22008/6/2CLICommand Line arguments parser.1.42017/3/9CodecGeneral encoding/decoding algorithms (for example phonetic, base64, URL).1.122019/2/16CollectionsExtends or augments the Java Collections Framework.4.32019/2/5CompressDefines an API for working with tar, zip and bzip2 files.1.182018/8/16ConfigurationReading of configuration/preferences files in various formats.2.42018/10/29CryptoA cryptographic library optimized with AES-NI wrapping Openssl or JCE algorithm implementations.1.0.02016/7/22CSVComponent for reading and writing comma separated value files.1.62018/9/25DaemonAlternative invocation mechanism for unix-daemon-like java code.1.0.152013/4/3DBCPDatabase connection pooling services.2.6.02019/2/19DbUtilsJDBC helper library.1.72017/7/20DigesterXML-to-Java-object mapping utility.3.22011/12/13EmailLibrary for sending e-mail from Java.1.52017/8/1ExecAPI for dealing with external process execution and environment management in Java.1.32014/11/6FileUploadFile upload capability for your servlets and web applications.1.42019/1/16FunctorA functor is a function that can be manipulated as an object, or an object representing a single, generic function.12011-??-??GeometrySpace and coordinates.12018-??-??Imaging (previously called Sanselan)A pure-Java image library.0.97-incubator2009/2/20IOCollection of I/O utilities.2.62017/10/15JCIJava Compiler Interface1.12013/10/14JCSJava Caching System2.2,12018/8/23JellyXML based scripting and processing engine.1.0.12017/9/27JexlExpression language which extends the Expression Language of the JSTL.3.12017/4/14JXPathUtilities for manipulating Java Beans using the XPath syntax.1.32008/8/14LangProvides extra functionality for classes in java.lang.3.92019/4/15LoggingWrapper around a variety of logging API implementations.1.22014/7/11MathLightweight, self-contained mathematics and statistics components.3.52015/4/17NetCollection of network utilities and protocol implementations.3.62017/2/15NumbersNumber types (complex, quaternion, fraction) and utilities (arrays, combinatorics).12017-??-??OGNLAn Object-Graph Navigation Language42013-??-??PoolGeneric object pooling component.2.6.22019/4/11ProxyLibrary for creating dynamic proxies.12008/2/28RDFCommon implementation of RDF 1.1 that could be implemented by systems on the JVM.0.3.0-incubating2016/11/15RNGImplementations of random numbers generators.1.22018/12/12SCXMLAn implementation of the State Chart XML specification aimed at creating and maintaining a Java SCXML engine.It is capable of executing a state machine defined using a SCXML document, and abstracts out the environment interfaces.0.92008/12/1StatisticsStatistics.0.1????-??-??TextApache Commons Text is a library focused on algorithms working on strings.1.62018/10/16ValidatorFramework to define validators and validation rules in an xml file.1.62017/2/21VFSVirtual File System component for treating files, FTP, SMB, ZIP and such like as a single logical file system.2.32019/2/4WeaverProvides an easy way to enhance (weave) compiled bytecode.22018/9/7
除了上面表格中的工具包,Apache Common项目还包括以下几个工具包,其中的http-client是我们平时非常常用的。
Cactus: Cactus is a simple test framework for unit testing server-side java code (Servlets, EJBs, Tag Libs, Filters, …). The intent of Cactus is to lower the cost of writing tests for server-side code.
HiveMind: HiveMind is a services and configuration microkernel. HiveMind allows you to create your application using a service oriented architecture.
HttpClient 3.x: Framework for working with the client-side of the HTTP protocol.
Naming: The Naming subproject will contain common JNDI code along with various JNDI providers.
Guava类库
Guava工程包含了若干被Google的 Java项目广泛依赖 的核心库,例如:集合 [collections] 、缓存 [caching] 、原生类型支持 [primitives support] 、并发库 [concurrency libraries] 、通用注解 [common annotations] 、字符串处理 [string processing] 、I/O 等等。下面列出Guava工具包中的常用功能点,以便需要的时候查阅使用。
基本工具 [Basic utilities]
使用和避免null:null是模棱两可的,会引起令人困惑的错误,有些时候它让人很不舒服。很多Guava工具类用快速失败拒绝null值,而不是盲目地接受。
前置条件: 让方法中的条件检查更简单。
常见Object方法: 简化Object方法实现,如hashCode()和toString()。
排序: Guava强大的”流畅风格比较器”
Throwables:简化了异常和错误的传播与检查。
集合[Collections]
Guava对JDK集合的扩展,这是Guava最成熟和为人所知的部分
不可变集合: 用不变的集合进行防御性编程和性能提升。
新集合类型: multisets, multimaps, tables, bidirectional maps等。
强大的集合工具类: 提供java.util.Collections中没有的集合工具。
扩展工具类:让实现和扩展集合类变得更容易,比如创建Collection的装饰器,或实现迭代器。
缓存[Caches]
Guava Cache:本地缓存实现,支持多种缓存过期策略。
函数式风格[Functional idioms]
Guava的函数式支持可以显著简化代码,但请谨慎使用它。
并发[Concurrency]
强大而简单的抽象,让编写正确的并发代码更简单
ListenableFuture:完成后触发回调的Future
Service框架:抽象可开启和关闭的服务,帮助你维护服务的状态逻辑
字符串处理[Strings]
非常有用的字符串工具,包括分割、连接、填充等操作
原生类型[Primitives]
扩展 JDK 未提供的原生类型(如int、char)操作, 包括某些类型的无符号形式
区间[Ranges]
可比较类型的区间API,包括连续和离散类型
I/O
简化I/O尤其是I/O流和文件的操作,针对Java5和6版本
散列[Hash]
提供比Object.hashCode()更复杂的散列实现,并提供布鲁姆过滤器的实现
事件总线[EventBus]
发布-订阅模式的组件通信,但组件不需要显式地注册到其他组件中
数学运算[Math]
优化的、充分测试的数学工具类
反射[Reflection]
Guava 的 Java 反射机制工具类
Spring中的常用工具类
FileCopyUtils;
WebUtil;
以上就是Java开发中常用的工具类库有哪些的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2627535.html