You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2019/07/22 09:50:49 UTC

[sling-org-apache-sling-contentparser-xml] 05/06: SLING-8570 - Extract a generic Content Parser API from org.apache.sling.jcr.contentparser with pluggable implementations

This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git

commit 0592e54835960528ceaad1c8bac219905092f76e
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Mon Jul 22 09:39:40 2019 +0200

    SLING-8570 - Extract a generic Content Parser API from org.apache.sling.jcr.contentparser with pluggable implementations
    
    * completely decoupled the API from implementations - the ContentParser API
    doesn't suggest any content types any more
    * removed JSON specific parser options from the ParserOptions class
    * made the ParserOptions class extendable
    * switched exported API packages to version 2.0.0, to eliminate all possible
    confusion with the older org.apache.sling.jcr.contentparser API
---
 README.md                                                           | 2 +-
 .../xml/internal/{XmlContentParser.java => XMLContentParser.java}   | 6 +++---
 .../{XmlContentParserTest.java => XMLContentParserTest.java}        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index e320a8c..fa0f697 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,6 @@ To obtain a reference to the XML content parser just filter on the `ContentParse
 property:
 
 ```java
-    @Reference(target = "(" + ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=" + ContentParser.XML_CONTENT_TYPE + ")")
+    @Reference(target = "(" + ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=xml)")
     private ContentParser xmlParser;
 ``` 
diff --git a/src/main/java/org/apache/sling/contentparser/xml/internal/XmlContentParser.java b/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
similarity index 98%
rename from src/main/java/org/apache/sling/contentparser/xml/internal/XmlContentParser.java
rename to src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
index 5c18539..f99b4e6 100644
--- a/src/main/java/org/apache/sling/contentparser/xml/internal/XmlContentParser.java
+++ b/src/main/java/org/apache/sling/contentparser/xml/internal/XMLContentParser.java
@@ -49,15 +49,15 @@ import org.xml.sax.SAXException;
  */
 @Component(
         property = {
-                ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=" + ContentParser.XML_CONTENT_TYPE
+                ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=xml"
         }
 )
-public final class XmlContentParser implements ContentParser {
+public final class XMLContentParser implements ContentParser {
 
     private static final String JCR_PRIMARY_TYPE = "jcr:primaryType";
     private final DocumentBuilderFactory documentBuilderFactory;
 
-    public XmlContentParser() {
+    public XMLContentParser() {
         documentBuilderFactory = DocumentBuilderFactory.newInstance();
     }
 
diff --git a/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java b/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
similarity index 98%
rename from src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
rename to src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
index 5da18c3..a533b03 100644
--- a/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
+++ b/src/test/java/org/apache/sling/contentparser/xml/internal/XMLContentParserTest.java
@@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
-public class XmlContentParserTest {
+public class XMLContentParserTest {
 
     private File file;
     private ContentParser underTest;
@@ -48,7 +48,7 @@ public class XmlContentParserTest {
     @Before
     public void setUp() {
         file = new File("src/test/resources/content-test/content.xml");
-        underTest = new XmlContentParser();
+        underTest = new XMLContentParser();
     }
 
     @Test