You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2013/04/18 15:40:36 UTC

svn commit: r1469321 - /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java

Author: andy
Date: Thu Apr 18 13:40:36 2013
New Revision: 1469321

URL: http://svn.apache.org/r1469321
Log:
Debug facility.

Added:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java

Added: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java?rev=1469321&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java (added)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/function/library/print.java Thu Apr 18 13:40:36 2013
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.sparql.function.library;
+
+import com.hp.hpl.jena.sparql.expr.NodeValue ;
+import com.hp.hpl.jena.sparql.function.FunctionBase1 ;
+
+/** Function that prints it's argument to stdout (debugging aid) */
+public class print extends FunctionBase1 {
+
+    @Override
+    public NodeValue exec(NodeValue nv)
+    {
+        String s = nv.asString() ;
+        System.out.println(s) ;
+        System.out.flush() ;
+        return NodeValue.TRUE ;
+    }
+}