[seam-commits] Seam SVN: r13500 - in modules/xml/trunk/impl: src/main/java/org/jboss/seam/xml/bootstrap and 3 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sun Jul 25 05:12:55 EDT 2010
Author: swd847
Date: 2010-07-25 05:12:55 -0400 (Sun, 25 Jul 2010)
New Revision: 13500
Modified:
modules/xml/trunk/impl/pom.xml
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
Log:
update to latest weld-extensions
Modified: modules/xml/trunk/impl/pom.xml
===================================================================
--- modules/xml/trunk/impl/pom.xml 2010-07-25 08:15:58 UTC (rev 13499)
+++ modules/xml/trunk/impl/pom.xml 2010-07-25 09:12:55 UTC (rev 13500)
@@ -48,6 +48,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-07-25 08:15:58 UTC (rev 13499)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-07-25 09:12:55 UTC (rev 13500)
@@ -197,7 +197,7 @@
bb.getBuilder().addToClass(new AnnotationLiteral<XmlConfiguredBean>()
{
});
- AnnotatedType<?> tp = bb.getBuilder().create();
+ AnnotatedType<?> tp = fixExactSupport(bb.getBuilder()).create();
log.info("Adding XML Defined Bean: " + tp.getJavaClass().getName());
event.addAnnotatedType(tp);
@@ -308,10 +308,10 @@
{
AnnotatedType<?> type = c.getBuilder().create();
- AnnotatedTypeBuilder<?> gb = AnnotatedTypeBuilder.newInstance(type);
+ AnnotatedTypeBuilder<?> gb = new AnnotatedTypeBuilder().setJavaClass(type.getJavaClass());
if (c.getBeanType() == BeanResultType.MODIFIES)
{
- gb.readAnnotationsFromUnderlyingType();
+ gb.readFromType((Class) type.getJavaClass());
// we don't want to keep the veto annotation on the class
gb.removeFromClass(Veto.class);
}
@@ -406,7 +406,7 @@
}
}
- ret.add(gb.create());
+ ret.add(fixExactSupport(gb).create());
}
return ret;
}
@@ -431,14 +431,13 @@
* temprary hack to support @Exact in seam-xml, remove once WELD-485 is
* resolved
*/
- <X> void processAnnotatedType(@Observes final ProcessAnnotatedType<X> pat, BeanManager beanManager)
+ public <X> AnnotatedTypeBuilder<X> fixExactSupport(AnnotatedTypeBuilder<X> old)
{
-
- AnnotatedTypeBuilder<X> builder = AnnotatedTypeBuilder.newInstance(pat.getAnnotatedType()).mergeAnnotations(pat.getAnnotatedType(), true);
-
+ AnnotatedType<X> pat = old.create();
+ AnnotatedTypeBuilder<X> builder = new AnnotatedTypeBuilder<X>().readFromType(pat);
// support for @Exact
// fields
- for (AnnotatedField<? super X> f : pat.getAnnotatedType().getFields())
+ for (AnnotatedField<? super X> f : pat.getFields())
{
if (f.isAnnotationPresent(Exact.class))
{
@@ -447,31 +446,30 @@
}
}
// method parameters
- for (AnnotatedMethod<? super X> m : pat.getAnnotatedType().getMethods())
+ for (AnnotatedMethod<? super X> m : pat.getMethods())
{
for (AnnotatedParameter<? super X> p : m.getParameters())
{
if (p.isAnnotationPresent(Exact.class))
{
Class<?> type = p.getAnnotation(Exact.class).value();
- builder.overrideMethodParameterType(m.getJavaMember(), type, p.getPosition());
+ builder.overrideMethodParameterType(m.getJavaMember(), p.getPosition(), type);
}
}
}
// constructor parameters
- for (AnnotatedConstructor<X> c : pat.getAnnotatedType().getConstructors())
+ for (AnnotatedConstructor<X> c : pat.getConstructors())
{
for (AnnotatedParameter<? super X> p : c.getParameters())
{
if (p.isAnnotationPresent(Exact.class))
{
Class<?> type = p.getAnnotation(Exact.class).value();
- builder.overrideConstructorParameterType(c.getJavaMember(), type, p.getPosition());
+ builder.overrideConstructorParameterType(c.getJavaMember(), p.getPosition(), type);
}
}
}
- pat.setAnnotatedType(builder.create());
-
+ return builder;
}
public static class DefaultLiteral extends AnnotationLiteral<Default> implements Default
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-07-25 08:15:58 UTC (rev 13499)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-07-25 09:12:55 UTC (rev 13500)
@@ -40,10 +40,10 @@
public BeanResult(Class<X> type, boolean readAnnotations, BeanResultType beanType, List<FieldValueObject> fieldValues, List<BeanResult<?>> inlineBeans)
{
this.type = type;
- builder = AnnotatedTypeBuilder.newInstance(type);
+ builder = new AnnotatedTypeBuilder().setJavaClass(type);
if (readAnnotations)
{
- builder.readAnnotationsFromUnderlyingType();
+ builder.readFromType(type);
// we don't want to keep the veto annotation on the class
builder.removeFromClass(Veto.class);
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-25 08:15:58 UTC (rev 13499)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-25 09:12:55 UTC (rev 13500)
@@ -81,7 +81,7 @@
String methodName = "set" + Character.toUpperCase(e.getKey().charAt(0)) + e.getKey().substring(1);
if (Reflections.methodExists(getJavaClass(), methodName))
{
- Set<Method> methods = Reflections.getMethods(getJavaClass());
+ Set<Method> methods = Reflections.getAllMethods(getJavaClass());
for (Method m : methods)
{
if (m.getName().equals(methodName) && m.getParameterTypes().length == 1)
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-07-25 08:15:58 UTC (rev 13499)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-07-25 09:12:55 UTC (rev 13500)
@@ -141,7 +141,7 @@
String methodName = "set" + Character.toUpperCase(name.charAt(0)) + name.substring(1);
if (Reflections.methodExists(p, methodName))
{
- Set<Method> methods = Reflections.getMethods(p);
+ Set<Method> methods = Reflections.getAllMethods(p);
for (Method m : methods)
{
if (m.getName().equals(methodName) && m.getParameterTypes().length == 1)
More information about the seam-commits
mailing list