易截截图软件、单文件、免安装、纯绿色、仅160KB

the org.apache.log4j.PatternLayout java doc


A flexible layout configurable with pattern string.
The goal of this class is to format

a LoggingEvent

and return the results as a String. The results depend on the conversion
pattern
.
The conversion pattern is closely related to the conversion pattern of the
printf function in C. A conversion pattern is composed of literal text and
format control expressions called conversion specifiers
.
You are free to insert any literal text within the conversion pattern.

Each conversion specifier starts with a percent sign (%) and is followed by
optional format modifiers
and a conversion character
. The
conversion character specifies the type of data, e.g. category, priority, date,
thread name. The format modifiers control such things as field width, padding,
left and right justification. The following is a simple example.
Let the conversion pattern be "%-5p [%t]: %m%n"
and assume that the
log4j environment was set to use a PatternLayout. Then the statements
Category root = Category.getRoot();
root.debug("Message 1");
root.warn("Message 2");

would yield the output
DEBUG [main]: Message 1
WARN [main]: Message 2

Note that there is no explicit separator between text and conversion
specifiers. The pattern parser knows when it has reached the end of a conversion
specifier when it reads a conversion character. In the example above the
conversion specifier %-5p
means the priority of the logging event should
be left justified to a width of five characters. The recognized conversion
characters are
Conversion Character
Effect
c
Used to output the category of the logging event. The category conversion
specifier can be optionally followed by precision specifier
, that is a
decimal constant in brackets.
If a precision specifier is given, then only the corresponding number of
right most components of the category name will be printed. By default the
catego


相关文档:

java集合小结

在使用Java的时候,我们都会遇到使用集合(Collection)的时候,但是Java API提供了多种集合的实现,我在使用和面试的时候频
频遇到这样的“抉择” 。 :)(主要还是面试的时候)
久而久之,也就有了一点点的心得体会,写出来以供大家讨论 。
总的说来,Java API中所用的集合类,都是实现了Collection接口,他 ......

Java线程新特征 线程池

Sun在Java5中,对Java线程的类库做了大量的扩展,其中线程池就是Java5的新特征之一,除了线程池之外,还有很多多线程相关的内容,为多线程的编程带来了极大便利。为了编写高效稳定可靠的多线程程序,线程部分的新增内容显得尤为重要。
 
有关Java5线程新特征的内容全部在java.util.concurrent下面,里面包含数目众多 ......

JAVA笔记(二)

在类中定义的方法在返回值前加上static修饰符就可以在main方法中调用了。如果不用static那就需要在main方法中创建对象,使用对象来调用对象的方法。
public class Test{
 public static void main(String[] args){
  Test t=new Test();
  int b=1;
  int c=2;
  int[] ......

JAVA反射小结

1  JAVA的反射,其实就是通过一个实例化的对象反过来去找到一个类的完整信息,比如对于如下的形式:
X x=new X();
   x.getClass().getName();
这里就会输出这个类所在的完整信息,即"包名.类名";
  最常用的三种实例化CLASS类对象
Class<?> c1 = null ;  // 指定泛型
  C ......

通过JNI在JAVA与C程序中传递参数

一、编辑Java源文件
=============================================
Hello.java
=============================================
package test;
public class Hello
{
  static
  {
    try
    {
      //此处即为本地方法所在链接库名
&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号