8/07/2008

JAVA项目中常用开源包

本文介绍一些在JAVA项目中几乎必不可少的开源包.包括XML处理,测试,日志等方面.

1. Xanlan


Xalan-Java is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements XSL Transformations (XSLT) and XML Path Language (XPath).

Xalan-Java implements the javax.xml.transform interface in Java API for XML Processing (JAXP). This interface provides a modular framework and a standard API for performing XML transformations, and utilizes system properties to determine which Transformer and which XML parser to use. Alan-Java also implements the javax.xml.xpath interface in JAXP 1.3, which provides an object-model neutral API for evaluation of XPath expressions and access to the evaluation environment.

Xalan-Java also builds on SAX 2 and DOM level 3.

2. Xerces2


Xerces2 is a fully conforming XML Schema processor. Xerces2 also provides a complete implementation of the Document Object Model Level 3 Core and Load/Save W3C Recommendations and provides a complete implementation of the XML Inclusions (XInclude) W3C Recommendation. It also provides support for OASIS XML Catalogs v1.1.

Xerces2 is able to parse documents written according to the XML 1.1 Recommendation. It also handles namespaces according to the XML Namespaces 1.1 Recommendation, and will correctly serialize XML 1.1 documents if the DOM level 3 load/save APIs are in use.

3. Log4J


Inserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.

With log4j it is possible to enable logging at runtime without modifying the application binary. The log4j package is designed so that these statements can remain in shipped code without incurring a heavy performance cost. Logging behavior can be controlled by editing a configuration file, without touching the application binary.

Logging equips the developer with detailed context for application failures. On the other hand, testing provides quality assurance and confidence in the application. Logging and testing should not be confused. They are complementary. When logging is wisely used, it can prove to be an essential tool.

One of the distinctive features of log4j is the notion of inheritance in loggers. Using a logger hierarchy it is possible to control which log statements are output at arbitrarily fine granularity but also great ease. This helps reduce the volume of logged output and minimize the cost of logging.

The target of the log output can be a file, an OutputStream, a java.io.Writer, a remote log4j server, a remote Unix Syslog daemon, or many other output targets.

4. SAX


Simple API for XML, a widely-used specification that describes how XML parsers can pass information efficiently from XML documents to software applications. SAX was originally implemented in Java, but is now supported by nearly all major programming languages.

SAX is a streaming interface - applications receive information from XML documents in a continuous stream, with no backtracking or navigation allowed. This approach makes SAX extremely efficient, handing XML documents of nearly any size in linear time and near-constant memory, but it also places greater demands on the software developer's skills. Tree-based interfaces, like the Document Object Model (DOM), make exactly the opposite trade-off: they are much simpler for developers, but at the cost of significant time and computer resources.

5. JDOM


JDOM is, quite simply, a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing. It has a straightforward API, is a lightweight and fast, and is optimized for the Java programmer. It's an alternative to DOM and SAX, although it integrates well with both DOM and SAX.

6. JUNIT


7. ANT

0 评论:

发表评论