aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alien11...@apache.org
Subject svn commit: r1758300 - in /aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin: ./ javax/ pax/ spring/
Date Mon, 29 Aug 2016 21:04:36 GMT
Author: alien11689
Date: Mon Aug 29 21:04:36 2016
New Revision: 1758300

URL: http://svn.apache.org/viewvc?rev=1758300&view=rev
Log:
[ARIES-1602] Fis namespaces generation

Modified:
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceContextHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceUnitHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceProviderHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
Mon Aug 29 21:04:36 2016
@@ -66,6 +66,7 @@ public class Generator implements Proper
 
             for (XmlWriter bw : context.getBlueprintWriters().values()) {
                 bw.write(writer);
+                writer.writeCharacters("\n");
             }
 
             writer.writeEndElement();
@@ -108,7 +109,9 @@ public class Generator implements Proper
         writer.writeCharacters("\n");
 
         for (XmlWriter xmlWriter : bean.beanContentWriters.values()) {
+            writer.writeCharacters("    ");
             xmlWriter.write(writer);
+            writer.writeCharacters("\n");
         }
     }
 

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
Mon Aug 29 21:04:36 2016
@@ -57,10 +57,10 @@ public class JavaxTransactionFactory imp
                 beanEnricher.addBeanContentWriter("javax.transactional.method/" + clazz.getName()
+ "/" + name + "/" + transactionTypeName, new XmlWriter() {
                     @Override
                     public void write(XMLStreamWriter writer) throws XMLStreamException {
-                        writer.writeEmptyElement("tx", "transaction", NS_TX);
+                        writer.writeEmptyElement("transaction");
+                        writer.writeDefaultNamespace(NS_TX);
                         writer.writeAttribute("method", name);
                         writer.writeAttribute("value", transactionTypeName);
-                        writer.writeCharacters("\n");
                     }
                 });
             }
@@ -74,7 +74,8 @@ public class JavaxTransactionFactory imp
         contextEnricher.addBlueprintContentWriter("transaction/ennable-annotation", new XmlWriter()
{
             @Override
             public void write(XMLStreamWriter writer) throws XMLStreamException {
-                writer.writeEmptyElement(NS_TX, "enable-annotations");
+                writer.writeEmptyElement("enable-annotations");
+                writer.writeDefaultNamespace(NS_TX);
             }
         });
     }
@@ -88,10 +89,10 @@ public class JavaxTransactionFactory imp
             beanEnricher.addBeanContentWriter("javax.transactional.method/" + annotatedElement
+ "/*/" + transactionTypeName, new XmlWriter() {
                 @Override
                 public void write(XMLStreamWriter writer) throws XMLStreamException {
-                    writer.writeEmptyElement("tx", "transaction", NS_TX);
+                    writer.writeEmptyElement("transaction");
+                    writer.writeDefaultNamespace(NS_TX);
                     writer.writeAttribute("method", "*");
                     writer.writeAttribute("value", transactionTypeName);
-                    writer.writeCharacters("\n");
                 }
             });
         }
@@ -104,7 +105,8 @@ public class JavaxTransactionFactory imp
         contextEnricher.addBlueprintContentWriter("transaction/ennable-annotation", new XmlWriter()
{
             @Override
             public void write(XMLStreamWriter writer) throws XMLStreamException {
-                writer.writeEmptyElement("tx", "enable", NS_TX2);
+                writer.writeEmptyElement("enable");
+                writer.writeDefaultNamespace(NS_TX);
             }
         });
     }

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceContextHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceContextHandler.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceContextHandler.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceContextHandler.java
Mon Aug 29 21:04:36 2016
@@ -47,7 +47,8 @@ public class PersistenceContextHandler i
                 beanEnricher.addBeanContentWriter("javax.persistence.field.context/" + name,
new XmlWriter() {
                     @Override
                     public void write(XMLStreamWriter writer) throws XMLStreamException {
-                        writer.writeEmptyElement("jpa", "context", NS_JPA);
+                        writer.writeEmptyElement("context");
+                        writer.writeDefaultNamespace(NS_JPA);
                         writer.writeAttribute("unitname", persistenceContext.unitName());
                         writer.writeAttribute("property", name);
                     }
@@ -58,7 +59,8 @@ public class PersistenceContextHandler i
             contextEnricher.addBlueprintContentWriter("javax.persistence.enableJpa2", new
XmlWriter() {
                 @Override
                 public void write(XMLStreamWriter writer) throws XMLStreamException {
-                    writer.writeEmptyElement("jpa", "enable", NS_JPA2);
+                    writer.writeEmptyElement("enable");
+                    writer.writeDefaultNamespace(NS_JPA2);
                 }
             });
         }

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceUnitHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceUnitHandler.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceUnitHandler.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/PersistenceUnitHandler.java
Mon Aug 29 21:04:36 2016
@@ -47,7 +47,8 @@ public class PersistenceUnitHandler impl
                 beanEnricher.addBeanContentWriter("javax.persistence.field.unit/" + name,
new XmlWriter() {
                     @Override
                     public void write(XMLStreamWriter writer) throws XMLStreamException {
-                        writer.writeEmptyElement("jpa", "unit", NS_JPA);
+                        writer.writeEmptyElement("unit");
+                        writer.writeDefaultNamespace(NS_JPA);
                         writer.writeAttribute("unitname", persistenceUnit.unitName());
                         writer.writeAttribute("property", name);
                     }
@@ -58,7 +59,8 @@ public class PersistenceUnitHandler impl
             contextEnricher.addBlueprintContentWriter("javax.persistence.enableJpa2", new
XmlWriter() {
                 @Override
                 public void write(XMLStreamWriter writer) throws XMLStreamException {
-                    writer.writeEmptyElement("jpa", "enable", NS_JPA2);
+                    writer.writeEmptyElement("enable");
+                    writer.writeDefaultNamespace(NS_JPA2);
                 }
             });
         }

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
Mon Aug 29 21:04:36 2016
@@ -54,7 +54,6 @@ public class OsgiServiceHandler implemen
                 if (serviceFilter.compName != null && !"".equals(serviceFilter.compName))
{
                     writer.writeAttribute("component-name", serviceFilter.compName);
                 }
-                writer.writeCharacters("\n");
             }
         });
         return id;
