jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] jena git commit: Reformat
Date Wed, 27 Jul 2016 10:36:18 GMT
Reformat

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/b84deb6b
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/b84deb6b
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/b84deb6b

Branch: refs/heads/master
Commit: b84deb6b7f28f0e6de5c7565255595a58dda9773
Parents: f6c2063
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Jul 26 09:16:12 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Jul 26 09:16:12 2016 +0100

----------------------------------------------------------------------
 .../org/apache/jena/riot/lang/LangRDFXML.java   | 102 ++++++++-----------
 1 file changed, 44 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/b84deb6b/jena-arq/src/main/java/org/apache/jena/riot/lang/LangRDFXML.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/LangRDFXML.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/LangRDFXML.java
index 24b8bca..ad70dd5 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/lang/LangRDFXML.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/LangRDFXML.java
@@ -70,24 +70,19 @@ public class LangRDFXML implements LangRIOT
     public void setProfile(ParserProfile profile)
     { this.profile = profile ; }
 
-    public static LangRDFXML create(InputStream in, String xmlBase, String filename, ErrorHandler
errorHandler, StreamRDF sink)
-    {
+    public static LangRDFXML create(InputStream in, String xmlBase, String filename, ErrorHandler
errorHandler, StreamRDF sink) {
         return new LangRDFXML(in, xmlBase, filename, errorHandler, sink) ;
     }
-    
-    public static LangRDFXML create(Reader reader, String xmlBase, String filename, ErrorHandler
errorHandler, StreamRDF sink)
-    {
+
+    public static LangRDFXML create(Reader reader, String xmlBase, String filename, ErrorHandler
errorHandler, StreamRDF sink) {
         return new LangRDFXML(reader, xmlBase, filename, errorHandler, sink) ;
-    }
-    
+    }    
 
-    public static LangRDFXML create(String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink)
-    {
+    public static LangRDFXML create(String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink) {
         return create(IO.openFile(filename), xmlBase, filename, errorHandler, sink) ;
     }
-    
-    private LangRDFXML(Reader reader, String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink)
-    {
+
+    private LangRDFXML(Reader reader, String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink) {
         this.reader = reader ;
         this.xmlBase = xmlBase ;
         this.filename = filename ;
@@ -95,8 +90,7 @@ public class LangRDFXML implements LangRIOT
         this.profile = RiotLib.profile(getLang(), xmlBase, errorHandler) ;
     }
     
-    private LangRDFXML(InputStream in, String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink)
-    {
+    private LangRDFXML(InputStream in, String xmlBase, String filename, ErrorHandler errorHandler,
StreamRDF sink) {
         this.input = in ;
         this.xmlBase = xmlBase ;
         this.filename = filename ;
@@ -117,48 +111,46 @@ public class LangRDFXML implements LangRIOT
     } ;
     
     @Override
-    public void parse()
-    {   
+    public void parse() {
         // Hacked out of ARP because of all the "private" methods
         sink.start() ;
         HandlerSink rslt = new HandlerSink(sink, getProfile().getHandler()) ;
-        arp.getHandlers().setStatementHandler(rslt);
+        arp.getHandlers().setStatementHandler(rslt) ;
         arp.getHandlers().setErrorHandler(rslt) ;
         arp.getHandlers().setNamespaceHandler(rslt) ;
-        
-        if ( RiotUniformCompatibility )
-        {
+
+        if ( RiotUniformCompatibility ) {
             ARPOptions options = arp.getOptions() ;
-            // Convert some warnings to errors for compatible behaviour for all parsers.

+            // Convert some warnings to errors for compatible behaviour for all parsers.
             for ( int code : additionalErrors )
                 options.setErrorMode(code, ARPErrorNumbers.EM_FATAL) ;
             arp.setOptionsWith(options) ;
         }
-        
+
         try {
             if ( reader != null )
-                arp.load(reader, xmlBase);
+                arp.load(reader, xmlBase) ;
             else
-                arp.load(input, xmlBase);
-        } catch (IOException e) {
-            getProfile().getHandler().error(filename + ": " + ParseException.formatMessage(e),
-1 , -1) ;
-        } catch (SAXParseException e) {
+                arp.load(input, xmlBase) ;
+        }
+        catch (IOException e) {
+            getProfile().getHandler().error(filename + ": " + ParseException.formatMessage(e),
-1, -1) ;
+        }
+        catch (SAXParseException e) {
             // already reported.
-        } catch (SAXException sax) {
-            getProfile().getHandler().error(filename + ": " + ParseException.formatMessage(sax),
-1 , -1) ;
+        }
+        catch (SAXException sax) {
+            getProfile().getHandler().error(filename + ": " + ParseException.formatMessage(sax),
-1, -1) ;
         }
         sink.finish() ;
     }
-
     
-    private static class HandlerSink extends ARPSaxErrorHandler implements StatementHandler,
NamespaceHandler
-    {
-        private StreamRDF output ;
-        private ErrorHandler errHandler ;
+    private static class HandlerSink extends ARPSaxErrorHandler implements StatementHandler,
NamespaceHandler {
+        private StreamRDF       output ;
+        private ErrorHandler    errHandler ;
         private CheckerLiterals checker ;
 
-        HandlerSink(StreamRDF output, ErrorHandler errHandler)
-        {
+        HandlerSink(StreamRDF output, ErrorHandler errHandler) {
             super(new ErrorHandlerBridge(errHandler)) ;
             this.output = output ;
             this.errHandler = errHandler ;
@@ -202,41 +194,35 @@ public class LangRDFXML implements LangRIOT
 
         }
 
-        private Triple convert(AResource s, AResource p, AResource o)
-        {
-            return Triple.create(convert(s), convert(p), convert(o));
+        private Triple convert(AResource s, AResource p, AResource o) {
+            return Triple.create(convert(s), convert(p), convert(o)) ;
         }
 
-        private Triple convert(AResource s, AResource p, ALiteral o)
-        {
+        private Triple convert(AResource s, AResource p, ALiteral o) {
             Node object = convert(o) ;
             checker.check(object, -1, -1) ;
-            return Triple.create(convert(s), convert(p), object);
+            return Triple.create(convert(s), convert(p), object) ;
         }
-        
+
         @Override
-        public void startPrefixMapping(String prefix, String uri)
-        {
+        public void startPrefixMapping(String prefix, String uri) {
             output.prefix(prefix, uri) ;
         }
-        
+
         @Override
-        public void endPrefixMapping(String prefix)
-        {}
+        public void endPrefixMapping(String prefix) {}
     }
-    
-    private static class ErrorHandlerBridge implements RDFErrorHandler
-    {
+
+    private static class ErrorHandlerBridge implements RDFErrorHandler {
         private ErrorHandler errorHandler ;
 
-        ErrorHandlerBridge(ErrorHandler hander)
-        {
+        ErrorHandlerBridge(ErrorHandler hander) {
             this.errorHandler = hander ;
         }
 
         @Override
-        public void warning(Exception e) { 
-            Pair<Integer, Integer> p =  getLineCol(e) ;
+        public void warning(Exception e) {
+            Pair<Integer, Integer> p = getLineCol(e) ;
             errorHandler.warning(e.getMessage(), p.getLeft(), p.getRight()) ;
         }
 
@@ -253,9 +239,9 @@ public class LangRDFXML implements LangRIOT
         }
 
         private static Pair<Integer, Integer> getLineCol(Exception e) {
-            if (e instanceof SAXParseException) {
-                SAXParseException esax = (SAXParseException) e;
-                return Pair.create(esax.getLineNumber(), esax.getColumnNumber()) ; 
+            if ( e instanceof SAXParseException ) {
+                SAXParseException esax = (SAXParseException)e ;
+                return Pair.create(esax.getLineNumber(), esax.getColumnNumber()) ;
             } else {
                 return Pair.create(-1, -1) ;
             }


Mime
View raw message