Weld SVN: r6362 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-30 22:55:54 -0400 (Sun, 30 May 2010)
New Revision: 6362
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java
Log:
unnecessary generification
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java 2010-05-31 02:50:10 UTC (rev 6361)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java 2010-05-31 02:55:54 UTC (rev 6362)
@@ -9,7 +9,7 @@
*
* @author Shane Bryzak
*/
-public class TypedBeanProperty<T> extends AbstractBeanProperty
+public class TypedBeanProperty extends AbstractBeanProperty
{
private Class<?> propertyClass;
14 years, 6 months
Weld SVN: r6361 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-30 22:50:10 -0400 (Sun, 30 May 2010)
New Revision: 6361
Added:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AbstractBeanProperty.java
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java
Log:
WELDX-106
Added: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AbstractBeanProperty.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AbstractBeanProperty.java (rev 0)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AbstractBeanProperty.java 2010-05-31 02:50:10 UTC (rev 6361)
@@ -0,0 +1,356 @@
+package org.jboss.weld.extensions.util;
+
+import java.beans.Introspector;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+
+/**
+ * Base class for bean property wrappers
+ *
+ * @author Shane Bryzak
+ */
+public abstract class AbstractBeanProperty
+{
+ /**
+ * Property field
+ */
+ private Field propertyField;
+
+ /**
+ * Property getter method
+ */
+ private Method propertyGetter;
+
+ /**
+ * Property setter method
+ */
+ private Method propertySetter;
+
+ /**
+ * Property name
+ */
+ private String name;
+
+ /**
+ * The class containing the property
+ */
+ private Class<?> targetClass;
+
+ /**
+ * Flag indicating whether the target class has been scanned
+ */
+ private boolean scanned = false;
+
+ private boolean isFieldProperty;
+
+ /**
+ * Flag indicating whether a valid property has been found
+ */
+ private boolean valid = false;
+
+ private Type propertyType;
+
+ /**
+ *
+ * @param targetClass
+ */
+ public AbstractBeanProperty(Class<?> targetClass)
+ {
+ this.targetClass = targetClass;
+ }
+
+ protected void scan()
+ {
+ if (scanned) return;
+
+ scanned = true;
+
+ // First check declared fields
+ for (Field f : targetClass.getDeclaredFields())
+ {
+ if (fieldMatches(f))
+ {
+ setupFieldProperty(f);
+ valid = true;
+ return;
+ }
+ }
+
+ // Then check public fields, in case it's inherited
+ for (Field f : targetClass.getFields())
+ {
+ if (fieldMatches(f))
+ {
+ setupFieldProperty(f);
+ valid = true;
+ return;
+ }
+ }
+
+ // Then check public methods (we ignore private methods)
+ for (Method m : targetClass.getMethods())
+ {
+ if (methodMatches(m))
+ {
+ String methodName = m.getName();
+
+ if ( m.getName().startsWith("get") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(3) );
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(2) );
+ }
+
+ if (this.name != null)
+ {
+ this.propertyGetter = getGetterMethod(targetClass, this.name);
+ this.propertySetter = getSetterMethod(targetClass, this.name);
+ this.propertyType = this.propertyGetter.getGenericReturnType();
+ isFieldProperty = false;
+ valid = true;
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
+ "Method: " + m + " in class: " + targetClass);
+ }
+ }
+ }
+ }
+
+ protected abstract boolean fieldMatches(Field f);
+
+ protected abstract boolean methodMatches(Method m);
+
+ private void setupFieldProperty(Field propertyField)
+ {
+ this.propertyField = propertyField;
+ isFieldProperty = true;
+ this.name = propertyField.getName();
+ this.propertyType = propertyField.getGenericType();
+ }
+
+ /**
+ * This method sets the property value for a specified bean to the specified
+ * value. The property to be set is either a field or setter method that
+ * matches the specified annotation class and returns true for the isMatch()
+ * method.
+ *
+ * @param bean The bean containing the property to set
+ * @param value The new property value
+ * @throws Exception
+ */
+ public void setValue(Object bean, Object value) throws Exception
+ {
+ scan();
+
+ if (isFieldProperty)
+ {
+ setFieldValue(propertyField, bean, value);
+ }
+ else
+ {
+ invokeMethod(propertySetter, bean, value);
+ }
+ }
+
+ /**
+ * Returns the property value for the specified bean. The property to be
+ * returned is either a field or getter method that matches the specified
+ * annotation class and returns true for the isMatch() method.
+ *
+ * @param bean The bean to read the property from
+ * @return The property value
+ * @throws Exception
+ */
+ public Object getValue(Object bean) throws Exception
+ {
+ scan();
+
+ if (isFieldProperty)
+ {
+ return getFieldValue(propertyField, bean);
+ }
+ else
+ {
+ return invokeMethod(propertyGetter, bean);
+ }
+ }
+
+ /**
+ * Returns the property type
+ *
+ * @return The property type
+ */
+ public Type getPropertyType()
+ {
+ scan();
+ return propertyType;
+ }
+
+ /**
+ * Returns true if the property has been successfully located, otherwise
+ * returns false.
+ *
+ * @return
+ */
+ public boolean isValid()
+ {
+ scan();
+ return valid;
+ }
+
+ /**
+ * Returns the name of the property. If the property is a field, then the
+ * field name is returned. Otherwise, if the property is a method, then the
+ * name that is returned is the getter method name without the "get" or "is"
+ * prefix, and a lower case first letter.
+ *
+ * @return The name of the property
+ */
+ public String getName()
+ {
+ scan();
+ return name;
+ }
+
+ private Object getFieldValue(Field field, Object obj)
+ {
+ field.setAccessible(true);
+ try
+ {
+ return field.get(obj);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(buildGetFieldValueErrorMessage(field, obj), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildGetFieldValueErrorMessage(field, obj));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ }
+
+ private String buildGetFieldValueErrorMessage(Field field, Object obj)
+ {
+ return String.format("Exception reading [%s] field from object [%s].",
+ field.getName(), obj);
+ }
+
+ private void setFieldValue(Field field, Object obj, Object value)
+ {
+ field.setAccessible(true);
+ try
+ {
+ field.set(obj, value);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(buildSetFieldValueErrorMessage(field, obj, value), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildSetFieldValueErrorMessage(field, obj, value));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ }
+
+ private String buildSetFieldValueErrorMessage(Field field, Object obj, Object value)
+ {
+ return String.format("Exception setting [%s] field on object [%s] to value [%s]",
+ field.getName(), obj, value);
+ }
+
+ private Object invokeMethod(Method method, Object obj, Object... args)
+ {
+ try
+ {
+ return method.invoke(obj, args);
+ }
+ catch (IllegalAccessException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ throw new IllegalArgumentException(buildInvokeMethodErrorMessage(method, obj, args), ex.getCause());
+ }
+ catch (InvocationTargetException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(buildInvokeMethodErrorMessage(method, obj, args));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ catch (ExceptionInInitializerError e)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), e);
+ }
+ }
+
+ private String buildInvokeMethodErrorMessage(Method method, Object obj, Object... args)
+ {
+ StringBuilder message = new StringBuilder(String.format(
+ "Exception invoking method [%s] on object [%s], using arguments [",
+ method.getName(), obj));
+ if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
+ message.append("]");
+ return message.toString();
+ }
+
+ private Method getSetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( methodName.startsWith("set") && method.getParameterTypes().length==1 )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such setter method: " + clazz.getName() + '.' + name);
+ }
+
+ private Method getGetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( method.getParameterTypes().length==0 )
+ {
+ if ( methodName.startsWith("get") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(2) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such getter method: " + clazz.getName() + '.' + name);
+ }
+}
Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java 2010-05-30 11:54:06 UTC (rev 6360)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java 2010-05-31 02:50:10 UTC (rev 6361)
@@ -1,36 +1,22 @@
package org.jboss.weld.extensions.util;
-import java.beans.Introspector;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.lang.ExceptionInInitializerError;
/**
- * A convenience class for working with an annotated property (either a field or method) of
- * a JavaBean class. By providing an isMatch() method in a concrete implementation
- * of this class, annotations may be matched on their attribute values or other
- * conditions.
+ * A convenience class for working with an annotated property (either a field or
+ * method) of a JavaBean class. By providing an overridden annotationMatches()
+ * method in a subclass, annotations may be matched on their attribute values or
+ * other conditions.
*
* @author Shane Bryzak
*/
-public class AnnotatedBeanProperty<T extends Annotation>
-{
- private Field propertyField;
- private Method propertyGetter;
- private Method propertySetter;
- private String name;
- private Type propertyType;
+public class AnnotatedBeanProperty<T extends Annotation> extends AbstractBeanProperty
+{
private T annotation;
- private boolean isFieldProperty;
- private boolean set = false;
-
- private Class<?> targetClass;
private Class<T> annotationClass;
- private boolean scanned = false;
/**
* Default constructor
@@ -41,150 +27,49 @@
*/
public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
{
- this.targetClass = cls;
+ super(cls);
this.annotationClass = annotationClass;
}
- /**
- * Scans the target class to locate the annotated property
- */
- private void scan()
+ protected boolean fieldMatches(Field f)
{
- // First check declared fields
- for (Field f : targetClass.getDeclaredFields())
- {
- if (f.isAnnotationPresent(annotationClass) &&
- isMatch(f.getAnnotation(annotationClass)))
- {
- setupFieldProperty(f);
- this.annotation = f.getAnnotation(annotationClass);
- set = true;
- return;
- }
- }
-
- // Then check public fields, in case it's inherited
- for (Field f : targetClass.getFields())
- {
- if (f.isAnnotationPresent(annotationClass) &&
- isMatch(f.getAnnotation(annotationClass)))
- {
- this.annotation = f.getAnnotation(annotationClass);
- setupFieldProperty(f);
- set = true;
- return;
- }
+ if (f.isAnnotationPresent(annotationClass) &&
+ annotationMatches(f.getAnnotation(annotationClass)))
+ {
+ this.annotation = f.getAnnotation(annotationClass);
+ return true;
}
-
- // Then check public methods (we ignore private methods)
- for (Method m : targetClass.getMethods())
- {
- if (m.isAnnotationPresent(annotationClass) &&
- isMatch(m.getAnnotation(annotationClass)))
- {
- this.annotation = m.getAnnotation(annotationClass);
- String methodName = m.getName();
-
- if ( m.getName().startsWith("get") )
- {
- this.name = Introspector.decapitalize( m.getName().substring(3) );
- }
- else if ( methodName.startsWith("is") )
- {
- this.name = Introspector.decapitalize( m.getName().substring(2) );
- }
-
- if (this.name != null)
- {
- this.propertyGetter = getGetterMethod(targetClass, this.name);
- this.propertySetter = getSetterMethod(targetClass, this.name);
- this.propertyType = this.propertyGetter.getGenericReturnType();
- isFieldProperty = false;
- set = true;
- }
- else
- {
- throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
- "Method: " + m + " in class: " + targetClass);
- }
- }
- }
-
- scanned = true;
- }
-
- /**
- * This method may be overridden by a subclass. It can be used to scan
- * for an annotation with particular attribute values, or to allow a match
- * based on more complex logic.
- *
- * @param annotation The potential match
- * @return true if the specified annotation is a match
- */
- protected boolean isMatch(T annotation)
- {
- return true;
- }
-
- /**
- * This method sets the property value for a specified bean to the specified
- * value. The property to be set is either a field or setter method that
- * matches the specified annotation class and returns true for the isMatch()
- * method.
- *
- * @param bean The bean containing the property to set
- * @param value The new property value
- * @throws Exception
- */
- public void setValue(Object bean, Object value) throws Exception
- {
- if (!scanned) scan();
-
- if (isFieldProperty)
- {
- setFieldValue(propertyField, bean, value);
- }
else
{
- invokeMethod(propertySetter, bean, value);
+ return false;
}
}
-
- /**
- * Returns the property value for the specified bean. The property to be
- * returned is either a field or getter method that matches the specified
- * annotation class and returns true for the isMatch() method.
- *
- * @param bean The bean to read the property from
- * @return The property value
- * @throws Exception
- */
- public Object getValue(Object bean) throws Exception
+
+ protected boolean methodMatches(Method m)
{
- if (!scanned) scan();
-
- if (isFieldProperty)
+ if (m.isAnnotationPresent(annotationClass) &&
+ annotationMatches(m.getAnnotation(annotationClass)))
{
- return getFieldValue(propertyField, bean);
+ this.annotation = m.getAnnotation(annotationClass);
+ return true;
}
else
{
- return invokeMethod(propertyGetter, bean);
+ return false;
}
}
/**
- * Returns the name of the property. If the property is a field, then the
- * field name is returned. Otherwise, if the property is a method, then the
- * name that is returned is the getter method name without the "get" or "is"
- * prefix, and a lower case first letter.
+ * This method may be overridden by a subclass. It can be used to scan
+ * for an annotation with particular attribute values, or to allow a match
+ * based on more complex logic.
*
- * @return The name of the property
+ * @param annotation The potential match
+ * @return true if the specified annotation is a match
*/
- public String getName()
+ protected boolean annotationMatches(T annotation)
{
- if (!scanned) scan();
- return name;
+ return true;
}
/**
@@ -194,174 +79,11 @@
*/
public T getAnnotation()
{
- if (!scanned) scan();
+ scan();
return annotation;
}
+
+
- /**
- * Returns the property type
- *
- * @return The property type
- */
- public Type getPropertyType()
- {
- if (!scanned) scan();
- return propertyType;
- }
-
- /**
- * Returns true if the property has been successfully located, otherwise
- * returns false.
- *
- * @return
- */
- public boolean isSet()
- {
- if (!scanned) scan();
- return set;
- }
-
- private void setupFieldProperty(Field propertyField)
- {
- this.propertyField = propertyField;
- isFieldProperty = true;
- this.name = propertyField.getName();
- this.propertyType = propertyField.getGenericType();
- }
-
- private Object getFieldValue(Field field, Object obj)
- {
- field.setAccessible(true);
- try
- {
- return field.get(obj);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(buildGetFieldValueErrorMessage(field, obj), e);
- }
- catch (NullPointerException ex)
- {
- NullPointerException ex2 = new NullPointerException(
- buildGetFieldValueErrorMessage(field, obj));
- ex2.initCause(ex.getCause());
- throw ex2;
- }
- }
-
- private String buildGetFieldValueErrorMessage(Field field, Object obj)
- {
- return String.format("Exception reading [%s] field from object [%s].",
- field.getName(), obj);
- }
-
- private void setFieldValue(Field field, Object obj, Object value)
- {
- field.setAccessible(true);
- try
- {
- field.set(obj, value);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(buildSetFieldValueErrorMessage(field, obj, value), e);
- }
- catch (NullPointerException ex)
- {
- NullPointerException ex2 = new NullPointerException(
- buildSetFieldValueErrorMessage(field, obj, value));
- ex2.initCause(ex.getCause());
- throw ex2;
- }
- }
-
- private String buildSetFieldValueErrorMessage(Field field, Object obj, Object value)
- {
- return String.format("Exception setting [%s] field on object [%s] to value [%s]",
- field.getName(), obj, value);
- }
-
- private Object invokeMethod(Method method, Object obj, Object... args)
- {
- try
- {
- return method.invoke(obj, args);
- }
- catch (IllegalAccessException ex)
- {
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
- }
- catch (IllegalArgumentException ex)
- {
- throw new IllegalArgumentException(buildInvokeMethodErrorMessage(method, obj, args), ex.getCause());
- }
- catch (InvocationTargetException ex)
- {
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
- }
- catch (NullPointerException ex)
- {
- NullPointerException ex2 = new NullPointerException(buildInvokeMethodErrorMessage(method, obj, args));
- ex2.initCause(ex.getCause());
- throw ex2;
- }
- catch (ExceptionInInitializerError e)
- {
- throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), e);
- }
- }
-
- private String buildInvokeMethodErrorMessage(Method method, Object obj, Object... args)
- {
- StringBuilder message = new StringBuilder(String.format(
- "Exception invoking method [%s] on object [%s], using arguments [",
- method.getName(), obj));
- if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
- message.append("]");
- return message.toString();
- }
-
- private Method getSetterMethod(Class<?> clazz, String name)
- {
- Method[] methods = clazz.getMethods();
- for (Method method: methods)
- {
- String methodName = method.getName();
- if ( methodName.startsWith("set") && method.getParameterTypes().length==1 )
- {
- if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
- {
- return method;
- }
- }
- }
- throw new IllegalArgumentException("no such setter method: " + clazz.getName() + '.' + name);
- }
-
- private Method getGetterMethod(Class<?> clazz, String name)
- {
- Method[] methods = clazz.getMethods();
- for (Method method: methods)
- {
- String methodName = method.getName();
- if ( method.getParameterTypes().length==0 )
- {
- if ( methodName.startsWith("get") )
- {
- if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
- {
- return method;
- }
- }
- else if ( methodName.startsWith("is") )
- {
- if ( Introspector.decapitalize( methodName.substring(2) ).equals(name) )
- {
- return method;
- }
- }
- }
- }
- throw new IllegalArgumentException("no such getter method: " + clazz.getName() + '.' + name);
- }
+
}
\ No newline at end of file
Added: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java (rev 0)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/TypedBeanProperty.java 2010-05-31 02:50:10 UTC (rev 6361)
@@ -0,0 +1,39 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/**
+ * A convenience class for working with a typed property (either a field or
+ * method) of a JavaBean class.
+ *
+ * @author Shane Bryzak
+ */
+public class TypedBeanProperty<T> extends AbstractBeanProperty
+{
+ private Class<?> propertyClass;
+
+ public TypedBeanProperty(Class<?> cls, Class<?> propertyClass)
+ {
+ super(cls);
+
+ if (propertyClass == null)
+ {
+ throw new IllegalArgumentException("propertyClass can not be null.");
+ }
+
+ this.propertyClass = propertyClass;
+ }
+
+ @Override
+ protected boolean fieldMatches(Field f)
+ {
+ return propertyClass.equals(f.getType());
+ }
+
+ @Override
+ protected boolean methodMatches(Method m)
+ {
+ return propertyClass.equals(m.getReturnType());
+ }
+}
14 years, 6 months
Weld SVN: r6360 - extensions/trunk/src/main/java/org/jboss/weld/extensions/util.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-05-30 07:54:06 -0400 (Sun, 30 May 2010)
New Revision: 6360
Added:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java
Log:
WELDX-104
Added: extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java (rev 0)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/util/AnnotatedBeanProperty.java 2010-05-30 11:54:06 UTC (rev 6360)
@@ -0,0 +1,367 @@
+package org.jboss.weld.extensions.util;
+
+import java.beans.Introspector;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.lang.ExceptionInInitializerError;
+
+/**
+ * A convenience class for working with an annotated property (either a field or method) of
+ * a JavaBean class. By providing an isMatch() method in a concrete implementation
+ * of this class, annotations may be matched on their attribute values or other
+ * conditions.
+ *
+ * @author Shane Bryzak
+ */
+public class AnnotatedBeanProperty<T extends Annotation>
+{
+ private Field propertyField;
+ private Method propertyGetter;
+ private Method propertySetter;
+ private String name;
+ private Type propertyType;
+ private T annotation;
+
+ private boolean isFieldProperty;
+ private boolean set = false;
+
+ private Class<?> targetClass;
+ private Class<T> annotationClass;
+ private boolean scanned = false;
+
+ /**
+ * Default constructor
+ *
+ * @param cls The class to scan for the property
+ * @param annotationClass The annotation class to scan for. Specified attribute
+ * values may be scanned for by providing an implementation of the isMatch() method.
+ */
+ public AnnotatedBeanProperty(Class<?> cls, Class<T> annotationClass)
+ {
+ this.targetClass = cls;
+ this.annotationClass = annotationClass;
+ }
+
+ /**
+ * Scans the target class to locate the annotated property
+ */
+ private void scan()
+ {
+ // First check declared fields
+ for (Field f : targetClass.getDeclaredFields())
+ {
+ if (f.isAnnotationPresent(annotationClass) &&
+ isMatch(f.getAnnotation(annotationClass)))
+ {
+ setupFieldProperty(f);
+ this.annotation = f.getAnnotation(annotationClass);
+ set = true;
+ return;
+ }
+ }
+
+ // Then check public fields, in case it's inherited
+ for (Field f : targetClass.getFields())
+ {
+ if (f.isAnnotationPresent(annotationClass) &&
+ isMatch(f.getAnnotation(annotationClass)))
+ {
+ this.annotation = f.getAnnotation(annotationClass);
+ setupFieldProperty(f);
+ set = true;
+ return;
+ }
+ }
+
+ // Then check public methods (we ignore private methods)
+ for (Method m : targetClass.getMethods())
+ {
+ if (m.isAnnotationPresent(annotationClass) &&
+ isMatch(m.getAnnotation(annotationClass)))
+ {
+ this.annotation = m.getAnnotation(annotationClass);
+ String methodName = m.getName();
+
+ if ( m.getName().startsWith("get") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(3) );
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ this.name = Introspector.decapitalize( m.getName().substring(2) );
+ }
+
+ if (this.name != null)
+ {
+ this.propertyGetter = getGetterMethod(targetClass, this.name);
+ this.propertySetter = getSetterMethod(targetClass, this.name);
+ this.propertyType = this.propertyGetter.getGenericReturnType();
+ isFieldProperty = false;
+ set = true;
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid accessor method, must start with 'get' or 'is'. " +
+ "Method: " + m + " in class: " + targetClass);
+ }
+ }
+ }
+
+ scanned = true;
+ }
+
+ /**
+ * This method may be overridden by a subclass. It can be used to scan
+ * for an annotation with particular attribute values, or to allow a match
+ * based on more complex logic.
+ *
+ * @param annotation The potential match
+ * @return true if the specified annotation is a match
+ */
+ protected boolean isMatch(T annotation)
+ {
+ return true;
+ }
+
+ /**
+ * This method sets the property value for a specified bean to the specified
+ * value. The property to be set is either a field or setter method that
+ * matches the specified annotation class and returns true for the isMatch()
+ * method.
+ *
+ * @param bean The bean containing the property to set
+ * @param value The new property value
+ * @throws Exception
+ */
+ public void setValue(Object bean, Object value) throws Exception
+ {
+ if (!scanned) scan();
+
+ if (isFieldProperty)
+ {
+ setFieldValue(propertyField, bean, value);
+ }
+ else
+ {
+ invokeMethod(propertySetter, bean, value);
+ }
+ }
+
+ /**
+ * Returns the property value for the specified bean. The property to be
+ * returned is either a field or getter method that matches the specified
+ * annotation class and returns true for the isMatch() method.
+ *
+ * @param bean The bean to read the property from
+ * @return The property value
+ * @throws Exception
+ */
+ public Object getValue(Object bean) throws Exception
+ {
+ if (!scanned) scan();
+
+ if (isFieldProperty)
+ {
+ return getFieldValue(propertyField, bean);
+ }
+ else
+ {
+ return invokeMethod(propertyGetter, bean);
+ }
+ }
+
+ /**
+ * Returns the name of the property. If the property is a field, then the
+ * field name is returned. Otherwise, if the property is a method, then the
+ * name that is returned is the getter method name without the "get" or "is"
+ * prefix, and a lower case first letter.
+ *
+ * @return The name of the property
+ */
+ public String getName()
+ {
+ if (!scanned) scan();
+ return name;
+ }
+
+ /**
+ * Returns the annotation type
+ *
+ * @return The annotation type
+ */
+ public T getAnnotation()
+ {
+ if (!scanned) scan();
+ return annotation;
+ }
+
+ /**
+ * Returns the property type
+ *
+ * @return The property type
+ */
+ public Type getPropertyType()
+ {
+ if (!scanned) scan();
+ return propertyType;
+ }
+
+ /**
+ * Returns true if the property has been successfully located, otherwise
+ * returns false.
+ *
+ * @return
+ */
+ public boolean isSet()
+ {
+ if (!scanned) scan();
+ return set;
+ }
+
+ private void setupFieldProperty(Field propertyField)
+ {
+ this.propertyField = propertyField;
+ isFieldProperty = true;
+ this.name = propertyField.getName();
+ this.propertyType = propertyField.getGenericType();
+ }
+
+ private Object getFieldValue(Field field, Object obj)
+ {
+ field.setAccessible(true);
+ try
+ {
+ return field.get(obj);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(buildGetFieldValueErrorMessage(field, obj), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildGetFieldValueErrorMessage(field, obj));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ }
+
+ private String buildGetFieldValueErrorMessage(Field field, Object obj)
+ {
+ return String.format("Exception reading [%s] field from object [%s].",
+ field.getName(), obj);
+ }
+
+ private void setFieldValue(Field field, Object obj, Object value)
+ {
+ field.setAccessible(true);
+ try
+ {
+ field.set(obj, value);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(buildSetFieldValueErrorMessage(field, obj, value), e);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(
+ buildSetFieldValueErrorMessage(field, obj, value));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ }
+
+ private String buildSetFieldValueErrorMessage(Field field, Object obj, Object value)
+ {
+ return String.format("Exception setting [%s] field on object [%s] to value [%s]",
+ field.getName(), obj, value);
+ }
+
+ private Object invokeMethod(Method method, Object obj, Object... args)
+ {
+ try
+ {
+ return method.invoke(obj, args);
+ }
+ catch (IllegalAccessException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ throw new IllegalArgumentException(buildInvokeMethodErrorMessage(method, obj, args), ex.getCause());
+ }
+ catch (InvocationTargetException ex)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), ex);
+ }
+ catch (NullPointerException ex)
+ {
+ NullPointerException ex2 = new NullPointerException(buildInvokeMethodErrorMessage(method, obj, args));
+ ex2.initCause(ex.getCause());
+ throw ex2;
+ }
+ catch (ExceptionInInitializerError e)
+ {
+ throw new RuntimeException(buildInvokeMethodErrorMessage(method, obj, args), e);
+ }
+ }
+
+ private String buildInvokeMethodErrorMessage(Method method, Object obj, Object... args)
+ {
+ StringBuilder message = new StringBuilder(String.format(
+ "Exception invoking method [%s] on object [%s], using arguments [",
+ method.getName(), obj));
+ if (args != null) for (int i = 0; i < args.length; i++) message.append((i > 0 ? "," : "") + args[i]);
+ message.append("]");
+ return message.toString();
+ }
+
+ private Method getSetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( methodName.startsWith("set") && method.getParameterTypes().length==1 )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such setter method: " + clazz.getName() + '.' + name);
+ }
+
+ private Method getGetterMethod(Class<?> clazz, String name)
+ {
+ Method[] methods = clazz.getMethods();
+ for (Method method: methods)
+ {
+ String methodName = method.getName();
+ if ( method.getParameterTypes().length==0 )
+ {
+ if ( methodName.startsWith("get") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(3) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ else if ( methodName.startsWith("is") )
+ {
+ if ( Introspector.decapitalize( methodName.substring(2) ).equals(name) )
+ {
+ return method;
+ }
+ }
+ }
+ }
+ throw new IllegalArgumentException("no such getter method: " + clazz.getName() + '.' + name);
+ }
+}
\ No newline at end of file
14 years, 6 months
Weld SVN: r6359 - archetypes/trunk/jsf/jee/src/main/resources/archetype-resources.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-05-28 18:13:16 -0400 (Fri, 28 May 2010)
New Revision: 6359
Modified:
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml
Log:
Updated POM to newest spec
Modified: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml 2010-05-28 18:10:01 UTC (rev 6358)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml 2010-05-28 22:13:16 UTC (rev 6359)
@@ -50,8 +50,8 @@
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee_6.0_spec</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0.Beta4</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
14 years, 6 months
Weld SVN: r6358 - in core/trunk/impl/src/main/java/org/jboss/weld: util/collections and 1 other directory.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2010-05-28 14:10:01 -0400 (Fri, 28 May 2010)
New Revision: 6358
Added:
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySetSupplier.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySet.java
Log:
Changed a couple ArrayListMultimaps back to SetMultimaps where sets should still be used
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java 2010-05-28 12:31:09 UTC (rev 6357)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java 2010-05-28 18:10:01 UTC (rev 6358)
@@ -23,6 +23,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,12 +38,14 @@
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Proxies;
+import org.jboss.weld.util.collections.ArraySetSupplier;
import org.jboss.weld.util.collections.Arrays2;
import org.jboss.weld.util.collections.ImmutableArraySet;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
-import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
/**
* Represents functionality common for all annotated items, mainly different
@@ -126,7 +129,7 @@
private final Map<Class<? extends Annotation>, Annotation> annotationMap;
// The meta-annotation map (annotation type -> set of annotations containing
// meta-annotation) of the item
- private final ArrayListMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap;
+ private final SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap;
private final Class<T> rawType;
private final Type[] actualTypeArguments;
@@ -150,13 +153,13 @@
throw new WeldException(ANNOTATION_MAP_NULL);
}
this.annotationMap = annotationMap;
- this.metaAnnotationMap = ArrayListMultimap.<Class<? extends Annotation>, Annotation> create();
+ this.metaAnnotationMap = Multimaps.newSetMultimap(new HashMap<Class<? extends Annotation>, Collection<Annotation>>(), ArraySetSupplier.<Annotation>instance());
for (Annotation annotation : annotationMap.values())
{
addMetaAnnotations(metaAnnotationMap, annotation, annotation.annotationType().getAnnotations(), false);
addMetaAnnotations(metaAnnotationMap, annotation, classTransformer.getTypeStore().get(annotation.annotationType()), false);
}
- this.metaAnnotationMap.trimToSize();
+ ArraySetSupplier.trimSetsToSize(metaAnnotationMap);
if (declaredAnnotationMap == null)
{
@@ -183,13 +186,14 @@
throw new WeldException(ANNOTATION_MAP_NULL);
}
this.annotationMap = annotationMap;
- this.metaAnnotationMap = ArrayListMultimap.<Class<? extends Annotation>, Annotation> create();
+ this.metaAnnotationMap = Multimaps.newSetMultimap(new HashMap<Class<? extends Annotation>, Collection<Annotation>>(), ArraySetSupplier.<Annotation>instance());
for (Annotation annotation : annotationMap.values())
{
addMetaAnnotations(metaAnnotationMap, annotation, annotation.annotationType().getAnnotations(), false);
addMetaAnnotations(metaAnnotationMap, annotation, typeStore.get(annotation.annotationType()), false);
+ this.annotationMap.put(annotation.annotationType(), annotation);
}
- this.metaAnnotationMap.trimToSize();
+ ArraySetSupplier.trimSetsToSize(metaAnnotationMap);
if (declaredAnnotationMap == null)
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-05-28 12:31:09 UTC (rev 6357)
+++ core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2010-05-28 18:10:01 UTC (rev 6358)
@@ -48,12 +48,15 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Names;
+import org.jboss.weld.util.collections.ArraySetSupplier;
import org.jboss.weld.util.collections.ImmutableArraySet;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
/**
* Represents an annotated class
@@ -120,7 +123,7 @@
// The meta-annotation map (annotation type -> set of annotations containing
// meta-annotation) of the item
- private final ArrayListMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap;
+ private final SetMultimap<Class<? extends Annotation>, Annotation> declaredMetaAnnotationMap;
private final boolean discovered;
@@ -352,13 +355,14 @@
this.declaredAnnotatedMethods.trimToSize();
this.declaredMethodsByAnnotatedParameters.trimToSize();
- this.declaredMetaAnnotationMap = ArrayListMultimap.<Class<? extends Annotation>, Annotation> create();
+ this.declaredMetaAnnotationMap = Multimaps.newSetMultimap(new HashMap<Class<? extends Annotation>, Collection<Annotation>>(), ArraySetSupplier.<Annotation>instance());
for (Annotation declaredAnnotation : declaredAnnotationMap.values())
{
addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, declaredAnnotation.annotationType().getAnnotations(), true);
addMetaAnnotations(declaredMetaAnnotationMap, declaredAnnotation, classTransformer.getTypeStore().get(declaredAnnotation.annotationType()), true);
this.declaredMetaAnnotationMap.put(declaredAnnotation.annotationType(), declaredAnnotation);
}
+ ArraySetSupplier.trimSetsToSize(declaredMetaAnnotationMap);
}
@SuppressWarnings("unchecked")
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySet.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySet.java 2010-05-28 12:31:09 UTC (rev 6357)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySet.java 2010-05-28 18:10:01 UTC (rev 6358)
@@ -146,6 +146,11 @@
return elements.toArray(a);
}
+ public void trimToSize()
+ {
+ elements.trimToSize();
+ }
+
// Needed to provide set equals semantics
@Override
public boolean equals(Object obj)
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySetSupplier.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySetSupplier.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySetSupplier.java 2010-05-28 18:10:01 UTC (rev 6358)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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 org.jboss.weld.util.collections;
+
+import java.util.Set;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.SetMultimap;
+
+/**
+ * Provides new instances of {@link ArraySet} to Google collections.
+ *
+ * @author David Allen
+ *
+ */
+public class ArraySetSupplier<V> implements Supplier<Set<V>>
+{
+ private static final Supplier<?> INSTANCE = new ArraySetSupplier<Object>();
+
+ private ArraySetSupplier() {}
+
+ @SuppressWarnings("unchecked")
+ public static <V> Supplier<Set<V>> instance()
+ {
+ return (Supplier<Set<V>>) INSTANCE;
+ }
+
+ public Set<V> get()
+ {
+ return new ArraySet<V>();
+ }
+
+ /**
+ * Helper method which will trim each set in the multimap to its current size.
+ * @param <K> Key type
+ * @param <V> Value type
+ * @param multimap the set multimap using ArraySet<V> as the values
+ */
+ public static <K, V> void trimSetsToSize(SetMultimap<K, V> multimap)
+ {
+ for (K key : multimap.keySet())
+ {
+ if (multimap.get(key) instanceof ArraySet<?>)
+ {
+ ((ArraySet<?>)multimap.get(key)).trimToSize();
+ }
+ }
+ }
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ArraySetSupplier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 6 months
Weld SVN: r6357 - in doc/trunk/reference: src and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-28 08:31:09 -0400 (Fri, 28 May 2010)
New Revision: 6357
Added:
doc/trunk/reference/src/
doc/trunk/reference/src/main/
doc/trunk/reference/src/main/docbook/
doc/trunk/reference/src/main/docbook/de-DE/
doc/trunk/reference/src/main/docbook/en-US/
doc/trunk/reference/src/main/docbook/es-ES/
doc/trunk/reference/src/main/docbook/fr-FR/
doc/trunk/reference/src/main/docbook/it-IT/
doc/trunk/reference/src/main/docbook/ja-JP/
doc/trunk/reference/src/main/docbook/ko-KR/
doc/trunk/reference/src/main/docbook/pt-BR/
doc/trunk/reference/src/main/docbook/zh-CN/
doc/trunk/reference/src/main/docbook/zh-TW/
Removed:
doc/trunk/reference/de-DE/
doc/trunk/reference/en-US/
doc/trunk/reference/es-ES/
doc/trunk/reference/fr-FR/
doc/trunk/reference/it-IT/
doc/trunk/reference/ja-JP/
doc/trunk/reference/ko-KR/
doc/trunk/reference/pt-BR/
doc/trunk/reference/zh-CN/
doc/trunk/reference/zh-TW/
Modified:
doc/trunk/reference/pom.xml
Log:
use weld-parent:10, reorg docbook files
Modified: doc/trunk/reference/pom.xml
===================================================================
--- doc/trunk/reference/pom.xml 2010-05-28 12:26:30 UTC (rev 6356)
+++ doc/trunk/reference/pom.xml 2010-05-28 12:31:09 UTC (rev 6357)
@@ -19,7 +19,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>9</version>
+ <version>10</version>
</parent>
<properties>
Copied: doc/trunk/reference/src/main/docbook/de-DE (from rev 6340, doc/trunk/reference/de-DE)
Copied: doc/trunk/reference/src/main/docbook/en-US (from rev 6340, doc/trunk/reference/en-US)
Copied: doc/trunk/reference/src/main/docbook/es-ES (from rev 6340, doc/trunk/reference/es-ES)
Copied: doc/trunk/reference/src/main/docbook/fr-FR (from rev 6340, doc/trunk/reference/fr-FR)
Copied: doc/trunk/reference/src/main/docbook/it-IT (from rev 6340, doc/trunk/reference/it-IT)
Copied: doc/trunk/reference/src/main/docbook/ja-JP (from rev 6340, doc/trunk/reference/ja-JP)
Copied: doc/trunk/reference/src/main/docbook/ko-KR (from rev 6340, doc/trunk/reference/ko-KR)
Copied: doc/trunk/reference/src/main/docbook/pt-BR (from rev 6340, doc/trunk/reference/pt-BR)
Copied: doc/trunk/reference/src/main/docbook/zh-CN (from rev 6340, doc/trunk/reference/zh-CN)
Copied: doc/trunk/reference/src/main/docbook/zh-TW (from rev 6340, doc/trunk/reference/zh-TW)
14 years, 6 months
Weld SVN: r6356 - servlet/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-28 08:26:30 -0400 (Fri, 28 May 2010)
New Revision: 6356
Modified:
servlet/trunk/pom.xml
Log:
update to weld-parent:10
Modified: servlet/trunk/pom.xml
===================================================================
--- servlet/trunk/pom.xml 2010-05-28 12:24:03 UTC (rev 6355)
+++ servlet/trunk/pom.xml 2010-05-28 12:26:30 UTC (rev 6356)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>9</version>
+ <version>10</version>
</parent>
<name>Weld Servlet support build aggregator</name>
14 years, 6 months
Weld SVN: r6355 - java-se/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-28 08:24:03 -0400 (Fri, 28 May 2010)
New Revision: 6355
Modified:
java-se/trunk/pom.xml
Log:
update to weld-parent:10
Modified: java-se/trunk/pom.xml
===================================================================
--- java-se/trunk/pom.xml 2010-05-28 12:22:54 UTC (rev 6354)
+++ java-se/trunk/pom.xml 2010-05-28 12:24:03 UTC (rev 6355)
@@ -3,7 +3,7 @@
<parent>
<artifactId>weld-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>9</version>
+ <version>10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
14 years, 6 months
Weld SVN: r6354 - extensions/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-28 08:22:54 -0400 (Fri, 28 May 2010)
New Revision: 6354
Modified:
extensions/trunk/pom.xml
Log:
update to weld-parent:10
Modified: extensions/trunk/pom.xml
===================================================================
--- extensions/trunk/pom.xml 2010-05-28 12:21:50 UTC (rev 6353)
+++ extensions/trunk/pom.xml 2010-05-28 12:22:54 UTC (rev 6354)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>9</version>
+ <version>10</version>
</parent>
<name>Weld Extensions</name>
14 years, 6 months
Weld SVN: r6353 - core/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-05-28 08:21:50 -0400 (Fri, 28 May 2010)
New Revision: 6353
Removed:
core/trunk/atinject-trunk.patch
Log:
remove out of date patch
Deleted: core/trunk/atinject-trunk.patch
===================================================================
--- core/trunk/atinject-trunk.patch 2010-05-28 12:21:15 UTC (rev 6352)
+++ core/trunk/atinject-trunk.patch 2010-05-28 12:21:50 UTC (rev 6353)
@@ -1,98 +0,0 @@
-Index: .classpath
-===================================================================
---- .classpath (revision 0)
-+++ .classpath (revision 0)
-@@ -0,0 +1,11 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<classpath>
-+ <classpathentry kind="src" output="build/classes" path="src"/>
-+ <classpathentry kind="src" output="build/tck/classes" path="tck"/>
-+ <classpathentry kind="lib" path="build/dist/javax.inject.jar"/>
-+ <classpathentry kind="lib" path="build/tck/dist/javax.inject-tck.jar"/>
-+ <classpathentry kind="lib" path="lib/junit-src.jar"/>
-+ <classpathentry kind="lib" path="lib/junit.jar" sourcepath="/Users/pmuir/.m2/repository/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
-+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-+ <classpathentry kind="output" path="build/classes"/>
-+</classpath>
-Index: .project
-===================================================================
---- .project (revision 0)
-+++ .project (revision 0)
-@@ -0,0 +1,17 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<projectDescription>
-+ <name>atinject</name>
-+ <comment></comment>
-+ <projects>
-+ </projects>
-+ <buildSpec>
-+ <buildCommand>
-+ <name>org.eclipse.jdt.core.javabuilder</name>
-+ <arguments>
-+ </arguments>
-+ </buildCommand>
-+ </buildSpec>
-+ <natures>
-+ <nature>org.eclipse.jdt.core.javanature</nature>
-+ </natures>
-+</projectDescription>
-Index: build.sh
-===================================================================
---- build.sh (revision 46)
-+++ build.sh (working copy)
-@@ -9,8 +9,8 @@
- mkdir -p build/tck/dist
-
- # Compile classes.
--javac -g -d build/classes `find src -name *.java`
--javac -g -classpath build/classes:lib/junit.jar -d build/tck/classes \
-+javac -source 1.5 -target 1.5 -g -d build/classes `find src -name *.java`
-+javac -source 1.5 -target 1.5 -g -classpath build/classes:lib/junit.jar -d build/tck/classes \
- `find tck -name *.java`
-
- FOOTER="<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>\
-Index: tck-pom.xml
-===================================================================
---- tck-pom.xml (revision 0)
-+++ tck-pom.xml (revision 0)
-@@ -0,0 +1,21 @@
-+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-+
-+ <modelVersion>4.0.0</modelVersion>
-+
-+ <groupId>org.atinject</groupId>
-+ <artifactId>inject-tck</artifactId>
-+ <version>1.0.0-PFD-3</version>
-+
-+ <packaging>jar</packaging>
-+
-+ <name>JSR-330 TCK: Dependency Injection for Java</name>
-+
-+ <url>http://code.google.com/p/atinject/</url>
-+
-+ <build>
-+
-+ </build>
-+
-+</project>
-+
-Index: pom.xml
-===================================================================
---- pom.xml (revision 46)
-+++ pom.xml (working copy)
-@@ -5,7 +5,7 @@
-
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
-- <version>1.0-SNAPSHOT</version>
-+ <version>1.0-PFD-1</version>
-
- <name>Javax Inject from the JSR-330 Expert Group</name>
-
-Index: tck-readme.txt
-===================================================================
---- tck-readme.txt (revision 0)
-+++ tck-readme.txt (revision 0)
-@@ -0,0 +1 @@
-+mvn deploy:deploy-file -DpomFile=tck-pom.xml -Dfile=build/tck/dist/javax.inject-tck.jar -Durl=file:///Users/pmuir/development/repository && mvn deploy:deploy-file -DpomFile=tck-pom.xml -Dfile=build/tck/dist/javax.inject-tck-src.zip -Durl=file:///Users/pmuir/development/repository -Dclassifier=sources && mvn deploy:deploy-file -DpomFile=tck-pom.xml -Dfile=build/tck/dist/javax.inject-tck-javadoc.zip -Durl=file:///Users/pmuir/development/repository -Dclassifier=javadoc
14 years, 6 months