[jboss-cvs] microkernel/src/main/org/jboss/kernel/plugins/deployment/xml ...
Kabir Khan
kkhan at jboss.com
Wed Jul 19 14:19:57 EDT 2006
User: kkhan
Date: 06/07/19 14:19:57
Modified: src/main/org/jboss/kernel/plugins/deployment/xml
BeanSchemaBinding20.java AnnotationHandler.java
BeanSchemaBindingHelper.java
Removed: src/main/org/jboss/kernel/plugins/deployment/xml
AttributeHandler.java
AnnotationAttributesInterceptor.java
Log:
[JBMICROCONT-98] Make the annotation metadata more free format
Revision Changes Path
1.35 +1 -8 microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/BeanSchemaBinding20.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BeanSchemaBinding20.java
===================================================================
RCS file: /cvsroot/jboss/microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/BeanSchemaBinding20.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- BeanSchemaBinding20.java 31 Mar 2006 11:34:38 -0000 1.34
+++ BeanSchemaBinding20.java 19 Jul 2006 18:19:57 -0000 1.35
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
* @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.34 $
+ * @version $Revision: 1.35 $
*/
public class BeanSchemaBinding20
{
@@ -59,9 +59,6 @@
/** The annotation element name */
public static final QName annotationQName = new QName(BEAN_DEPLOYER_NS, "annotation");
- /** The annotation attribute binding */
- public static final QName annotationAttributeTypeQName = new QName(BEAN_DEPLOYER_NS, "annotationAttributeType");
-
/** The attribute element name */
public static final QName attributeQName = new QName(BEAN_DEPLOYER_NS, "attribute");
@@ -273,10 +270,6 @@
TypeBinding annotationType = schemaBinding.getType(annotationTypeQName);
BeanSchemaBindingHelper.initAnnotationHandlers(annotationType);
- // annotation attribute binding
- TypeBinding attributeType = schemaBinding.getType(annotationAttributeTypeQName);
- BeanSchemaBindingHelper.initAttributeHandlers(attributeType);
-
// install binding
TypeBinding installType = schemaBinding.getType(installTypeQName);
BeanSchemaBindingHelper.initInstallHandlers(installType);
1.2 +8 -14 microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/AnnotationHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AnnotationHandler.java
===================================================================
RCS file: /cvsroot/jboss/microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/AnnotationHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- AnnotationHandler.java 30 Mar 2006 17:16:15 -0000 1.1
+++ AnnotationHandler.java 19 Jul 2006 18:19:57 -0000 1.2
@@ -21,19 +21,17 @@
*/
package org.jboss.kernel.plugins.deployment.xml;
-import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData;
import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
-import org.xml.sax.Attributes;
/**
* AnnotationHandler.
*
* @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class AnnotationHandler extends DefaultElementHandler
{
@@ -45,22 +43,18 @@
return new AbstractAnnotationMetaData();
}
- public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
+ public Object endElement(Object o, QName qName, ElementBinding element)
{
AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) o;
- for (int i = 0; i < attrs.getLength(); ++i)
+ if (annotation.getAnnotation() == null || annotation.getAnnotation().length() == 0)
{
- String localName = attrs.getLocalName(i);
- if ("name".equals(localName))
- annotation.setName(attrs.getValue(i));
+ throw new IllegalArgumentException("Empty <annotation/> content");
}
+ if (!annotation.getAnnotation().startsWith("@"))
+ {
+ throw new IllegalArgumentException("<annotation/> content must be a fully qualified annotation type name prefixed with '@'");
}
- public Object endElement(Object o, QName qName, ElementBinding element)
- {
- AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) o;
- if (annotation.getName() == null)
- throw new IllegalArgumentException("Annotation should have a name.");
return annotation;
}
}
1.19 +1 -14 microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/BeanSchemaBindingHelper.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BeanSchemaBindingHelper.java
===================================================================
RCS file: /cvsroot/jboss/microkernel/src/main/org/jboss/kernel/plugins/deployment/xml/BeanSchemaBindingHelper.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- BeanSchemaBindingHelper.java 31 Mar 2006 11:34:39 -0000 1.18
+++ BeanSchemaBindingHelper.java 19 Jul 2006 18:19:57 -0000 1.19
@@ -30,7 +30,7 @@
* BeanSchemaBindingHelper.
*
* @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.18 $
+ * @version $Revision: 1.19 $
*/
public class BeanSchemaBindingHelper
{
@@ -259,19 +259,6 @@
public static void initAnnotationHandlers(TypeBinding annotationType)
{
annotationType.setHandler(AnnotationHandler.HANDLER);
-
- // annotation has attributes
- annotationType.pushInterceptor(BeanSchemaBinding20.attributeQName, AnnotationAttributesInterceptor.INTERCEPTOR);
- }
-
- /**
- * Initialize the handlers for the attribute type
- *
- * @param attributeType the attribute type
- */
- public static void initAttributeHandlers(TypeBinding attributeType)
- {
- attributeType.setHandler(AttributeHandler.HANDLER);
}
/**
More information about the jboss-cvs-commits
mailing list