You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by le...@apache.org on 2007/07/03 10:18:19 UTC

svn commit: r552711 - in /harmony/enhanced/classlib/branches/java6/modules/beans: META-INF/MANIFEST.MF src/main/java/java/beans/ConstructorProperties.java

Author: leoli
Date: Tue Jul  3 01:18:18 2007
New Revision: 552711

URL: http://svn.apache.org/viewvc?view=rev&rev=552711
Log:
Apply patch for HARMONY-4316( [classlib][beans] Annotation java.beans.ConstructorProperties is missing )

Added:
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java   (with props)
Modified:
    harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF?view=diff&rev=552711&r1=552710&r2=552711
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF Tue Jul  3 01:18:18 2007
@@ -16,6 +16,7 @@
  java.awt.event;resolution:=optional,
  java.io,
  java.lang,
+ java.lang.annotation,
  java.lang.reflect,
  java.net,
  java.nio.charset;resolution:=optional,

Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java?view=auto&rev=552711
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java Tue Jul  3 01:18:18 2007
@@ -0,0 +1,56 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.beans;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation shows the correspondence between parameters of constructor
+ * and getter methods. For example: 
+ * <code>public class Bean {
+ * 
+ *     private final int x;
+ * 
+ *     @ConstructorProperties({"x"}) 
+ *     public Bean(int x) { 
+ *         this.x = x;
+ *     }
+ * 
+ *     public int getX() { 
+ *         return x; 
+ *     } 
+ * }</code>
+ * 
+ * Using annotation ConstructorProperties on Bean's contructor means parameter x
+ * should be retrieved by getX.
+ * 
+ * @since 1.6
+ */
+@Documented
+@Target(value = CONSTRUCTOR)
+@Retention(value = RUNTIME)
+public @interface ConstructorProperties {
+
+    public String[] value();
+
+}

Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ConstructorProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native