日期:2014-05-20  浏览次数:20799 次

谁能解释下面这个类。
/*
 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package javax.xml.ws;

import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;

/** 
 * Used to annotate a generated service interface.
 *
 * <p>The information specified in this annotation is sufficient
 * to uniquely identify a <code>wsdl:service</code>
 * element inside a WSDL document. This <code>wsdl:service</code>
 * element represents the Web service for which the generated
 * service interface provides a client view.
 *
 * @since JAX-WS 2.0
**/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface WebServiceClient { [color=#FF0000]//这种写法是什么意思? /**[/color] * The local name of the Web service.
  **/
  String name() default "";

  /**
  * The namespace for the Web service.
  **/
  String targetNamespace() default ""; //这种写法是什么意思? /**
  * The location of the WSDL document for the service (a URL).
  **/
  String wsdlLocation() default "";
}


------解决方案--------------------
JAVA中的注解类的定义语法。
可以看一下java.lang.annotation包。
你应该见过@SuppressWarnings这样的注解,可以去看一下java.lang.SuppressWarnings的源代码。
------解决方案--------------------
这个应该是SPRING的注解吧
------解决方案--------------------
注解的定义方式。。因为大都是使用别人定义好的注解,很少自定义注解,所以看了觉得陌生
------解决方案--------------------
@interface 表示定义一个 annotation

因为 Java 语言中的关键字有限,为了向下兼容,因此新增的语法只能在现有的关键字中拼凑出来。