@@ -78,7 +77,6 @@ public class OsgiServiceHandler implemen
                 if (serviceFilter.compName != null && !"".equals(serviceFilter.compName))
{
                     writer.writeAttribute("component-name", serviceFilter.compName);
                 }
-                writer.writeCharacters("\n");
             }
         });
         return id;

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceProviderHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceProviderHandler.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceProviderHandler.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceProviderHandler.java
Mon Aug 29 21:04:36 2016
@@ -20,11 +20,11 @@ package org.apache.aries.blueprint.plugi
 
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+import org.apache.aries.blueprint.plugin.spi.BeanAnnotationHandler;
 import org.apache.aries.blueprint.plugin.spi.BeanEnricher;
-import org.apache.aries.blueprint.plugin.spi.XmlWriter;
 import org.apache.aries.blueprint.plugin.spi.ContextEnricher;
-import org.apache.aries.blueprint.plugin.spi.BeanAnnotationHandler;
 import org.apache.aries.blueprint.plugin.spi.CustomFactoryMethodAnnotationHandler;
+import org.apache.aries.blueprint.plugin.spi.XmlWriter;
 import org.ops4j.pax.cdi.api.OsgiServiceProvider;
 import org.ops4j.pax.cdi.api.Properties;
 import org.ops4j.pax.cdi.api.Property;
@@ -88,15 +88,12 @@ public class OsgiServiceProviderHandler
             writeInterfacesElement(writer, interfaceNames);
         }
 
-        writer.writeCharacters("\n");
-
         if (!propertiesAsMap.isEmpty()) {
             writeProperties(writer, propertiesAsMap);
         }
 
         if (!writeEmptyElement) {
             writer.writeEndElement();
-            writer.writeCharacters("\n");
         }
     }
 
@@ -132,6 +129,7 @@ public class OsgiServiceProviderHandler
         }
         writer.writeCharacters("    ");
         writer.writeEndElement();
+        writer.writeCharacters("\n");
     }
 
     private void writeProperties(XMLStreamWriter writer, Map<String, String> properties)
throws XMLStreamException {

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java?rev=1758300&r1=1758299&r2=1758300&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java
Mon Aug 29 21:04:36 2016
@@ -61,10 +61,10 @@ public class SpringTransactionalFactory
                 beanEnricher.addBeanContentWriter("javax.transactional.method/" + clazz.getName()
+ "/" + name + "/" + transactionTypeName, new XmlWriter() {
                     @Override
                     public void write(XMLStreamWriter writer) throws XMLStreamException {
-                        writer.writeEmptyElement("tx", "transaction", NS_TX);
+                        writer.writeEmptyElement("transaction");
+                        writer.writeDefaultNamespace(NS_TX);
                         writer.writeAttribute("method", name);
                         writer.writeAttribute("value", transactionTypeName);
-                        writer.writeCharacters("\n");
                     }
                 });
             }
@@ -78,7 +78,8 @@ public class SpringTransactionalFactory
         contextEnricher.addBlueprintContentWriter("transaction/ennable-annotation", new XmlWriter()
{
             @Override
             public void write(XMLStreamWriter writer) throws XMLStreamException {
-                writer.writeEmptyElement("tx", "enable-annotations", NS_TX);
+                writer.writeEmptyElement("enable-annotations");
+                writer.writeDefaultNamespace(NS_TX);
             }
         });
     }
@@ -92,10 +93,10 @@ public class SpringTransactionalFactory
             beanEnricher.addBeanContentWriter("javax.transactional.method/" + annotatedElement
+ "/*/" + transactionTypeName, new XmlWriter() {
                 @Override
                 public void write(XMLStreamWriter writer) throws XMLStreamException {
-                    writer.writeEmptyElement("tx", "transaction", NS_TX);
+                    writer.writeEmptyElement("transaction");
+                    writer.writeDefaultNamespace(NS_TX);
                     writer.writeAttribute("method", "*");
                     writer.writeAttribute("value", transactionTypeName);
-                    writer.writeCharacters("\n");
                 }
             });
         }
@@ -108,7 +109,8 @@ public class SpringTransactionalFactory
         contextEnricher.addBlueprintContentWriter("transaction/ennable-annotation", new XmlWriter()
{
             @Override
             public void write(XMLStreamWriter writer) throws XMLStreamException {
-                writer.writeEmptyElement("tx", "enable", NS_TX2);
+                writer.writeEmptyElement("enable");
+                writer.writeDefaultNamespace(NS_TX2);
             }
         });
     }



Mime
View raw message