Seam SVN: r12125 - in modules/xml/trunk: core/src/main/java/org/jboss/seam/xml/model and 11 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-08 18:27:43 -0500 (Mon, 08 Mar 2010)
New Revision: 12125
Modified:
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/ClassPathXmlDocumentProvider.java
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/core/src/test/resources/META-INF/seam-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/primitive-method-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/stereotype/stereotype-beans.xml
modules/xml/trunk/docs/en-US/xml-general.xml
modules/xml/trunk/examples/princess-rescue/src/main/resources/META-INF/seam-beans.xml
Log:
changed root element in seam-xml from Beans to beans to bring it into line with the current spec
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/ClassPathXmlDocumentProvider.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/ClassPathXmlDocumentProvider.java 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/ClassPathXmlDocumentProvider.java 2010-03-08 23:27:43 UTC (rev 12125)
@@ -5,6 +5,7 @@
package org.jboss.seam.xml.bootstrap;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -30,6 +31,8 @@
final String[] resources;
+ InputStream stream;
+
public ClassPathXmlDocumentProvider()
{
resources = DEFAULT_RESOURCES;
@@ -83,12 +86,33 @@
public void close()
{
- // noop
+ if (stream != null)
+ {
+ try
+ {
+ stream.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
}
public XmlDocument getNextDocument()
{
-
+ if (stream != null)
+ {
+ try
+ {
+ stream.close();
+ stream = null;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
if (!iterator.hasNext())
{
return null;
@@ -103,7 +127,8 @@
{
try
{
- return new InputSource(url.openStream());
+ stream = url.openStream();
+ return new InputSource(stream);
}
catch (IOException e)
{
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-08 23:27:43 UTC (rev 12125)
@@ -46,6 +46,8 @@
static final String ROOT_NAMESPACE = "urn:seam:core";
+ static final String BEANS_ROOT_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
+
Map<String, NamespaceElementResolver> resolvers;
public XmlResult build(SaxNode root)
@@ -55,13 +57,13 @@
XmlResult ret = new XmlResult();
- if (!root.getName().equals("Beans"))
+ if (!root.getName().equals("beans"))
{
- throw new XmlConfigurationException("Wrong root element for XML config file, expected:<Beans> found:" + root.getName(), root.getDocument(), root.getLineNo());
+ throw new XmlConfigurationException("Wrong root element for XML config file, expected:<beans> found:" + root.getName(), root.getDocument(), root.getLineNo());
}
- if (!ROOT_NAMESPACE.equals(root.getNamespaceUri()))
+ if (!(ROOT_NAMESPACE.equals(root.getNamespaceUri()) || BEANS_ROOT_NAMESPACE.equals(root.getNamespaceUri())))
{
- throw new XmlConfigurationException("Wrong root namespace for XML config file, expected:" + ROOT_NAMESPACE + " found:" + root.getNamespaceUri(), root.getDocument(), root.getLineNo());
+ throw new XmlConfigurationException("Wrong root namespace for XML config file, expected:" + ROOT_NAMESPACE + " or " + BEANS_ROOT_NAMESPACE +" found:" + root.getNamespaceUri(), root.getDocument(), root.getLineNo());
}
resolvers.put(ROOT_NAMESPACE, new RootNamespaceElementResolver());
@@ -74,6 +76,10 @@
// nodes with a null namespace are whitespace nodes etc
if (node.getNamespaceUri() != null)
{
+ if(node.getNamespaceUri().equals(BEANS_ROOT_NAMESPACE))
+ {
+ continue;
+ }
XmlItem rb = resolveNode(node, null);
// validateXmlItem(rb);
addNodeToResult(ret, rb);
Modified: modules/xml/trunk/core/src/test/resources/META-INF/seam-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/META-INF/seam-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/META-INF/seam-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.interceptor">
<test:InterceptorBinding>
@@ -16,4 +16,4 @@
</test:myMethod>
</test:InterceptorBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.constructor">
<test:ValueProvider>
@@ -14,4 +14,4 @@
<parameters><int/></parameters>
</test:ConstructedBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:ArrayFieldValue>
<override/>
@@ -17,4 +17,4 @@
</test:sarray>
</test:ArrayFieldValue>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:CollectionFieldValue>
@@ -18,4 +18,4 @@
</test:sset>
</test:CollectionFieldValue>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:MapFieldValue>
<override/>
@@ -14,4 +14,4 @@
</test:MapFieldValue>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:FieldValueBean>
@@ -16,4 +16,4 @@
</test:FieldValueBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.injection">
@@ -24,4 +24,4 @@
</test:value>
</test:RecieverBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.injection">
<test:OtherQualifier>
@@ -26,4 +26,4 @@
</test:bean2>
</test:QualifierTestBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.interceptor">
<test:InterceptedBean>
@@ -9,4 +9,4 @@
</test:method>
</test:InterceptedBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core" xmlns:test="urn:java:org.jboss.seam.xml.test.method">
+<beans xmlns="urn:seam:core" xmlns:test="urn:java:org.jboss.seam.xml.test.method">
@@ -57,4 +57,4 @@
<test:MethodValueBean>
<test:Qualifier2 />
</test:MethodValueBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/primitive-method-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/primitive-method-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/method/primitive-method-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.method">
@@ -40,4 +40,4 @@
</test:value2>
</test:PrimitiveValueProducer>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.producer">
@@ -49,7 +49,5 @@
</test:meth2>
</test:Reciever>
-
-
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.simple">
@@ -33,4 +33,4 @@
<test:ExtendedQualifier2/>
</test:ExtendedBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/stereotype/stereotype-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/stereotype/stereotype-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/stereotype/stereotype-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.stereotype"
xmlns:int="urn:java:org.jboss.seam.xml.test.interceptor">
@@ -12,4 +12,4 @@
<test:Stereotype1/>
</int:InterceptedBean>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/docs/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -26,7 +26,7 @@
<programlisting>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.injection">
<test:ProducerQualifier>
@@ -48,7 +48,7 @@
</test:value>
</test:RecieverBean>
-</Beans>
+</beans>
]]>
</programlisting>
<para>From the top:</para>
@@ -235,7 +235,7 @@
<programlisting>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:test="urn:java:org.jboss.seam.xml.test.method">
<test:MethodBean>
<test:method>
@@ -261,7 +261,7 @@
</parameters>
</test:method>
</test:MethodBean>
-</Beans>
+</beans>
public class MethodBean
{
Modified: modules/xml/trunk/examples/princess-rescue/src/main/resources/META-INF/seam-beans.xml
===================================================================
--- modules/xml/trunk/examples/princess-rescue/src/main/resources/META-INF/seam-beans.xml 2010-03-08 17:42:12 UTC (rev 12124)
+++ modules/xml/trunk/examples/princess-rescue/src/main/resources/META-INF/seam-beans.xml 2010-03-08 23:27:43 UTC (rev 12125)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Beans xmlns="urn:seam:core"
+<beans xmlns="urn:seam:core"
xmlns:p="org.jboss.seam.xml.examples.princess">
<!-- Makes the Room annotation a qualifier -->
<p:Room>
@@ -184,4 +184,4 @@
<p:south><Inject/><p:Room>emptyRoom9</p:Room></p:south>
</p:GameRoom>
-</Beans>
\ No newline at end of file
+</beans>
\ No newline at end of file