Author: bblfish
Date: Thu Jun 23 19:54:36 2011
New Revision: 1139048

URL: http://svn.apache.org/viewvc?rev=1139048&view=rev
Log:
CLEREZZA-510 did not mean to remve the code here (just yet at least). There is 
code duplication, but need to think about best way around this.

Modified:
    
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala

Modified: 
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala?rev=1139048&r1=1139047&r2=1139048&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
 (original)
+++ 
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
 Thu Jun 23 19:54:36 2011
@@ -119,7 +119,40 @@ protected object TcIndependentConversion
        val emptyGraph = new impl.SimpleGraph(new impl.SimpleMGraph)
        val emptyLiteral = new RichGraphNode(new GraphNode(new 
impl.PlainLiteralImpl(""), emptyGraph))
 
-       
+       /**
+        * A Literal Builder enriches a String with methods to create a literal
+        */
+       class LiteralBuilder(val lexicalForm: String) {
+
+       /**
+                * Produces a PlainLiteral with the wrapped String as lexical 
form
+                * and a given language
+                *
+                * @param lang the language tag of the literal to be created
+                * @return a plain literal with the specified language
+                */
+               def lang(lang: Lang) = new PlainLiteralImpl(lexicalForm, lang)
+
+               /**
+                * Produces a PlainLiteral with the wrapped String as lexical 
form
+                * and a given language
+                *
+                * @param lang a symbol of which the name is the language tag 
of the literal to be created
+                * @return a plain literal with the specified language
+                */
+               def lang(lang: Symbol) = new PlainLiteralImpl(lexicalForm, new 
Language(lang.name))
+
+               /**
+                * Produces a TypedLiteral with the wrapped String as lexical 
form
+                * and a data type
+                *
+                * @param dataType the data type
+                * @return the TypedLiteral of the specified type
+                */
+               def ^^(dataType: UriRef) = new TypedLiteralImpl(lexicalForm, 
dataType)
+
+       }
+
        /**
         * A UriRef Builder enriches a String with methods to create a UriRef
         */


Reply via email to