Some of the tool classes that Spring uses

Source: Internet
Author: User
Tags file copy print format log4j

People who learn java, or develop many projects, need to use the framework of spring, a framework for Java Programmers. To learn spring well is not afraid of finding Work. We often write some tool classes, but sometimes

We don't know if our tools are stable and reliable. For those who have to look at Spring source habits, in fact, the spring framework itself comes with a lot of tool classes, in fact, I have an idea, is to put some common methods, from spring

Sort it out and compile it into a jar package, because sometimes the project doesn't need to refer to all the jar Packages. This way to tidy up some of the spring commonly used classes, all of you refer to:

The concept of resouce in spring is useful when we are working with Io. Please refer to the Spring Manual for specific Information.

Built-in resouce type
Urlresource
Classpathresource
Filesystemresource
Servletcontextresource
Inputstreamresource
Bytearrayresource
encodedresource, Resource plus encoding, can be thought of as a coded resource.
Vfsresource (often used in jboss, and corresponding tools Vfsutils)
Org.springframework.util.xml.ResourceUtils is a tool used to describe resources that represent resource string prefixes. Such as: "classpath:".
getURL, getFile, isfileurl, isjarurl, extractjarfileurl

Tool class

Org.springframework.core.annotation.AnnotationUtils Handling annotations
Org.springframework.core.io.support.PathMatchingResourcePatternResolver for working with ant matching styles (com/*.jsp, com/*/.jsp), Finding all the resources, combined with the concept of resource above, is useful for traversing files. For details, please see Javadoc
Org.springframework.core.io.support.PropertiesLoaderUtils Load Properties Resource tool class, combined with resource
Org.springframework.core.BridgeMethodResolver Bridging Method Analyzer. For bridging methods please refer To: http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.12.4.5
The Org.springframework.core.GenericTypeResolver paradigm analyzer, which is used in the paradigm-based method, parameters Analysis.
Org.springframework.core.NestedExceptionUtils

XML tools
Org.springframework.util.xml.AbstractStaxContentHandler
Org.springframework.util.xml.AbstractStaxXMLReader
Org.springframework.util.xml.AbstractXMLReader
Org.springframework.util.xml.AbstractXMLStreamReader
Org.springframework.util.xml.DomUtils
Org.springframework.util.xml.SimpleNamespaceContext
Org.springframework.util.xml.SimpleSaxErrorHandler
Org.springframework.util.xml.SimpleTransformErrorListener
Org.springframework.util.xml.StaxUtils
Org.springframework.util.xml.TransformerUtils

Other tool sets
Org.springframework.util.xml.AntPathMatcherant-style Handling
Org.springframework.util.xml.AntPathStringMatcher
Org.springframework.util.xml.Assert asserts that it should be used frequently when our arguments are Judged.
Org.springframework.util.xml.CachingMapDecorator
Org.springframework.util.xml.ClassUtils for class processing
Org.springframework.util.xml.CollectionUtils tools for working with collections
Org.springframework.util.xml.CommonsLogWriter
Org.springframework.util.xml.CompositeIterator
Org.springframework.util.xml.ConcurrencyThrottleSupport
Org.springframework.util.xml.CustomizableThreadCreator
Org.springframework.util.xml.DefaultPropertiesPersister
Org.springframework.util.xml.DigestUtils Digest processing, Here are for MD5 processing information
Org.springframework.util.xml.FileCopyUtils file copy processing, combined with the concept of resource together to deal with, really is very convenient
Org.springframework.util.xml.FileSystemUtils
Org.springframework.util.xml.LinkedCaseInsensitiveMap
The key value is case-insensitive Linkedmap
Org.springframework.util.xml.LinkedMultiValueMap A key can hold multiple values of Linkedmap
Org.springframework.util.xml.Log4jConfigurer a log4j boot Load tool class that specifies the configuration file
Org.springframework.util.xml.NumberUtils the tool class that handles numbers, there are parsenumber that can manipulate strings into the number format we specify, and also support format format, Convertnumbertotargetclass can achieve conversions of type Number.
Org.springframework.util.xml.ObjectUtils has many methods for handling null Object. Useful methods such as nullsafehashcode, nullsafeequals, isarray, containselement, addobjecttoarray, etc.
Org.springframework.util.xml.PatternMatchUtilsspring is used to handle simple matches. such as Spring's typical "xxx", "xxx" and "xxx" pattern Styles
Org.springframework.util.xml.PropertyPlaceholderHelper for handling placeholder replacements
Org.springframework.util.xml.ReflectionUtils reflects common tool methods. findField, setfield, getField, findmethod, InvokeMethod and other useful methods.
Org.springframework.util.xml.SerializationUtils for serialization and deserialization of Java. serialize and deserialize methods
Org.springframework.util.xml.StopWatch a good tool class for recording execution time, and can be used to test the task in a phased time. finally, A good-looking print format is Supported. This class should always be used
Org.springframework.util.xml.StringUtils
Org.springframework.util.xml.SystemPropertyUtils
Org.springframework.util.xml.TypeUtils used for type-compatible Judgments. isassignable
Org.springframework.util.xml.WeakReferenceMonitor monitoring of weak references

web-related Tools

Org.springframework.web.util.CookieGenerator
Org.springframework.web.util.HtmlCharacterEntityDecoder
Org.springframework.web.util.HtmlCharacterEntityReferences
Org.springframework.web.util.HtmlUtils
Org.springframework.web.util.HttpUrlTemplate
This class is used to construct a URL using a string template that automatically handles Chinese characters and other related encodings in the Url. When reading URL resources provided by others, you should always use the
String URL = "http://localhost/myapp/{name}/{id}";
Org.springframework.web.util.JavaScriptUtils
Org.springframework.web.util.Log4jConfigListener
Using listener to formulate log4j in web environment
Org.springframework.web.util.UriTemplate
Org.springframework.web.util.UriUtils encoding of special characters in URIs
Org.springframework.web.util.WebUtils

Some of the tool classes that Spring uses

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.