You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
(48) |
May
(21) |
Jun
(3) |
Jul
(10) |
Aug
(66) |
Sep
(11) |
Oct
(7) |
Nov
(73) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(3) |
Feb
(17) |
Mar
(19) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(43) |
Aug
(18) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
|
2010 |
Jan
(3) |
Feb
(7) |
Mar
(21) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(7) |
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <lh...@us...> - 2008-11-20 15:00:53
|
Revision: 219 http://tinytim.svn.sourceforge.net/tinytim/?rev=219&view=rev Author: lheuer Date: 2008-11-20 15:00:50 +0000 (Thu, 20 Nov 2008) Log Message: ----------- - Added license - Incremented version suffix (2.0 and 1.5) Modified Paths: -------------- tinytim-mio/trunk/CHANGES.txt tinytim-mio/trunk/build-15.properties tinytim-mio/trunk/build.properties Added Paths: ----------- tinytim-mio/trunk/lib/LICENSE.sesame.txt Modified: tinytim-mio/trunk/CHANGES.txt =================================================================== --- tinytim-mio/trunk/CHANGES.txt 2008-11-20 14:30:14 UTC (rev 218) +++ tinytim-mio/trunk/CHANGES.txt 2008-11-20 15:00:50 UTC (rev 219) @@ -2,7 +2,7 @@ Changes Log =========== -2.0.0 a3 (xx.11.2008) +2.0.0 a4 (xx.11.2008) --------------------- * Initial .mio release for tinyTiM 2.x * Changed license to Apache License 2.0 Modified: tinytim-mio/trunk/build-15.properties =================================================================== --- tinytim-mio/trunk/build-15.properties 2008-11-20 14:30:14 UTC (rev 218) +++ tinytim-mio/trunk/build-15.properties 2008-11-20 15:00:50 UTC (rev 219) @@ -1,5 +1,5 @@ version=1.5.0 -version_suffix=b +version_suffix=b2 #release_type= debug=off optimize=on Modified: tinytim-mio/trunk/build.properties =================================================================== --- tinytim-mio/trunk/build.properties 2008-11-20 14:30:14 UTC (rev 218) +++ tinytim-mio/trunk/build.properties 2008-11-20 15:00:50 UTC (rev 219) @@ -1,5 +1,5 @@ version=2.0.0 -version_suffix=a3 +version_suffix=a4 #release_type= debug=off optimize=on Added: tinytim-mio/trunk/lib/LICENSE.sesame.txt =================================================================== --- tinytim-mio/trunk/lib/LICENSE.sesame.txt (rev 0) +++ tinytim-mio/trunk/lib/LICENSE.sesame.txt 2008-11-20 15:00:50 UTC (rev 219) @@ -0,0 +1,25 @@ +Copyright Aduna (http://www.aduna-software.com/) \xA9 2001-2007 +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-20 14:30:23
|
Revision: 218 http://tinytim.svn.sourceforge.net/tinytim/?rev=218&view=rev Author: lheuer Date: 2008-11-20 14:30:14 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Better, consistent naming for the CTM libs Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-ctm-draft-2008-05-15-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-ctm-working-draft-2008-11-19-0.9.3.jar Removed Paths: ------------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-draft-2008-05-15.jar tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar Deleted: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-draft-2008-05-15.jar =================================================================== (Binary files differ) Deleted: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/semagia-mio-ctm-draft-2008-05-15-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ctm-draft-2008-05-15-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/semagia-mio-ctm-working-draft-2008-11-19-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ctm-working-draft-2008-11-19-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-20 14:16:25
|
Revision: 217 http://tinytim.svn.sourceforge.net/tinytim/?rev=217&view=rev Author: lheuer Date: 2008-11-20 14:16:20 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Changed semagia-mio-ctm-0.9.3.jar to semagia-mio-ctm-0.9.3-draft-2008-05-15.jar to avoid confusion Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-draft-2008-05-15.jar Removed Paths: ------------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3.jar Added: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-draft-2008-05-15.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-draft-2008-05-15.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-20 13:58:02
|
Revision: 216 http://tinytim.svn.sourceforge.net/tinytim/?rev=216&view=rev Author: lheuer Date: 2008-11-20 13:57:53 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Updated mio TM/XML acc. to <http://wega.tm.informatik.uni-frankfurt.de/ueberall/misc/logs/archive/%23topicmaps20081120.html> Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar Modified: tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 19:20:06
|
Revision: 215 http://tinytim.svn.sourceforge.net/tinytim/?rev=215&view=rev Author: lheuer Date: 2008-11-19 19:20:04 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Updated CHANGES.txt Modified Paths: -------------- tinytim/trunk/CHANGES.txt Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-11-19 18:45:34 UTC (rev 214) +++ tinytim/trunk/CHANGES.txt 2008-11-19 19:20:04 UTC (rev 215) @@ -2,6 +2,15 @@ Changes Log =========== +2.0.0 a4 (xx.11.2008) +--------------------- + +Bugfixes: +--------- +* Bug #2315558 -- Decimal value "9.3" is not accepted + + + 2.0.0 a3 (14.11.2008) --------------------- * Moved to Apache License 2.0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 18:45:38
|
Revision: 214 http://tinytim.svn.sourceforge.net/tinytim/?rev=214&view=rev Author: lheuer Date: 2008-11-19 18:45:34 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Added Jing for XTM 1.0/2.0 and TM/XML validation Added Paths: ----------- tinytim-mio/trunk/lib/LICENSE.jiing.txt tinytim-mio/trunk/lib/jing.jar Added: tinytim-mio/trunk/lib/LICENSE.jiing.txt =================================================================== --- tinytim-mio/trunk/lib/LICENSE.jiing.txt (rev 0) +++ tinytim-mio/trunk/lib/LICENSE.jiing.txt 2008-11-19 18:45:34 UTC (rev 214) @@ -0,0 +1,26 @@ +Jing Copying Conditions + +Copyright (c) 2001-2003, 2008 Thai Open Source Software Center Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the Thai Open Source Software Center Ltd nor the names + of its contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: tinytim-mio/trunk/lib/jing.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/jing.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 18:13:07
|
Revision: 213 http://tinytim.svn.sourceforge.net/tinytim/?rev=213&view=rev Author: lheuer Date: 2008-11-19 18:13:00 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Removed (again! :( ) the System.out.println Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar Modified: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 15:49:14
|
Revision: 212 http://tinytim.svn.sourceforge.net/tinytim/?rev=212&view=rev Author: lheuer Date: 2008-11-19 15:49:09 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Changed license to Apache Lic Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt 2008-11-19 15:42:50 UTC (rev 211) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt 2008-11-19 15:49:09 UTC (rev 212) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed 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 * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * 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 org.tinytim.mio; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 15:43:02
|
Revision: 211 http://tinytim.svn.sourceforge.net/tinytim/?rev=211&view=rev Author: lheuer Date: 2008-11-19 15:42:50 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Added *experimental* support for tinyTiM 1.5 (TMAPI 1.0) Added Paths: ----------- tinytim-mio/trunk/build-15.properties tinytim-mio/trunk/build-15.xml tinytim-mio/trunk/lib/tinytim-1.5.0beta.jar tinytim-mio/trunk/lib/tmapi-1_0SP1.jar tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt Added: tinytim-mio/trunk/build-15.properties =================================================================== --- tinytim-mio/trunk/build-15.properties (rev 0) +++ tinytim-mio/trunk/build-15.properties 2008-11-19 15:42:50 UTC (rev 211) @@ -0,0 +1,5 @@ +version=1.5.0 +version_suffix=b +#release_type= +debug=off +optimize=on Added: tinytim-mio/trunk/build-15.xml =================================================================== --- tinytim-mio/trunk/build-15.xml (rev 0) +++ tinytim-mio/trunk/build-15.xml 2008-11-19 15:42:50 UTC (rev 211) @@ -0,0 +1,197 @@ +<?xml version="1.0" encoding="utf-8"?> +<project name="tinyTiM" default="jar" basedir="."> + <property file="build-15.properties"/> + <tstamp/> + <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> + + <property name="dir.src" value="${basedir}/src/main/java"/> + <property name="dir.test" value="${basedir}/src/test/java"/> + <property name="dir.lib" value="${basedir}/lib"/> + + <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-1_0SP1.jar"/> + <property name="lib.tinytim" value="${dir.lib}/tinytim-1.5.0beta.jar"/> + <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.2.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> + + <target name="help"> + <echo message="------------------------"/> + <echo message="tinyTiM MIO - Build file"/> + <echo message="------------------------"/> + <echo message=""/> + <echo message="Available targets:"/> + <echo message=""/> + <echo message=" jar Creates the jar"/> + <echo message=" doc Generates the Java Docs"/> + <echo message=" release Creates the jar and a distributable file"/> + </target> + + <target name="init"> + <property name="dist.version" value="${version}${version_suffix}${release_type}"/> + <property name="dist.name" value="tinytim-mio-${dist.version}"/> + + <property name="tinytim-mio.jar" value="${dist.name}.jar"/> + <property name="tinytim-mio.tar" value="${dist.name}.tar"/> + <property name="tinytim-mio.tar.gz" value="${tinytim-mio.tar}.gz"/> + <property name="tinytim-mio.zip" value="${dist.name}.zip"/> + + <property name="dir.build" value="${basedir}/build"/> + <property name="dir.dist.root" value="${dir.build}/dist"/> + <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> + <property name="dir.build.classes" value="${dir.build}/classes"/> + <property name="dir.build.tests" value="${dir.build}/tests"/> + <property name="dir.javadocs" value="${dir.dist}/docs/api"/> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init"> + <delete dir="${dir.build}"/> + <delete dir="${dir.javadocs}"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <mkdir dir="${dir.build}"/> + <mkdir dir="${dir.build.classes}"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the Java Docs --> + <!-- =================================================================== --> + <target name="doc" depends="init"> + <mkdir dir="${dir.javadocs}"/> + <javadoc destdir="${dir.javadocs}" + packagenames="org.tinytim.*" + author="true" + version="false" + use="true" + splitindex="true" + noindex="false" + windowtitle="tinyTiM MIO API v${dist.version}" + doctitle="tinyTiM API MIO v${dist.version}"> + <fileset dir="${dir.src}"> + </fileset> + <link href="http://www.tmapi.org/apiDocs/"/> + </javadoc> + </target> + + <!-- =================================================================== --> + <!-- Tests --> + <!-- =================================================================== --> + <target name="test" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tinytim}"/> + <pathelement location="${lib.mio}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + <junit printsummary="true" showoutput="false" + errorProperty="test.failed" failureProperty="test.failed"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${dir.build.tests}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tinytim}"/> + <pathelement location="${lib.mio}"/> + </classpath> + <formatter type="brief" usefile="false"/> + <batchtest fork="no" todir="${dir.build}"> + <fileset dir="${dir.build.tests}/"> + <include name="**/Test**.class"/> + </fileset> + </batchtest> + </junit> + <fail message="Tests failed. Check test output." if="test.failed"/> + </target> + + <!-- =================================================================== --> + <!-- Compile source files --> + <!-- =================================================================== --> + <target name="compile" depends="clean, prepare"> + <copy file="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler.java" tofile="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler-20.txt"/> + <copy file="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler-15.txt" tofile="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler.java" overwrite="true"/> + <javac destdir="${dir.build.classes}" + debug="${debug}" + excludes="org/tinytim/mio/**Writer.*" + target="1.5"> + <classpath> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tinytim}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.logging}"/> + </classpath> + <src path="${dir.src}"/> + </javac> + <copy file="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler-20.txt" tofile="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler.java" overwrite="true"/> + <delete file="${dir.src}/org/tinytim/mio/TinyTimMapInputHandler-20.txt"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the jar --> + <!-- =================================================================== --> + <target name="jar" depends="compile"> + <jar destfile="${dir.build}/${tinytim-mio.jar}"> + <fileset dir="${dir.build.classes}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM MIO"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://sourceforge.net/projects/tinytim"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Prepares a distribution --> + <!-- =================================================================== --> + <target name="dist" depends="jar"> + <mkdir dir="${dir.dist}"/> + + <copy todir="${dir.dist}" file="${dir.build}/${tinytim-mio.jar}"/> + + <copy todir="${dir.dist}/src"> + <fileset dir="${dir.src}"/> + </copy> + <copy todir="${dir.dist}/test"> + <fileset dir="${dir.test}"/> + </copy> + <copy todir="${dir.dist}/lib"> + <fileset dir="${dir.lib}"> + <exclude name="**/tmapi*.jar"/> + <exclude name="**/tinytim*.jar"/> + </fileset> + </copy> + + <copy todir="${dir.dist}" file="CHANGES.txt"/> + <copy todir="${dir.dist}" file="LICENSE.txt"/> + <copy todir="${dir.dist}" file="README.txt"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the distribution files (.zip and .tar.gz) --> + <!-- --> + <!-- Won't create the distribution files if a test fails --> + <!-- =================================================================== --> + <target name="release" depends="jar, test, doc, dist"> + <tar destfile="${dir.dist.root}/${tinytim-mio.tar}" + basedir="${dir.dist.root}"/> + <gzip src="${dir.dist.root}/${tinytim-mio.tar}" + destfile="${dir.build}/${tinytim-mio.tar.gz}" /> + <delete file="${dir.dist.root}/${tinytim-mio.tar}" /> + <zip destfile="${dir.build}/${tinytim-mio.zip}" basedir="${dir.dist.root}"/> + </target> +</project> Added: tinytim-mio/trunk/lib/tinytim-1.5.0beta.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/tinytim-1.5.0beta.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/tmapi-1_0SP1.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/tmapi-1_0SP1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt (rev 0) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler-15.txt 2008-11-19 15:42:50 UTC (rev 211) @@ -0,0 +1,595 @@ +/* + * This is tinyTiM, a tiny Topic Maps engine. + * + * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +package org.tinytim.mio; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.logging.Logger; + +import org.tinytim.IReifiable; +import org.tinytim.ITyped; +import org.tinytim.TopicMapImpl; +import org.tinytim.TypeInstanceConverter; +import org.tinytim.voc.TMDM; +import org.tmapi.core.Association; +import org.tmapi.core.AssociationRole; +import org.tmapi.core.Locator; +import org.tmapi.core.Occurrence; +import org.tmapi.core.ScopedObject; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; +import org.tmapi.core.TopicMapObject; +import org.tmapi.core.TopicName; +import org.tmapi.core.Variant; + +import com.semagia.mio.IMapHandler; +import com.semagia.mio.IRef; +import com.semagia.mio.MIOException; +import com.semagia.mio.voc.XSD; + +/** + * {@link com.semagia.mio.IMapHandler} implementation. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev: 123 $ - $Date: 2008-08-14 14:05:34 +0200 (Do, 14 Aug 2008) $ + */ +public class TinyTimMapInputHandler implements IMapHandler { + + private enum State { + INITIAL, TOPIC, ASSOCIATION, ROLE, OCCURRENCE, NAME, VARIANT, + SCOPE, THEME, REIFIER, PLAYER, ISA, TYPE; + } + + private static final Logger LOG = Logger.getLogger(TinyTimMapInputHandler.class.getName()); + + private TopicMapImpl _tm; + private List<State> _stateStack; + private List<TopicMapObject> _constructStack; + + public TinyTimMapInputHandler() { + } + + public TinyTimMapInputHandler(TopicMap topicMap) { + this(); + setTopicMap(topicMap); + } + + /** + * Sets the topic map instance to operate on. + * + * @param topicMap The topic map. + */ + public void setTopicMap(TopicMap topicMap) { + if (topicMap == null) { + throw new IllegalArgumentException("The topic map must not be null"); + } + _tm = (TopicMapImpl) topicMap; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTopicMap() + */ + public void startTopicMap() throws MIOException { + _constructStack = new ArrayList<TopicMapObject>(); + _stateStack = new ArrayList<State>(); + _enterState(State.INITIAL, _tm); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTopicMap() + */ + public void endTopicMap() throws MIOException { + TypeInstanceConverter.convertAssociationsToTypes(_tm); + _constructStack = null; + _stateStack = null; + _tm = null; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTopic(com.semagia.mio.IRef) + */ + public void startTopic(IRef identity) throws MIOException { + _enterState(State.TOPIC, _createTopic(identity)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTopic() + */ + public void endTopic() throws MIOException { + Topic topic = (Topic) _leaveStatePopConstruct(State.TOPIC); + _handleTopic(topic); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startAssociation() + */ + public void startAssociation() throws MIOException { + _enterState(State.ASSOCIATION, _tm.createAssociation()); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endAssociation() + */ + public void endAssociation() throws MIOException { + _leaveStatePopConstruct(State.ASSOCIATION); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startRole() + */ + public void startRole() throws MIOException { + assert _state() == State.ASSOCIATION; + _enterState(State.ROLE, ((Association) _peekConstruct()).createAssociationRole(null, null)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endRole() + */ + public void endRole() throws MIOException { + _leaveStatePopConstruct(State.ROLE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startPlayer() + */ + public void startPlayer() throws MIOException { + assert _state() == State.ROLE; + _enterState(State.PLAYER); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endPlayer() + */ + public void endPlayer() throws MIOException { + _leaveState(State.PLAYER); + assert _state() == State.ROLE; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startOccurrence() + */ + public void startOccurrence() throws MIOException { + _enterState(State.OCCURRENCE, _peekTopic().createOccurrence((Locator) null, null, null)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endOccurrence() + */ + public void endOccurrence() throws MIOException { + _leaveStatePopConstruct(State.OCCURRENCE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startName() + */ + public void startName() throws MIOException { + _enterState(State.NAME, _peekTopic().createTopicName(null, null)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endName() + */ + public void endName() throws MIOException { + TopicName name = (TopicName) _leaveStatePopConstruct(State.NAME); + if (name.getType() == null) { + name.setType(_topicBySubjectIdentifier(TMDM.TOPIC_NAME)); + } + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startVariant() + */ + public void startVariant() throws MIOException { + assert _state() == State.NAME; + _enterState(State.VARIANT, ((TopicName) _peekConstruct()).createVariant((Locator) null, null)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endVariant() + */ + @SuppressWarnings("unchecked") + public void endVariant() throws MIOException { + Variant variant = (Variant) _leaveStatePopConstruct(State.VARIANT); + Collection<Topic> scope = variant.getScope(); + if (scope.isEmpty() || variant.getTopicName().getScope().equals(scope)) { + throw new MIOException("The variant has no scope"); + } + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startType() + */ + public void startType() throws MIOException { + assert _peekConstruct() instanceof ITyped; + _enterState(State.TYPE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endType() + */ + public void endType() throws MIOException { + _leaveState(State.TYPE); + assert _peekConstruct() instanceof ITyped; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startScope() + */ + public void startScope() throws MIOException { + assert _peekConstruct() instanceof ScopedObject; + _enterState(State.SCOPE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endScope() + */ + public void endScope() throws MIOException { + _leaveState(State.SCOPE); + assert _peekConstruct() instanceof ScopedObject; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTheme() + */ + public void startTheme() throws MIOException { + assert _state() == State.SCOPE; + _enterState(State.THEME); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTheme() + */ + public void endTheme() throws MIOException { + _leaveState(State.THEME); + assert _state() == State.SCOPE; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#subjectIdentifier(java.lang.String) + */ + public void subjectIdentifier(String subjectIdentifier) throws MIOException { + Locator sid = _tm.createLocator(subjectIdentifier); + Topic topic = _peekTopic(); + Topic existing = _tm.getTopicBySubjectIdentifier(sid); + if (existing != null && !existing.equals(topic)) { + _merge(existing, topic); + } + else { + TopicMapObject tmo = _tm.getObjectByItemIdentifier(sid); + if (tmo != null && tmo instanceof Topic && !tmo.equals(topic)) { + _merge((Topic) tmo, topic); + } + } + topic.addSubjectIdentifier(sid); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#subjectLocator(java.lang.String) + */ + public void subjectLocator(String subjectLocator) throws MIOException { + Locator slo = _tm.createLocator(subjectLocator); + Topic topic = _peekTopic(); + Topic existing = _tm.getTopicBySubjectLocator(slo); + if (existing != null && !existing.equals(topic)) { + _merge(existing, topic); + } + topic.addSubjectLocator(slo); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#itemIdentifier(java.lang.String) + */ + public void itemIdentifier(String itemIdentifier) throws MIOException { + Locator iid = _tm.createLocator(itemIdentifier); + TopicMapObject tmo = _peekConstruct(); + if (_state() == State.TOPIC) { + TopicMapObject existing = _tm.getObjectByItemIdentifier(iid); + if (existing != null && existing instanceof Topic && !existing.equals(tmo)) { + _merge((Topic) existing, (Topic) tmo); + } + else { + Topic topic = _tm.getTopicBySubjectIdentifier(iid); + if (topic != null && !topic.equals(tmo)) { + _merge(topic, (Topic) tmo); + } + } + } + tmo.addSourceLocator(iid); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startIsa() + */ + public void startIsa() throws MIOException { + assert _state() == State.TOPIC; + _enterState(State.ISA); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endIsa() + */ + public void endIsa() throws MIOException { + _leaveState(State.ISA); + assert _state() == State.TOPIC; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startReifier() + */ + public void startReifier() throws MIOException { + assert _peekConstruct() instanceof IReifiable; + _enterState(State.REIFIER); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endReifier() + */ + public void endReifier() throws MIOException { + _leaveState(State.REIFIER); + assert _peekConstruct() instanceof IReifiable; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#topicRef(com.semagia.mio.IRef) + */ + public void topicRef(IRef identity) throws MIOException { + _handleTopic(_createTopic(identity)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#value(java.lang.String) + */ + public void value(String value) throws MIOException { + assert _state() == State.NAME; + ((TopicName) _peekConstruct()).setValue(value); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#value(java.lang.String, java.lang.String) + */ + public void value(String value, String datatype) throws MIOException { + boolean isLocator = XSD.ANY_URI.equals(datatype); + if (!isLocator && !XSD.STRING.equals(datatype)) { + LOG.warning("The datatype '" + datatype + "' was converted into xsd:string"); + } + if (_state() == State.OCCURRENCE) { + Occurrence occ = (Occurrence) _peekConstruct(); + if (isLocator) { + occ.setResource(_tm.createLocator(value)); + } + else { + occ.setValue(value); + } + } + else { + assert _state() == State.VARIANT; + Variant variant = (Variant) _peekConstruct(); + if (isLocator) { + variant.setResource(_tm.createLocator(value)); + } + else { + variant.setValue(value); + } + } + } + + /** + * Enters a state. + * + * @param state The state to push ontop of the state stack. + */ + private void _enterState(State state) { + _stateStack.add(state); + } + + /** + * Enters a state and pushes the Topic Maps construct ontop of the construct + * stack. + * + * @param state The state to enter. + * @param tmo The Topic Maps construct which should be pushed to the stack. + */ + private void _enterState(State state, TopicMapObject tmo) { + _enterState(state); + _constructStack.add(tmo); + } + + /** + * Leaves a state. + * + * @param state The state to leave. + * @throws MIOException If the state is not equals to the current state. + */ + private void _leaveState(State state) throws MIOException { + State current = _stateStack.remove(_stateStack.size()-1); + if (state != current) { + _reportError("Unexpected state: " + current + ", expected: " + state); + } + } + + /** + * Leaves a state and removed the Topic Maps construct from the top of the + * construct stack. + * + * @param state The state to leave. + * @return The removed construct. + * @throws MIOException If the state is not equals to the current state. + */ + private TopicMapObject _leaveStatePopConstruct(State state) throws MIOException { + _leaveState(state); + return _constructStack.remove(_constructStack.size()-1); + } + + /** + * Returns the Topic Maps construct on top of the stack. + * + * @return The Topic Maps construct. + */ + private TopicMapObject _peekConstruct() { + return _constructStack.get(_constructStack.size()-1); + } + + /** + * Returns the topic on top of the stack. + * + * @return The topic. + */ + private Topic _peekTopic() { + return (Topic) _peekConstruct(); + } + + /** + * Returns the current state. + * + * @return The current state. + */ + private State _state() { + return _stateStack.get(_stateStack.size()-1); + } + + /** + * Handles the topic dependent on the current state. + * + * @param topic The topic to handle. + */ + private void _handleTopic(Topic topic) { + switch (_state()) { + case ISA: _peekTopic().addType(topic); break; + case TYPE: ((ITyped) _peekConstruct()).setType(topic); break; + case PLAYER: ((AssociationRole) _peekConstruct()).setPlayer(topic); break; + case THEME: ((ScopedObject) _peekConstruct()).addScopingTopic(topic); break; + case REIFIER: ((IReifiable) _peekConstruct()).setReifier(topic); break; + } + } + + /** + * Merges the <tt>source</tt> topic with the <tt>target</tt>. + * + * Further, this method ensures that the construct stack stays valid: If + * the <tt>source</tt> is part of the stack, it is replaced with + * <tt>target</tt>. + * + * @param source The source topic (will be removed). + * @param target The target topic. + */ + private void _merge(Topic source, Topic target) { + int i = _constructStack.indexOf(source); + while (i > -1) { + _constructStack.set(i, target); + i = _constructStack.indexOf(source); + } + target.mergeIn(source); + } + + /** + * Returns either an existing topic with the specified identity or creates + * a topic with the given identity. + * + * @param ref The identity of the topic. + * @return A topic instance. + * @throws MIOException + */ + private Topic _createTopic(IRef ref) throws MIOException { + Locator loc = _tm.createLocator(ref.getIRI()); + switch (ref.getType()) { + case IRef.ITEM_IDENTIFIER: return _topicByItemIdentifier(loc); + case IRef.SUBJECT_IDENTIFIER: return _topicBySubjectIdentifier(loc); + case IRef.SUBJECT_LOCATOR: return _topicBySubjectLocator(loc); + default: _reportError("Unknown reference type " + ref.getType()); + } + // Never returned, an exception was thrown + return null; + } + + /** + * Returns either an existing topic with the specified item identfier, + * or creates a topic with the given item identifier. + * + * @param iid The item identifier of the topic. + * @return A topic instance. + */ + private Topic _topicByItemIdentifier(Locator iid) { + TopicMapObject tmo = _tm.getObjectByItemIdentifier(iid); + Topic topic = (tmo instanceof Topic) ? (Topic) tmo : null; + if (topic == null) { + topic = _tm.getTopicBySubjectIdentifier(iid); + if (topic != null) { + topic.addSourceLocator(iid); + } + } + if (topic == null) { + topic = _tm.createTopic(); + topic.addSourceLocator(iid); + } + return topic; + } + + /** + * Returns either an existing topic with the specified subject identfier, + * or creates a topic with the given subject identifier. + * + * @param sid The subject identifier of the topic. + * @return A topic instance. + */ + private Topic _topicBySubjectIdentifier(Locator sid) { + Topic topic = _tm.getTopicBySubjectIdentifier(sid); + if (topic == null) { + TopicMapObject tmo = _tm.getObjectByItemIdentifier(sid); + if (tmo instanceof Topic) { + topic = (Topic) tmo; + topic.addSubjectIdentifier(sid); + } + } + if (topic == null) { + topic = _tm.createTopic(); + topic.addSubjectIdentifier(sid); + } + return topic; + } + + /** + * Returns either an existing topic with the specified subject locator, + * or creates a topic with the given subject locator. + * + * @param slo The subject locator of the topic. + * @return A topic instance. + */ + private Topic _topicBySubjectLocator(Locator slo) { + Topic topic = _tm.getTopicBySubjectLocator(slo); + if (topic == null) { + topic = _tm.createTopic(); + topic.addSubjectLocator(slo); + } + return topic; + } + + /** + * Reports an error. + * + * @param msg The error message. + * @throws MIOException Thrown in any case. + */ + private static void _reportError(String msg) throws MIOException { + throw new MIOException(msg); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 13:47:50
|
Revision: 210 http://tinytim.svn.sourceforge.net/tinytim/?rev=210&view=rev Author: lheuer Date: 2008-11-19 13:47:44 +0000 (Wed, 19 Nov 2008) Log Message: ----------- - Fixed bug in LiteralNormalizer for decimals "9.3" was reported as illegal value - Added more tests for LiteralNormalizer Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/core/value/DecimalLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/value/IntegerLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/value/Literal.java tinytim/trunk/src/main/java/org/tinytim/core/value/LiteralNormalizer.java tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteralNormalizer.java Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/DecimalLiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/DecimalLiteral.java 2008-11-19 13:45:23 UTC (rev 209) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/DecimalLiteral.java 2008-11-19 13:47:44 UTC (rev 210) @@ -101,7 +101,7 @@ */ @Override public int hashCode() { - return _decimal.hashCode(); + return _lexicalForm.hashCode(); } /* (non-Javadoc) Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/IntegerLiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/IntegerLiteral.java 2008-11-19 13:45:23 UTC (rev 209) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/IntegerLiteral.java 2008-11-19 13:47:44 UTC (rev 210) @@ -105,7 +105,7 @@ */ @Override public int hashCode() { - return _integer.hashCode(); + return _lexicalForm.hashCode(); } /* (non-Javadoc) Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/Literal.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/Literal.java 2008-11-19 13:45:23 UTC (rev 209) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/Literal.java 2008-11-19 13:47:44 UTC (rev 210) @@ -46,28 +46,14 @@ private final Locator _datatype; private Literal(final String value, final Locator datatype) { - if (value == null) { - throw new IllegalArgumentException("The value must not be null"); - } _value = LiteralNormalizer.normalize(value, datatype); _datatype = datatype; } - /* (non-Javadoc) - * @see org.tinytim.internal.api.ILiteral#getDatatype() - */ - public Locator getDatatype() { - return _datatype; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.ILiteral#getValue() - */ - public String getValue() { - return _value; - } - public static synchronized ILiteral get(String value) { + if (value == null) { + throw new IllegalArgumentException("The value must not be null"); + } return _STRINGS.get(new Literal(value, XSD.STRING)); } @@ -108,7 +94,7 @@ return lit; } - public static synchronized ILiteral create(final String value, final Locator datatype) { + public static ILiteral create(final String value, final Locator datatype) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } @@ -133,7 +119,7 @@ return _registerIfAbsent(_OTHERS, new Literal(value, datatype)); } - public static synchronized ILiteral create(String value) { + public static ILiteral create(String value) { return _registerIfAbsent(_STRINGS, new Literal(value, XSD.STRING)); } @@ -164,35 +150,35 @@ return (ILocator) value; } - public static synchronized ILocator createIRI(String value) { + public static ILocator createIRI(String value) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } return _registerIfAbsent(_IRIS, new LocatorImpl(value)); } - public static synchronized ILiteral createDecimal(String value) { + public static ILiteral createDecimal(String value) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } return _registerIfAbsent(_OTHERS, new DecimalLiteral(value)); } - public static synchronized ILiteral createDecimal(BigDecimal value) { + public static ILiteral createDecimal(BigDecimal value) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } return _registerIfAbsent(_OTHERS, new DecimalLiteral(value)); } - public static synchronized ILiteral createInteger(String value) { + public static ILiteral createInteger(String value) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } return _registerIfAbsent(_OTHERS, new IntegerLiteral(value)); } - public static synchronized ILiteral createInteger(BigInteger value) { + public static ILiteral createInteger(BigInteger value) { if (value == null) { throw new IllegalArgumentException("The value must not be null"); } @@ -204,22 +190,51 @@ : BooleanLiteral.FALSE; } + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#getDatatype() + */ + public Locator getDatatype() { + return _datatype; + } + + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#getValue() + */ + public String getValue() { + return _value; + } + + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#decimalValue() + */ public BigDecimal decimalValue() { return new BigDecimal(_value); } + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#integerValue() + */ public BigInteger integerValue() { return new BigInteger(_value); } + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#floatValue() + */ public float floatValue() { return Float.valueOf(_value); } + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#intValue() + */ public int intValue() { return Integer.valueOf(_value); } + /* (non-Javadoc) + * @see org.tinytim.internal.api.ILiteral#longValue() + */ public long longValue() { return Long.valueOf(_value); } Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/LiteralNormalizer.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/LiteralNormalizer.java 2008-11-19 13:45:23 UTC (rev 209) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/LiteralNormalizer.java 2008-11-19 13:47:44 UTC (rev 210) @@ -66,9 +66,9 @@ public static String normalizeInteger(final String value) { final String val = value.trim(); - int len = value.length(); + int len = val.length(); if (len == 0) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Illegal integer value: " + value); } int idx = 0; boolean negative = false; @@ -93,7 +93,7 @@ // Check if everything is a digit for (int i = 0; i < len; i++) { if (!Character.isDigit(normalized.charAt(i))) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Illegal integer value: " + value); } } return negative && normalized.charAt(0) != 0 ? '-' + normalized : normalized; @@ -101,9 +101,9 @@ public static String normalizeDecimal(final String value) { final String val = value.trim(); - int len = value.length(); + int len = val.length(); if (len == 0) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Illegal decimal value: " + value); } int idx = 0; boolean negative = false; @@ -142,11 +142,13 @@ while (len >= idx && val.charAt(len) == '0') { len--; } - if (len == idx || len < idx) { + if (len <= idx) { normalized.append('0'); } else { - while (idx < len) { + // idx points to the '.', increment it + idx++; + while (idx <= len) { char c = val.charAt(idx); if (!Character.isDigit(c)) { throw new IllegalArgumentException("Illegal decimal value: " + value); Modified: tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteralNormalizer.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteralNormalizer.java 2008-11-19 13:45:23 UTC (rev 209) +++ tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteralNormalizer.java 2008-11-19 13:47:44 UTC (rev 210) @@ -46,6 +46,7 @@ assertEquals("1", LiteralNormalizer.normalizeInteger("00001")); assertEquals("-1", LiteralNormalizer.normalizeInteger("-1")); assertEquals("-1", LiteralNormalizer.normalizeInteger("-00001")); + assertEquals("-1", LiteralNormalizer.normalizeInteger(" -00001 ")); try { LiteralNormalizer.normalizeInteger("invalid"); fail("Expected an IllegalArgumentException"); @@ -57,6 +58,7 @@ public void testNormalizeDecimal() { assertEquals("0.0", LiteralNormalizer.normalizeDecimal("0")); + assertEquals("0.0", LiteralNormalizer.normalizeDecimal(" 0 ")); assertEquals("0.0", LiteralNormalizer.normalizeDecimal("-0")); assertEquals("0.0", LiteralNormalizer.normalizeDecimal("-0.0")); assertEquals("0.0", LiteralNormalizer.normalizeDecimal("+0.0")); @@ -65,6 +67,9 @@ assertEquals("10.0", LiteralNormalizer.normalizeDecimal("10")); assertEquals("-10.0", LiteralNormalizer.normalizeDecimal("-10.00")); assertEquals("10.0", LiteralNormalizer.normalizeDecimal("+10.00")); + assertEquals("9.3", LiteralNormalizer.normalizeDecimal("+9.3")); + assertEquals("9.3", LiteralNormalizer.normalizeDecimal("9.3")); + assertEquals("-9.3", LiteralNormalizer.normalizeDecimal("-9.3")); try { LiteralNormalizer.normalizeDecimal("invalid"); fail("Expected an IllegalArgumentException"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 13:45:25
|
Revision: 209 http://tinytim.svn.sourceforge.net/tinytim/?rev=209&view=rev Author: lheuer Date: 2008-11-19 13:45:23 +0000 (Wed, 19 Nov 2008) Log Message: ----------- More tests for TinyTimMapInputHandler Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2008-11-19 13:39:10 UTC (rev 208) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2008-11-19 13:45:23 UTC (rev 209) @@ -435,8 +435,8 @@ private IConstruct _leaveStatePopConstruct(int state) throws MIOException { _leaveState(state); final IConstruct construct = _peekConstruct(); - _constructStack[_constructSize-1] = null; _constructSize--; + _constructStack[_constructSize] = null; return construct; } Modified: tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java =================================================================== --- tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2008-11-19 13:39:10 UTC (rev 208) +++ tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2008-11-19 13:45:23 UTC (rev 209) @@ -316,4 +316,25 @@ } } + /** + * Tests nested startTopic/endTopic events. + */ + public void testNestedTopics() throws Exception { + String base = "http://tinytim.sourceforge.net/test-nesting#"; + final int MAX = 10000; + String[] iids = new String[MAX]; + _handler.startTopicMap(); + for (int i=0; i<MAX; i++) { + iids[i] = base + i; + _handler.startTopic(Ref.createItemIdentifier(iids[i])); + } + for (int i=0; i<MAX; i++) { + _handler.endTopic(); + } + _handler.endTopicMap(); + for (String iid: iids) { + assertNotNull(_tm.getConstructByItemIdentifier(createLocator(iid))); + } + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-19 13:39:13
|
Revision: 208 http://tinytim.svn.sourceforge.net/tinytim/?rev=208&view=rev Author: lheuer Date: 2008-11-19 13:39:10 +0000 (Wed, 19 Nov 2008) Log Message: ----------- - Added CTM lib to read docs which reflect the current working draft (semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar) - Updated the other mio libs (mainly a META-INF issue) Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3.jar Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar Modified: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3working-draft-2008-11-19.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 17:02:23
|
Revision: 207 http://tinytim.svn.sourceforge.net/tinytim/?rev=207&view=rev Author: lheuer Date: 2008-11-18 17:02:17 +0000 (Tue, 18 Nov 2008) Log Message: ----------- MIO CTM, Snello, and LTM added Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar Added: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 16:50:04
|
Revision: 206 http://tinytim.svn.sourceforge.net/tinytim/?rev=206&view=rev Author: lheuer Date: 2008-11-18 16:50:00 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Removed debugging info from DeserializerRegistry Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar Modified: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 16:37:37
|
Revision: 205 http://tinytim.svn.sourceforge.net/tinytim/?rev=205&view=rev Author: lheuer Date: 2008-11-18 16:37:28 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Added MIO TM/XML Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar Added: tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-tmxml-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 16:05:29
|
Revision: 204 http://tinytim.svn.sourceforge.net/tinytim/?rev=204&view=rev Author: lheuer Date: 2008-11-18 16:05:24 +0000 (Tue, 18 Nov 2008) Log Message: ----------- - Updated build script - Removed BTM support from TopicMapImporter temporarily Modified Paths: -------------- tinytim-mio/trunk/build.properties tinytim-mio/trunk/build.xml tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java Modified: tinytim-mio/trunk/build.properties =================================================================== --- tinytim-mio/trunk/build.properties 2008-11-18 15:40:54 UTC (rev 203) +++ tinytim-mio/trunk/build.properties 2008-11-18 16:05:24 UTC (rev 204) @@ -1,4 +1,5 @@ version=2.0.0 -version_suffix=a1-snapshot +version_suffix=a3 +#release_type= debug=off optimize=on Modified: tinytim-mio/trunk/build.xml =================================================================== --- tinytim-mio/trunk/build.xml 2008-11-18 15:40:54 UTC (rev 203) +++ tinytim-mio/trunk/build.xml 2008-11-18 16:05:24 UTC (rev 204) @@ -1,16 +1,18 @@ <?xml version="1.0" encoding="utf-8"?> <project name="tinyTiM" default="jar" basedir="."> <property file="build.properties"/> + <tstamp/> + <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> <property name="dir.src" value="${basedir}/src/main/java"/> <property name="dir.test" value="${basedir}/src/test/java"/> <property name="dir.lib" value="${basedir}/lib"/> - <property name="lib.junit" value="${dir.lib}/junit-4.4.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-1_0SP1.jar"/> - <property name="lib.tinytim" value="${dir.lib}/tinytim-1.5.0beta.jar"/> + <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a1.jar"/> + <property name="lib.tinytim" value="${dir.lib}/tinytim-2.0.0a3.jar"/> <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.2.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.2.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> <target name="help"> <echo message="------------------------"/> @@ -25,7 +27,7 @@ </target> <target name="init"> - <property name="dist.version" value="${version}${version_suffix}"/> + <property name="dist.version" value="${version}${version_suffix}${release_type}"/> <property name="dist.name" value="tinytim-mio-${dist.version}"/> <property name="tinytim-mio.jar" value="${dist.name}.jar"/> Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java 2008-11-18 15:40:54 UTC (rev 203) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java 2008-11-18 16:05:24 UTC (rev 204) @@ -191,9 +191,6 @@ else if (Syntax.SNELLO.equals(syntax)) { tmReader = new SnelloTopicMapReader(topicMap, input); } - else if (Syntax.BTM.equals(syntax)) { - tmReader = new BTMTopicMapReader(topicMap, input); - } if (tmReader == null) { throw new IOException("Unknown syntax " + syntax.getName()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 15:40:59
|
Revision: 203 http://tinytim.svn.sourceforge.net/tinytim/?rev=203&view=rev Author: lheuer Date: 2008-11-18 15:40:54 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Added MIO core and MIO XTM (1.0/2.0) Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3.jar Added: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 14:27:53
|
Revision: 202 http://tinytim.svn.sourceforge.net/tinytim/?rev=202&view=rev Author: lheuer Date: 2008-11-18 14:27:48 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Added all XS Dataypes Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/voc/XSD.java Modified: tinytim/trunk/src/main/java/org/tinytim/voc/XSD.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/voc/XSD.java 2008-11-18 14:19:34 UTC (rev 201) +++ tinytim/trunk/src/main/java/org/tinytim/voc/XSD.java 2008-11-18 14:27:48 UTC (rev 202) @@ -21,30 +21,335 @@ * Provides PSIs for the XML Schema Datatypes. * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ + * @version $Rev:$ - $Date:$ */ public final class XSD extends Vocabulary { private XSD() { // noop. } - + private static final String _BASE = Namespace.XSD; - - public final static Locator STRING = _createLocator(_BASE + "string"); - public final static Locator ANY_URI = _createLocator(_BASE + "anyURI"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#anyType">xsd:anyType</a> + * datatype. + */ + public static final Locator ANY_TYPE = _createLocator(_BASE+"anyType"); - public final static Locator DECIMAL = _createLocator(_BASE + "decimal"); - - public final static Locator INTEGER = _createLocator(_BASE + "integer"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#anySimpleType">xsd:anySimpleType</a> + * datatype. + */ + public static final Locator ANY_SIMPLE_TYPE = _createLocator(_BASE+"anySimpleType"); - public final static Locator INT = _createLocator(_BASE + "int"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#duration">xsd:duration</a> + * datatype. + */ + public static final Locator DURATION = _createLocator(_BASE+"duration"); - public final static Locator FLOAT = _createLocator(_BASE + "float"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#dateTime">xsd:dateTime</a> + * datatype. + */ + public static final Locator DATE_TIME = _createLocator(_BASE+"dateTime"); - public final static Locator LONG = _createLocator(_BASE + "long"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#time">xsd:time</a> + * datatype. + */ + public static final Locator TIME = _createLocator(_BASE+"time"); - public static final Locator BOOLEAN = _createLocator(_BASE + "boolean"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#date">xsd:date</a> + * datatype. + */ + public static final Locator DATE = _createLocator(_BASE+"date"); + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#gYearMonth">xsd:gYearMonth</a> + * datatype. + */ + public static final Locator G_YEAR_MONTH = _createLocator(_BASE+"gYearMonth"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#gYear">xsd:gYear</a> + * datatype. + */ + public static final Locator G_YEAR = _createLocator(_BASE+"gYear"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#gMonthDay">xsd:gMonthDay</a> + * datatype. + */ + public static final Locator G_MONTH_DAY = _createLocator(_BASE+"gMonthDay"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#gDay">xsd:gDay</a> + * datatype. + */ + public static final Locator G_DAY = _createLocator(_BASE+"gDay"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#gMonth">xsd:gMonth</a> + * datatype. + */ + public static final Locator G_MONTH = _createLocator(_BASE+"gMonth"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#boolean">xsd:boolean</a> + * datatype. + */ + public static final Locator BOOLEAN = _createLocator(_BASE+"boolean"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#base64Binary">xsd:base64Binary</a> + * datatype. + */ + public static final Locator BASE64_BINARY = _createLocator(_BASE+"base64Binary"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#hexBinary">xsd:hexBinary</a> + * datatype. + */ + public static final Locator HEX_BINARY = _createLocator(_BASE+"hexBinary"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#float">xsd:float</a> + * datatype. + */ + public static final Locator FLOAT = _createLocator(_BASE+"float"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#double">xsd:double</a> + * datatype. + */ + public static final Locator DOUBLE = _createLocator(_BASE+"double"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#anyURI">xsd:anyURI</a> + * datatype. + */ + public static final Locator ANY_URI = _createLocator(_BASE+"anyURI"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#QName">xsd:QName</a> + * datatype. + */ + public static final Locator QNAME = _createLocator(_BASE+"QName"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#NOTATION">xsd:NOTATION</a> + * datatype. + */ + public static final Locator NOTATION = _createLocator(_BASE+"notation"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#string">xsd:string</a> + * datatype. + */ + public static final Locator STRING = _createLocator(_BASE+"string"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#decimal">xsd:decimal</a> + * datatype. + */ + public static final Locator DECIMAL = _createLocator(_BASE+"decimal"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#normalizedString">xsd:normalizedString</a> + * datatype. + */ + public static final Locator NORMALIZED_STRING = _createLocator(_BASE+"normalizedString"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#integer">xsd:integer</a> + * datatype. + */ + public static final Locator INTEGER = _createLocator(_BASE+"integer"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#token">xsd:token</a> + * datatype. + */ + public static final Locator TOKEN = _createLocator(_BASE+"token"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#nonPositiveInteger">xsd:nonPositiveInteger</a> + * datatype. + */ + public static final Locator NON_POSITIVE_INTEGER = _createLocator(_BASE+"nonPositiveInteger"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#long">xsd:long</a> + * datatype. + */ + public static final Locator LONG = _createLocator(_BASE+"long"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">xsd:nonNegativeInteger</a> + * datatype. + */ + public static final Locator NON_NEGATIVE_INTEGER = _createLocator(_BASE+"nonNegativeInteger"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#language">xsd:language</a> + * datatype. + */ + public static final Locator LANGUAGE = _createLocator(_BASE+"language"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#Name">xsd:Name</a> + * datatype. + */ + public static final Locator NAME = _createLocator(_BASE+"Name"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#NMTOKEN">xsd:NMTOKEN</a> + * datatype. + */ + public static final Locator NMTOKEN = _createLocator(_BASE+"NMTOKEN"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#negativeInteger">xsd:negativeInteger</a> + * datatype. + */ + public static final Locator NEGATIVE_INTEGER = _createLocator(_BASE+"negativeInteger"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#int">xsd:int</a> + * datatype. + */ + public static final Locator INT = _createLocator(_BASE+"int"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#unsignedLong">xsd:unsignedLong</a> + * datatype. + */ + public static final Locator UNSIGNED_LONG = _createLocator(_BASE+"unsignedLong"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#positiveInteger">xsd:positiveInteger</a> + * datatype. + */ + public static final Locator POSITIVE_INTEGER = _createLocator(_BASE+"positiveInteger"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#NCName">xsd:NCName</a> + * datatype. + */ + public static final Locator NCNAME = _createLocator(_BASE+"NCName"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#NMTOKEN">xsd:NMTOKEN</a> + * datatype. + */ + public static final Locator NMTOKENS = _createLocator(_BASE+"NMTOKEN"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#short">xsd:short</a> + * datatype. + */ + public static final Locator SHORT = _createLocator(_BASE+"short"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#unsignedInt">xsd:unsignedInt</a> + * datatype. + */ + public static final Locator UNSIGNED_INT = _createLocator(_BASE+"unsignedInt"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#ID">xsd:ID</a> + * datatype. + */ + public static final Locator ID = _createLocator(_BASE+"ID"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#IDREF">xsd:IDREF</a> + * datatype. + */ + public static final Locator IDREF = _createLocator(_BASE+"IDREF"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#ENTITY">xsd:ENTITY</a> + * datatype. + */ + public static final Locator ENTITY = _createLocator(_BASE+"ENTITY"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#String">xsd:byte</a> + * datatype. + */ + public static final Locator BYTE = _createLocator(_BASE+"byte"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#unsignedShort">xsd:unsignedShort</a> + * datatype. + */ + public static final Locator UNSIGNED_SHORT = _createLocator(_BASE+"unsignedShort"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#IDREFS">xsd:IDREFS</a> + * datatype. + */ + public static final Locator IDREFS = _createLocator(_BASE+"IDREFS"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#ENTITIES">xsd:ENTITIES</a> + * datatype. + */ + public static final Locator ENTITIES = _createLocator(_BASE+"ENTITIES"); + + /** + * IRI for the + * <a href="http://www.w3.org/2001/XMLSchema#unsignedByte">xsd:unsignedByte</a> + * datatype. + */ + public static final Locator UNSIGNED_BYTE = _createLocator(_BASE+"unsignedByte"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 14:19:37
|
Revision: 201 http://tinytim.svn.sourceforge.net/tinytim/?rev=201&view=rev Author: lheuer Date: 2008-11-18 14:19:34 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Removed System.out.println :/ Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java 2008-11-18 14:07:47 UTC (rev 200) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java 2008-11-18 14:19:34 UTC (rev 201) @@ -56,7 +56,6 @@ continue; } id = reference.substring(fragIdx+1); - System.out.println("Id: " + id); if (id.startsWith("id-")) { id = null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-18 14:08:00
|
Revision: 200 http://tinytim.svn.sourceforge.net/tinytim/?rev=200&view=rev Author: lheuer Date: 2008-11-18 14:07:47 +0000 (Tue, 18 Nov 2008) Log Message: ----------- - CXTMTopicMapWriter: Datatype locators are not normalized anymore (not yet in the draft dtd. 2008-05-15) - XTM20TopicMapWriter: iids are taken into account - AbstractTopicMapReader: Did wrongly checked if field _deserializer is null and not against the argument "deserializer") - TinyTimMapInputHandler: * Tried to set an element outside the array to null. Fixed * Using construct.equals(other) instead of construct == other (since that may only work for the memory impl of tinyTiM) Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java 2008-11-18 14:07:47 UTC (rev 200) @@ -71,7 +71,7 @@ protected AbstractTopicMapReader(final TopicMap topicMap, final Syntax syntax, final File source, final String docIRI) throws IOException { - this(topicMap, syntax, new Source(new FileInputStream(source), docIRI)); + this(topicMap, syntax, new FileInputStream(source), docIRI); } /** @@ -82,8 +82,8 @@ * @param source * @param docIRI */ - protected AbstractTopicMapReader(TopicMap topicMap, Syntax syntax, - InputStream source, String docIRI) { + protected AbstractTopicMapReader(final TopicMap topicMap, final Syntax syntax, + final InputStream source, final String docIRI) { this(topicMap, syntax, new Source(source, docIRI)); } @@ -108,14 +108,15 @@ */ protected AbstractTopicMapReader(final IMapHandler handler, final Syntax syntax, final Source source) { - this(handler, DeserializerRegistry.createDeserializer(syntax), source); + this(handler, DeserializerRegistry.createDeserializer(syntax), source, syntax); } protected AbstractTopicMapReader(final IMapHandler handler, - final IDeserializer deserializer, final Source source) { - if (_deserializer == null) { - throw new IllegalArgumentException("Deserializer not found"); + final IDeserializer deserializer, final Source source, final Syntax syntax) { + if (deserializer == null) { + throw new IllegalArgumentException("Deserializer for " + syntax.getName() + " not found"); } + _deserializer = deserializer; _deserializer.setProperty(Property.VALIDATE, Boolean.FALSE); _deserializer.setMapHandler(handler); _source = source; Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapWriter.java 2008-11-18 14:07:47 UTC (rev 200) @@ -56,7 +56,8 @@ continue; } id = reference.substring(fragIdx+1); - if (id.startsWith("id")) { + System.out.println("Id: " + id); + if (id.startsWith("id-")) { id = null; } if (id != null) { Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java 2008-11-18 14:07:47 UTC (rev 200) @@ -33,7 +33,7 @@ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ */ -abstract class AbstractXTMTopicMapReader extends AbstractTopicMapReader { +public abstract class AbstractXTMTopicMapReader extends AbstractTopicMapReader { public AbstractXTMTopicMapReader(TopicMap topicMap, Syntax syntax, File source) throws IOException { Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2008-11-18 14:07:47 UTC (rev 200) @@ -448,7 +448,7 @@ _out.endElement("value"); _out.newline(); _out.startElement("datatype"); - _out.characters(_normalizeLocator(obj.getDatatype())); + _out.characters(obj.getDatatype().getReference()); _out.endElement("datatype"); _out.newline(); } @@ -652,7 +652,7 @@ normLoc = normLoc.substring(slashPos); } } - if (normLoc.startsWith("/")) { + if (normLoc.charAt(0) == '/') { normLoc = normLoc.substring(1); } _locator2Norm.put(locator, normLoc); Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2008-11-18 14:07:47 UTC (rev 200) @@ -435,7 +435,7 @@ private IConstruct _leaveStatePopConstruct(int state) throws MIOException { _leaveState(state); final IConstruct construct = _peekConstruct(); - _constructStack[_constructSize] = null; + _constructStack[_constructSize-1] = null; _constructSize--; return construct; } @@ -494,7 +494,7 @@ */ private void _merge(Topic source, ITopic target) { for (int i=0; i <_constructSize; i++) { - if (_constructStack[i] == source) { + if (_constructStack[i].equals(source)) { _constructStack[i] = target; } } Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapWriter.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapWriter.java 2008-11-18 14:07:47 UTC (rev 200) @@ -138,7 +138,6 @@ protected void _writeAssociation(final Association assoc) throws IOException { Set<Role> roles = assoc.getRoles(); if (roles.isEmpty()) { - LOG.info("Omitting association id " + assoc.getId() + " since it has no roles"); return; } _attrs.clear(); Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapWriter.java 2008-11-15 13:17:29 UTC (rev 199) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapWriter.java 2008-11-18 14:07:47 UTC (rev 200) @@ -18,7 +18,6 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Set; -import java.util.logging.Logger; import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.IScoped; @@ -53,8 +52,6 @@ */ public class XTM20TopicMapWriter extends AbstractXTMWriter { - private static final Logger LOG = Logger.getLogger(XTM20TopicMapWriter.class.getName()); - private Topic _defaultNameType; /** @@ -108,11 +105,12 @@ protected void _writeTopic(final Topic topic) throws IOException { // Ignore the topic if it is the default name type and it has no further - // characteristics (iids do not count) + // characteristics if (_isDefaultNameType(topic) && topic.getReified() == null && topic.getSubjectIdentifiers().size() == 1 && topic.getSubjectLocators().isEmpty() + && topic.getItemIdentifiers().isEmpty() && topic.getRolesPlayed().isEmpty() && topic.getTypes().isEmpty() && topic.getNames().isEmpty() @@ -142,7 +140,6 @@ protected void _writeAssociation(final Association assoc) throws IOException { Set<Role> roles = assoc.getRoles(); if (roles.isEmpty()) { - LOG.info("Omitting association id " + assoc.getId() + " since it has no roles"); return; } _out.startElement("association", _reifier(assoc)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-15 13:17:33
|
Revision: 199 http://tinytim.svn.sourceforge.net/tinytim/?rev=199&view=rev Author: lheuer Date: 2008-11-15 13:17:29 +0000 (Sat, 15 Nov 2008) Log Message: ----------- Updated tinyTiM to 2.0.0a3 Added Paths: ----------- tinytim-mio/trunk/lib/tinytim-2.0.0a3-tests.jar tinytim-mio/trunk/lib/tinytim-2.0.0a3.jar Removed Paths: ------------- tinytim-mio/trunk/lib/tinytim-2.0.0a2-tests.jar tinytim-mio/trunk/lib/tinytim-2.0.0a2.jar Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a2-tests.jar =================================================================== (Binary files differ) Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a2.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/tinytim-2.0.0a3-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a3-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim-mio/trunk/lib/tinytim-2.0.0a3.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-15 13:09:11
|
Revision: 198 http://tinytim.svn.sourceforge.net/tinytim/?rev=198&view=rev Author: lheuer Date: 2008-11-15 13:09:09 +0000 (Sat, 15 Nov 2008) Log Message: ----------- - Better naming scheme: * <Syntax>Reader -> <Syntax>TopicMapReader * <Syntax>Writer -> <Syntax>TopicMapWriter - XTM20TopicMapWriter ignores the tmdm:topic-name iff it consists just of the subject identifier Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLWriter.java Added Paths: ----------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/SnelloTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/TMXMLTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10TopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20TopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTMTopicMapReader.java Removed Paths: ------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/SnelloReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/TMXMLReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10Reader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM10Writer.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20Reader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTM20Writer.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XTMReader.java Deleted: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMReader.java 2008-11-15 13:02:58 UTC (rev 197) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMReader.java 2008-11-15 13:09:09 UTC (rev 198) @@ -1,90 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed 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 org.tinytim.mio; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -import org.tmapi.core.TopicMap; - -import com.semagia.mio.Source; -import com.semagia.mio.Syntax; - -/** - * {@link TopicMapReader} implementation that is able to deserialize - * <a href="http://www.isotopicmaps.org/ctm/">Compact Topic Maps (CTM) 1.0</a>. - * <p> - * Note that this reader implements the CTM draft dtd. 2008-05-15. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public final class CTMReader extends AbstractTopicMapReader { - - /** - * Constructs a new instance. - * - * @param topicMap The topic map to which the content is added to. - * @param source The source to read the topic map from. - * @param docIRI The document IRI which is used to resolve IRIs against. - * @throws IOException If an error occurs. - */ - public CTMReader(final TopicMap topicMap, final File source, - final String docIRI) throws IOException { - super(topicMap, Syntax.CTM, source, docIRI); - } - - /** - * Constructs a new instance. - * <p> - * The <tt>source</tt> is converted into an absolute IRI which will be - * utilised as document IRI - * </p> - * - * @param topicMap The topic map to which the content is added to. - * @param source The source to read the topic map from. - * @throws IOException If an error occurs. - */ - public CTMReader(final TopicMap topicMap, final File source) - throws IOException { - super(topicMap, Syntax.CTM, source); - } - - /** - * Constructs a new instance. - * - * @param topicMap The topic map to which the content is added to. - * @param source The source to read the topic map from. - * @param docIRI The document IRI which is used to resolve IRIs against. - */ - public CTMReader(final TopicMap topicMap, final InputStream source, - final String docIRI) { - super(topicMap, Syntax.CTM, source, docIRI); - } - - /** - * Constructs a new instance. - * - * @param topicMap The topic map to which the content is added to. - * @param source The source to read the serialized topic map from. - */ - public CTMReader(final TopicMap topicMap, final Source source) { - super(topicMap, Syntax.CTM, source); - } - -} Added: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapReader.java (rev 0) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapReader.java 2008-11-15 13:09:09 UTC (rev 198) @@ -0,0 +1,90 @@ +/* + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) + * + * Licensed 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 org.tinytim.mio; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; + +import org.tmapi.core.TopicMap; + +import com.semagia.mio.Source; +import com.semagia.mio.Syntax; + +/** + * {@link TopicMapReader} implementation that is able to deserialize + * <a href="http://www.isotopicmaps.org/ctm/">Compact Topic Maps (CTM) 1.0</a>. + * <p> + * Note that this reader implements the CTM draft dtd. 2008-05-15. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev$ - $Date$ + */ +public final class CTMTopicMapReader extends AbstractTopicMapReader { + + /** + * Constructs a new instance. + * + * @param topicMap The topic map to which the content is added to. + * @param source The source to read the topic map from. + * @param docIRI The document IRI which is used to resolve IRIs against. + * @throws IOException If an error occurs. + */ + public CTMTopicMapReader(final TopicMap topicMap, final File source, + final String docIRI) throws IOException { + super(topicMap, Syntax.CTM, source, docIRI); + } + + /** + * Constructs a new instance. + * <p> + * The <tt>source</tt> is converted into an absolute IRI which will be + * utilised as document IRI + * </p> + * + * @param topicMap The topic map to which the content is added to. + * @param source The source to read the topic map from. + * @throws IOException If an error occurs. + */ + public CTMTopicMapReader(final TopicMap topicMap, final File source) + throws IOException { + super(topicMap, Syntax.CTM, source); + } + + /** + * Constructs a new instance. + * + * @param topicMap The topic map to which the content is added to. + * @param source The source to read the topic map from. + * @param docIRI The document IRI which is used to resolve IRIs against. + */ + public CTMTopicMapReader(final TopicMap topicMap, final InputStream source, + final String docIRI) { + super(topicMap, Syntax.CTM, source, docIRI); + } + + /** + * Constructs a new instance. + * + * @param topicMap The topic map to which the content is added to. + * @param source The source to read the serialized topic map from. + */ + public CTMTopicMapReader(final TopicMap topicMap, final Source source) { + super(topicMap, Syntax.CTM, source); + } + +} Property changes on: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapReader.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java (rev 0) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2008-11-15 13:09:09 UTC (rev 198) @@ -0,0 +1,1230 @@ +/* + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) + * + * Licensed 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 org.tinytim.mio; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.AbstractSet; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.logging.Logger; + +import org.tinytim.internal.utils.CollectionFactory; +import org.tinytim.utils.DuplicateRemovalUtils; +import org.tinytim.voc.TMDM; +import org.tinytim.voc.XSD; +import org.tmapi.core.Association; +import org.tmapi.core.Construct; +import org.tmapi.core.DatatypeAware; +import org.tmapi.core.Locator; +import org.tmapi.core.Name; +import org.tmapi.core.Occurrence; +import org.tmapi.core.Reifiable; +import org.tmapi.core.Role; +import org.tmapi.core.Scoped; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicInUseException; +import org.tmapi.core.TopicMap; +import org.tmapi.core.Typed; +import org.tmapi.core.Variant; +import org.tmapi.index.TypeInstanceIndex; + +import org.xml.sax.Attributes; +import org.xml.sax.helpers.AttributesImpl; + +/** + * Provides serialization of topic maps into Canonical XTM (CXTM). + * <p> + * CXTM is a format that guarantees that two equivalent Topic Maps Data Model + * instances [ISO/IEC 13250-2] will always produce byte-by-byte identical + * serializations, and that non-equivalent instances will always produce + * different serializations. + * </p> + * <p> + * See <a href="http://www.isotopicmaps.org/cxtm/">http://www.isotopicmaps.org/cxtm/</a> + * for details. + * </p> + * <p> + * <em>CAUTION</em>: This class implements the + * <a href="http://www.isotopicmaps.org/cxtm/">CXTM draft dtd. 2008-05-15</a>, + * the output may change in the future. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev$ - $Date$ + */ +public final class CXTMTopicMapWriter implements TopicMapWriter { + + private static final Logger LOG = Logger.getLogger(CXTMTopicMapWriter.class.getName()); + + private static final Role[] _EMPTY_ROLES = new Role[0]; + + private final AttributesImpl _attrs; + + private Topic _type; + private Topic _instance; + private Topic _typeInstance; + + private final XMLC14NWriter _out; + private final String _normBase; + private final Map<Construct, Integer> _construct2Id; + private final Map<Topic, List<Role>> _topic2Roles; + private final Map<Locator, String> _locator2Norm; + private final Map<Association, Role[]> _assoc2Roles; + + private final Comparator<Topic> _topicComparator; + private final Comparator<Association> _assocComparator; + private final Comparator<Role> _roleComparator; + private final Comparator<Occurrence> _occComparator; + private final Comparator<Name> _nameComparator; + private final Comparator<Variant> _variantComparator; + private final Comparator<Set<Locator>> _locSetComparator; + private final Comparator<Locator> _locComparator; + private final Comparator<Set<Topic>> _scopeComparator; + + /** + * Creates a canonicalizer. + * + * @param out The stream the CXTM is written onto. + * @param baseLocator The base locator which is used to resolve IRIs against. + * @throws IOException If an error occurs. + */ + public CXTMTopicMapWriter(OutputStream out, String baseLocator) throws IOException { + if (baseLocator == null) { + throw new IllegalArgumentException("The base locator must not be null"); + } + _out = new XMLC14NWriter(out); + _attrs = new AttributesImpl(); + _normBase = _normalizeBaseLocator(baseLocator); + _construct2Id = CollectionFactory.createIdentityMap(); + _locator2Norm = CollectionFactory.createIdentityMap(); + _assoc2Roles = CollectionFactory.createIdentityMap(); + _topic2Roles = CollectionFactory.createIdentityMap(); + _topicComparator = new TopicComparator(); + _assocComparator = new AssociationComparator(); + _roleComparator = new RoleComparator(); + _occComparator = new OccurrenceComparator(); + _nameComparator = new NameComparator(); + _variantComparator = new VariantComparator(); + _locSetComparator = new LocatorSetComparator(); + _locComparator = new LocatorComparator(); + _scopeComparator = new ScopeComparator(); + } + + /** + * Serializes the specified <tt>topicMap</tt> into the CXTM format. + * <p> + * <em>CAUTION</em>: This method MAY modify the topic map since duplicate + * Topic Maps constructs (if any) are removed in advance. + * </p> + * + * @param topicMap The topic map to serialize. + * @throws IOException If an error occurs. + */ + public void write(TopicMap topicMap) throws IOException { + DuplicateRemovalUtils.removeDuplicates(topicMap); + TypeInstanceIndex typeInstanceIndex = topicMap.getIndex(TypeInstanceIndex.class); + if (!typeInstanceIndex.isAutoUpdated()) { + typeInstanceIndex.reindex(); + } + Topic[] topics = _fetchTopics(topicMap, typeInstanceIndex); + Association[] assocs = _fetchAssociations(topicMap, typeInstanceIndex); + typeInstanceIndex.close(); + _createIndex(topics, assocs); + _out.startDocument(); + _attrs.clear(); + _addReifier(_attrs, topicMap); + _out.startElement("topicMap", _attrs); + _out.newline(); + _writeItemIdentifiers(topicMap); + for (Topic topic: topics) { + _writeTopic(topic); + } + for (Association assoc: assocs) { + _writeAssociation(assoc); + } + _out.endElement("topicMap"); + _out.newline(); + _out.endDocument(); + _attrs.clear(); + _construct2Id.clear(); + _topic2Roles.clear(); + _locator2Norm.clear(); + _assoc2Roles.clear(); + } + + /** + * Returns an unsorted array of topics which should be included into + * the output. + * <p> + * This method may return more topics than {@link TopicMap#getTopics()} + * since this method creates virtual topics to model type-instance + * relationships properly. + * </p> + * + * @param topicMap The topic map from which the topic should be serialized. + * @param idx A (upto date) type instance index. + * @return All topics which must be included into the output. + */ + private Topic[] _fetchTopics(final TopicMap topicMap, final TypeInstanceIndex idx) { + Collection<Topic> types = idx.getTopicTypes(); + if (types.isEmpty()) { + Set<Topic> topics = topicMap.getTopics(); + return topics.toArray(new Topic[topics.size()]); + } + else { + List<Topic> topics = CollectionFactory.createList(topicMap.getTopics()); + _typeInstance = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.TYPE_INSTANCE); + _type = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.TYPE); + _instance = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.INSTANCE); + return topics.toArray(new Topic[topics.size()]); + } + } + + /** + * Returns a topic by its subject identifier. If the topic is null, a + * {@link TypeInstanceTopic} is created, added to the <tt>topics</tt> + * and returned. + * + * @param tm The topic map to fetch the topic from. + * @param topics A modifiable collection of topics. + * @param sid The subject identifier. + * @return A topic with the specified subject identifier. + */ + private Topic _getTopicBySubjectIdentifier(TopicMap tm, Collection<Topic> topics, Locator sid) { + Topic topic = tm.getTopicBySubjectIdentifier(sid); + if (topic == null) { + topic = new TypeInstanceTopic(sid); + topics.add(topic); + } + return topic; + } + + /** + * Returns an unsorted array of associations which should be serialized. + * + * This method may return more association than {@link TopicMap#getAssociations()} + * since this method may create virtual associations which are used to + * model type-instance relationships properly. + * + * @param tm The topic map from which the associations should be serialized. + * @param idx A (upto date) type instance index. + * @return An unsorted array of associations which must be included into the output. + */ + private Association[] _fetchAssociations(final TopicMap tm, final TypeInstanceIndex idx) { + Collection<Topic> types = idx.getTopicTypes(); + if (types.isEmpty()) { + Set<Association> assocs = tm.getAssociations(); + return assocs.toArray(new Association[assocs.size()]); + } + else { + List<Association> assocs = CollectionFactory.createList(tm.getAssociations()); + for (Topic type: types) { + for (Topic instance: idx.getTopics(type)) { + assocs.add(new TypeInstanceAssociation(type, instance)); + } + } + return assocs.toArray(new Association[assocs.size()]); + } + } + + /** + * Creates the index on which the canonicalizer operates. + * + * As sideeffect, the provided topic and association arrays get sorted. + * + * @param topics An array of topics. + * @param assocs An array of associations. + */ + private void _createIndex(Topic[] topics, Association[] assocs) { + Arrays.sort(topics, _topicComparator); + Topic topic = null; + for (int i=0; i < topics.length; i++) { + topic = topics[i]; + _construct2Id.put(topic, Integer.valueOf(i+1)); + } + Arrays.sort(assocs, _assocComparator); + Association assoc = null; + for (int i=0; i < assocs.length; i++) { + assoc = assocs[i]; + _construct2Id.put(assoc, Integer.valueOf(i+1)); + Set<Role> roles_ = assoc.getRoles(); + Role[] roles = roles_.toArray(new Role[roles_.size()]); + Arrays.sort(roles, _roleComparator); + _assoc2Roles.put(assoc, roles); + for (int j=0; j < roles.length; j++) { + _construct2Id.put(roles[j], Integer.valueOf(j+1)); + } + } + } + + /** + * Returns a sorted array of roles of the provided association. + * + * @param assoc The association to retrieve the roles from. + * @return A (maybe empty) sorted array of roles. + */ + private Role[] _getRoles(final Association assoc) { + Role[] roles = _assoc2Roles.get(assoc); + return roles != null ? roles : _EMPTY_ROLES; + } + + /** + * Returns a sorted array of names of the provided topic. + * + * @param topic The topic to retrieve the names from. + * @return A (maybe empty) sorted array of names. + */ + private Name[] _getNames(final Topic topic) { + Set<Name> names_ = topic.getNames(); + Name[] names = names_.toArray(new Name[names_.size()]); + Arrays.sort(names, _nameComparator); + return names; + } + + /** + * Returs a sorted array of variants of the provided name. + * + * @param name The name to retrieve the variants from. + * @return A (maybe empty) sorted array of variants. + */ + private Variant[] _getVariants(final Name name) { + Set<Variant> variants_ = name.getVariants(); + Variant[] variants = variants_.toArray(new Variant[variants_.size()]); + Arrays.sort(variants, _variantComparator); + return variants; + } + + /** + * Returns a sorted array of occurrences of the provided topic. + * + * @param topic The topic to retrieve the occurrences from. + * @return A (maybe emtpy) sorted array of occurrences. + */ + private Occurrence[] _getOccurrences(final Topic topic) { + Set<Occurrence> occs_ = topic.getOccurrences(); + Occurrence[] occs = occs_.toArray(new Occurrence[occs_.size()]); + Arrays.sort(occs, _occComparator); + return occs; + } + + /** + * Returns the index of the provided Topic Maps construct. + * + * The "index" is <cite>"[...] the string encoding of the position of this + * information item in the canonically ordered list of the values from + * that set".</cite> (CXTM 3.20 Constructing the number attribute). + * + * @param tmo The Topic Maps construct to return the index of. + * @return The index of the Topic Maps construct. + */ + private int _indexOf(final Construct tmo) { + return _construct2Id.get(tmo).intValue(); + } + + /** + * Serializes the <tt>topic</tt>. + * + * @param topic The topic to serialize. + * @throws IOException If an error occurs. + */ + private void _writeTopic(final Topic topic) throws IOException { + _attrs.clear(); + _attrs.addAttribute("", "number", "", "CDATA", Integer.toString(_indexOf(topic))); + _out.startElement("topic", _attrs); + _out.newline(); + _writeLocatorSet("subjectIdentifiers", topic.getSubjectIdentifiers()); + _writeLocatorSet("subjectLocators", topic.getSubjectLocators()); + _writeItemIdentifiers(topic); + Name[] names = _getNames(topic); + for (int i=0; i < names.length; i++) { + _writeName(names[i], i+1); + } + Occurrence[] occs = _getOccurrences(topic); + for (int i=0; i < occs.length; i++) { + _writeOccurrence(occs[i], i+1); + } + List<Role> roles_ = CollectionFactory.createList(topic.getRolesPlayed()); + List<Role> alienRoles = _topic2Roles.get(topic); + if (alienRoles != null) { + roles_.addAll(alienRoles); + } + Role[] roles = roles_.toArray(new Role[roles_.size()]); + Arrays.sort(roles, _roleComparator); + StringBuilder sb = new StringBuilder(20); + for (int i=0; i < roles.length; i++) { + sb.append("association.") + .append(_indexOf(roles[i].getParent())) + .append(".role.") + .append(_indexOf(roles[i])); + _attrs.clear(); + _attrs.addAttribute("", "ref", "", "CDATA", sb.toString()); + _out.startElement("rolePlayed", _attrs); + _out.endElement("rolePlayed"); + _out.newline(); + sb.setLength(0); + } + _out.endElement("topic"); + _out.newline(); + } + + /** + * Serializes an association. + * + * @param assoc The association to serialize. + * @throws IOException If an error occurs. + */ + private void _writeAssociation(final Association assoc) throws IOException { + _out.startElement("association", _attributes(assoc, _indexOf(assoc))); + _out.newline(); + _writeType(assoc); + for (Role role: _getRoles(assoc)) { + _out.startElement("role", _attributes(role, _indexOf(role))); + _out.newline(); + _out.startElement("player", _topicRef(role.getPlayer())); + _out.endElement("player"); + _out.newline(); + _writeType(role); + _writeItemIdentifiers(role); + _out.endElement("role"); + _out.newline(); + } + _writeScope(assoc); + _writeItemIdentifiers(assoc); + _out.endElement("association"); + _out.newline(); + } + + /** + * Serializes an occurrence. + * + * @param occ The occurrence to serialize. + * @param pos The position of the occurrence within the parent container. + * @throws IOException If an error occurs. + */ + private void _writeOccurrence(final Occurrence occ, int pos) throws IOException { + _out.startElement("occurrence", _attributes(occ, pos)); + _out.newline(); + _writeDatatyped(occ); + _writeType(occ); + _writeScope(occ); + _writeItemIdentifiers(occ); + _out.endElement("occurrence"); + _out.newline(); + } + + /** + * Writes the value/datatype pair of an occurrence or variant. + * + * @param obj The construct to serialize. + * @throws IOException If an error occurs. + */ + private void _writeDatatyped(final DatatypeAware obj) throws IOException { + final String value = XSD.ANY_URI.equals(obj.getDatatype()) + ? _normalizeLocator(obj.locatorValue()) + : obj.getValue(); + _out.startElement("value"); + _out.characters(value); + _out.endElement("value"); + _out.newline(); + _out.startElement("datatype"); + _out.characters(_normalizeLocator(obj.getDatatype())); + _out.endElement("datatype"); + _out.newline(); + } + + /** + * Serializes a topic name. + * + * @param name The name to serialize. + * @param pos The position of the name within the parent container. + * @throws IOException If an error occurs. + */ + private void _writeName(final Name name, int pos) throws IOException { + _out.startElement("name", _attributes(name, pos)); + _out.newline(); + _out.startElement("value"); + _out.characters(name.getValue()); + _out.endElement("value"); + _out.newline(); + _writeType(name); + _writeScope(name); + Variant[] variants = _getVariants(name); + Variant variant = null; + for (int i=0; i<variants.length; i++) { + variant = variants[i]; + _out.startElement("variant", _attributes(variant, i+1)); + _out.newline(); + _writeDatatyped(variant); + _writeScope(variant); + _writeItemIdentifiers(variant); + _out.endElement("variant"); + _out.newline(); + } + _writeItemIdentifiers(name); + _out.endElement("name"); + _out.newline(); + } + + /** + * Serializes the type of a typed Topic Maps construct. + * + * @param typed The typed Topic Maps construct from which the type should be + * serialized. + * @throws IOException If an error occurs. + */ + private void _writeType(final Typed typed) throws IOException { + _out.startElement("type", _topicRef(typed.getType())); + _out.endElement("type"); + _out.newline(); + } + + /** + * Serializes the scope of a scoped Topic Maps construct. + * + * If the scope is unconstrained, this method does nothing. + * + * @param scoped The scoped Topic Maps construct. + * @throws IOException If an error occurs. + */ + private void _writeScope(final Scoped scoped) throws IOException { + Set<Topic> scope = scoped.getScope(); + if (scope.isEmpty()) { + return; + } + _out.startElement("scope"); + _out.newline(); + Topic[] themes = scope.toArray(new Topic[scope.size()]); + Arrays.sort(themes, _topicComparator); + for (int i=0; i < themes.length; i++) { + _out.startElement("scopingTopic", _topicRef(themes[i])); + _out.endElement("scopingTopic"); + _out.newline(); + } + _out.endElement("scope"); + _out.newline(); + } + + /** + * Serializes a locator. + * + * A normalized locator value is created which is serialized. + * + * @param loc The locator to serialize. + * @throws IOException If an error occurs. + */ + private void _writeLocator(final Locator loc) throws IOException { + _out.startElement("locator"); + _out.characters(_normalizeLocator(loc)); + _out.endElement("locator"); + _out.newline(); + } + + /** + * Serializes the item identifiers of the specified Topic Maps construct. + * + * @param tmo The Topic Maps construct to take the item identifiers from. + * @throws IOException If an error occurs. + */ + private void _writeItemIdentifiers(final Construct tmo) throws IOException { + _writeLocatorSet("itemIdentifiers", tmo.getItemIdentifiers()); + } + + /** + * Serializes the <tt>locators</tt> using the <tt>localName</tt> as + * element name. + * <p> + * If the set of <tt>locators</tt> is empty, this method does nothing. + * </p> + * + * @param localName The element's name. + * @param locators The locators to serialize. + * @throws IOException If an error occurs. + */ + private void _writeLocatorSet(final String localName, final Set<Locator> locators) throws IOException { + if (locators.isEmpty()) { + return; + } + Locator[] locs = locators.toArray(new Locator[locators.size()]); + Arrays.sort(locs, _locComparator); + _out.startElement(localName); + _out.newline(); + for (int i=0; i < locs.length; i++) { + _writeLocator(locs[i]); + } + _out.endElement(localName); + _out.newline(); + } + + /** + * Returns attributes which contains a reference to the provided topic. + * + * @param topic The topic to which the reference should point to. + * @return Attributes with a topic reference. + */ + private Attributes _topicRef(final Topic topic) { + if (topic == null) { + _reportInvalid("The topic reference is null"); + return XMLC14NWriter.EMPTY_ATTRS; + } + _attrs.clear(); + _attrs.addAttribute("", "topicref", "", "CDATA", Integer.toString(_indexOf(topic))); + return _attrs; + } + + /** + * Returns attributes which contain the reifier (if any) and the number + * of the provided Topic Maps construct (not a topic). + * + * @param reifiable The Topic Maps construct. + * @param pos The position of the reifiable within the parent container. + * @return Attributes which contain a reference to the reifier (if any) and + * the number of the provided Topic Maps construct. + */ + private Attributes _attributes(final Reifiable reifiable, int pos) { + _attrs.clear(); + _addReifier(_attrs, reifiable); + _attrs.addAttribute("", "number", "", "CDATA", Integer.toString(pos)); + return _attrs; + } + + /** + * Adds a reference to the reifier of the Topic Maps construct to the + * provided attributes. If the Topic Maps construct has no reifier, the + * provided attributes are not modified. + * + * @param attrs The attributes. + * @param reifiable The reifiable Topic Maps construct. + */ + private void _addReifier(final AttributesImpl attrs, final Reifiable reifiable) { + Topic reifier = reifiable.getReifier(); + if (reifier != null) { + attrs.addAttribute("", "reifier", "", "CDATA", Integer.toString(_indexOf(reifier))); + } + } + + /** + * Normalizes the locator according to CXTM 3.19. + * + * @param locator The locator to normalize. + * @return A normalized representation of the locator. + */ + private String _normalizeLocator(final Locator locator) { + String normLoc = _locator2Norm.get(locator); + if (normLoc != null) { + return normLoc; + } + normLoc = locator.getReference(); + if (normLoc.startsWith(_normBase)) { + normLoc = normLoc.substring(_normBase.length()); + } + else { + int i = 0; + int slashPos = -1; + final int max = Math.min(_normBase.length(), normLoc.length()); + while(i < max && _normBase.charAt(i) == normLoc.charAt(i)) { + if (_normBase.charAt(i) == '/') { + slashPos = i; + } + i++; + } + if (slashPos > -1) { + normLoc = normLoc.substring(slashPos); + } + } + if (normLoc.startsWith("/")) { + normLoc = normLoc.substring(1); + } + _locator2Norm.put(locator, normLoc); + return normLoc; + } + + /** + * Normalizes the base locator according to the following procedure + * (CXTM 3.19 - 1.): + * <cite>[...] the base locator with any fragment identifier and query + * removed and any trailing "/" character removed.[...]</cite> + * + * @param baseLocator + * @return + */ + private static String _normalizeBaseLocator(final String baseLocator) { + String loc = baseLocator; + int i = loc.indexOf('#'); + if (i > 0) { + loc = loc.substring(0, i); + } + i = loc.indexOf('?'); + if (i > 0) { + loc = loc.substring(0, i); + } + if (loc.endsWith("/")) { + loc = loc.substring(0, loc.length()-1); + } + return loc; + } + + /** + * Writes a warning msg to the log. + * + * This method is used to inform the user that the serialized topic map + * is not valid acc. to CXTM. + * + * @param msg The warning message. + */ + private static void _reportInvalid(final String msg) { + LOG.warning("Invalid CXTM: '" + msg + "'"); + } + + + /* + * Comparators. + */ + + private final class TopicComparator implements Comparator<Topic> { + + public int compare(Topic o1, Topic o2) { + if (o1 == o2) { + return 0; + } + if (o1 != null && o2 == null) { + _reportInvalid("Comparing topics where one topic is null"); + return +1; + } + else if (o1 == null && o2 != null) { + _reportInvalid("Comparing topics where one topic is null"); + return -1; + } + int res = _locSetComparator.compare(o1.getSubjectIdentifiers(), o2.getSubjectIdentifiers()); + if (res == 0) { + res = _locSetComparator.compare(o1.getSubjectLocators(), o2.getSubjectLocators()); + if (res == 0) { + res = _locSetComparator.compare(o1.getItemIdentifiers(), o2.getItemIdentifiers()); + } + } + return res; + } + } + + /** + * Abstract comparator that provides some utility methods which handle common + * comparisons. + */ + private abstract class AbstractComparator<T> implements Comparator<T> { + int compareString(String o1, String o2) { + if (o1 == null && o2 != null) { + _reportInvalid("The first string value is null"); + return -1; + } + if (o1 != null && o2 == null) { + _reportInvalid("The second string value is null"); + return +1; + } + return o1.compareTo(o2); + } + /** + * Extracts the type of the typed Topic Maps constructs and compares + * the topics. + * + * @param o1 The first typed Topic Maps construct. + * @param o2 The second typed Topic Maps construct. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareType(Typed o1, Typed o2) { + return _topicComparator.compare(o1.getType(), o2.getType()); + } + /** + * Extracts the scope of the scoped Topic Maps constructs and compares + * them. + * + * @param o1 The first scoped Topic Maps construct. + * @param o2 The second scoped Topic Maps construct. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareScope(Scoped o1, Scoped o2) { + return _scopeComparator.compare(o1.getScope(), o2.getScope()); + } + } + + /** + * Enhances the {@link AbstractComparator} with a method to compare the + * value and datatype of an occurrence or variant. + */ + private abstract class AbstractDatatypeAwareComparator<T> extends AbstractComparator<T> { + /** + * Compares the value and datatype of the occurrences / variants. + * + * @param o1 The first occurrence / variant. + * @param o2 The second occurrence / variant. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int _compareValueDatatype(DatatypeAware o1, DatatypeAware o2) { + int res = compareString(o1.getValue(), o2.getValue()); + if (res == 0) { + res = compareString(o1.getDatatype().getReference(), o2.getDatatype().getReference()); + } + return res; + } + } + + /** + * Canonical sort order: + * 1. [type] + * 2. [roles] + * 3. [scope] + * 4. [parent] + */ + private final class AssociationComparator extends AbstractComparator<Association> { + + private Comparator<Set<Role>> _roleSetComparator; + + AssociationComparator() { + _roleSetComparator = new RoleSetComparator(); + } + + public int compare(Association o1, Association o2) { + if (o1 == o2) { + return 0; + } + int res = compareType(o1, o2); + if (res == 0) { + res = _roleSetComparator.compare(o1.getRoles(), o2.getRoles()); + if (res == 0) { + res = compareScope(o1, o2); + } + } + return res; + } + } + + /** + * Role comparator which ignores the parent association. This comparator + * is meant to be used for roles where the parent is known to be equal or + * unequal. + */ + private class RoleIgnoreParentComparator extends AbstractComparator<Role> { + + public int compare(Role o1, Role o2) { + if (o1 == o2) { + return 0; + } + int res = _topicComparator.compare(o1.getPlayer(), o2.getPlayer()); + if (res == 0) { + res = compareType(o1, o2); + } + return res; + } + } + + /** + * Canonical sort order: + * 1. [player] + * 2. [type] + * 3. [parent] + */ + private final class RoleComparator extends RoleIgnoreParentComparator { + + public int compare(Role o1, Role o2) { + if (o1 == o2) { + return 0; + } + int res = super.compare(o1, o2); + if (res == 0) { + res = _assocComparator.compare(o1.getParent(), o2.getParent()); + } + return res; + } + } + + /** + * Canonical sort order: + * 1. [value] + * 2. [datatype] + * 3. [type] + * 4. [scope] + * 5. [parent] + */ + private final class OccurrenceComparator extends AbstractDatatypeAwareComparator<Occurrence> { + + public int compare(Occurrence o1, Occurrence o2) { + if (o1 == o2) { + return 0; + } + int res = _compareValueDatatype(o1, o2); + if (res == 0) { + res = compareType(o1, o2); + if (res == 0) { + res = compareScope(o1, o2); + } + } + return res; + } + + } + + /** + * Canonical sort order: + * 1. [value] + * 2. [type] + * 3. [scope] + * 4. [parent] + */ + private final class NameComparator extends AbstractComparator<Name> { + + public int compare(Name o1, Name o2) { + if (o1 == o2) { + return 0; + } + int res = compareString(o1.getValue(), o2.getValue()); + if (res == 0) { + res = compareType(o1, o2); + if (res == 0) { + res = compareScope(o1, o2); + } + } + return res; + } + } + + /** + * Canonical sort order: + * 1. [value] + * 2. [datatype] + * 3. [scope] + * 4. [parent] + */ + private final class VariantComparator extends AbstractDatatypeAwareComparator<Variant> { + + public int compare(Variant o1, Variant o2) { + if (o1 == o2) { + return 0; + } + int res = _compareValueDatatype(o1, o2); + if (res == 0) { + res = compareScope(o1, o2); + } + return res; + } + } + + /** + * Comparator which compares the size of the provided set. + * + * Iff the size of the sets are equal, another comparison method is used + * to compare the content of the sets. + */ + private abstract class AbstractSetComparator<T> implements Comparator<Set<T>> { + + public int compare(Set<T> o1, Set<T> o2) { + int s1 = o1.size(); + int s2 = o2.size(); + int res = s1 - s2; + if (res == 0) { + res = compareContent(o1, o2, s1); + } + return res; + } + + /** + * Called iff the size of the sets is equal. + * + * This method is used to compare the content of the sets. + * + * @param o1 The first set. + * @param o2 The second set. + * @param size The size of the set(s). + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + abstract int compareContent(Set<T> o1, Set<T> o2, int size); + } + + /** + * Compares role sets. The parent of the roles is ignored! + */ + private final class RoleSetComparator extends AbstractSetComparator<Role> { + + private RoleIgnoreParentComparator _roleCmp; + + RoleSetComparator() { + _roleCmp = new RoleIgnoreParentComparator(); + } + + @Override + int compareContent(Set<Role> o1, Set<Role> o2, + int size) { + int res = 0; + Role[] roles1 = o1.toArray(new Role[size]); + Role[] roles2 = o2.toArray(new Role[size]); + Arrays.sort(roles1, _roleCmp); + Arrays.sort(roles2, _roleCmp); + for (int i=0; i < size && res == 0; i++) { + res = _roleCmp.compare(roles1[i], roles2[i]); + } + return res; + } + + } + + /** + * Compares the scope of two scoped Topic Maps constructs. + */ + private final class ScopeComparator extends AbstractSetComparator<Topic> { + + @Override + int compareContent(Set<Topic> o1, Set<Topic> o2, int size) { + int res = 0 ; + Topic[] topics1 = o1.toArray(new Topic[size]); + Topic[] topics2 = o2.toArray(new Topic[size]); + Arrays.sort(topics1, _topicComparator); + Arrays.sort(topics2, _topicComparator); + for (int i=0; i < size && res == 0; i++) { + res = _topicComparator.compare(topics1[i], topics2[i]); + } + return res; + } + + } + + /** + * Comparator for sets of {@link org.tmapi.core.Locator}s. + */ + private final class LocatorSetComparator extends AbstractSetComparator<Locator> { + + @Override + int compareContent(Set<Locator> o1, Set<Locator> o2, int size) { + int res = 0; + Locator[] locs1 = o1.toArray(new Locator[size]); + Locator[] locs2 = o2.toArray(new Locator[size]); + Arrays.sort(locs1, _locComparator); + Arrays.sort(locs2, _locComparator); + for (int i=0; i < size && res == 0; i++) { + res = _locComparator.compare(locs1[i], locs2[i]); + } + return res; + } + } + + /** + * Compares {@link org.tmapi.core.Locator}s. + */ + private final class LocatorComparator implements Comparator<Locator> { + + public int compare(Locator o1, Locator o2) { + if (o1 == o2) { + return 0; + } + return _normalizeLocator(o1).compareTo(_normalizeLocator(o2)); + } + + } + + + /* + * Helper classes to treat type-instance relationships, modelled as property + * of a topic, as associations. + */ + + private final class TypeInstanceTopic implements Topic { + + private final Set<Locator> _sids; + + TypeInstanceTopic(Locator sid) { + _sids = Collections.singleton(sid); + } + + public Set<Locator> getSubjectIdentifiers() { + return _sids; + } + + public void addItemIdentifier(Locator arg0) { } + public void addSubjectIdentifier(Locator arg0) {} + public void addSubjectLocator(Locator arg0) {} + public void addType(Topic arg0) {} + public Set<Occurrence> getOccurrences() { return Collections.emptySet(); } + public Reifiable getReified() { return null; } + public Set<Role> getRolesPlayed() { return Collections.emptySet(); } + public Set<Locator> getSubjectLocators() { return Collections.emptySet(); } + public Set<Name> getNames() { return Collections.emptySet(); } + public Set<Topic> getTypes() { return null; } + public void mergeIn(Topic arg0) { } + public void remove() throws TopicInUseException { } + public void removeSubjectIdentifier(Locator arg0) { } + public void removeSubjectLocator(Locator arg0) { } + public void removeType(Topic arg0) { } + public String getId() { return null; } + public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); } + public TopicMap getTopicMap() { return null; } + public void removeItemIdentifier(Locator arg0) { } + public Name createName(String value, Collection<Topic> scope) { return null; } + public Name createName(String value, Topic... scope) {return null;} + public Name createName(Topic type, String value, Collection<Topic> scope) { return null; } + public Name createName(Topic type, String value, Topic... scope) { return null; } + public Occurrence createOccurrence(Topic type, Locator value, Collection<Topic> scope) { return null;} + public Occurrence createOccurrence(Topic type, Locator value, Topic... scope) {return null;} + public Occurrence createOccurrence(Topic type, String value, Collection<Topic> scope) { return null; } + public Occurrence createOccurrence(Topic type, String value, Locator datatype, Collection<Topic> scope) { return null; } + public Occurrence createOccurrence(Topic type, String value, Locator datatype, Topic... scope) { return null; } + public Occurrence createOccurrence(Topic type, String value, Topic... scope) { return null; } + public Set<Name> getNames(Topic type) { return null; } + public Set<Occurrence> getOccurrences(Topic type) { return null;} + public TopicMap getParent() { return null; } + public Set<Role> getRolesPlayed(Topic type, Topic assocType) { return null; } + public Set<Role> getRolesPlayed(Topic type) { return null; } + + } + + /** + * Used to represent type-instance relationships which are modelled as + * [type] property of topics. + */ + private final class TypeInstanceAssociation implements Association { + + final Set<Role> _roles; + + TypeInstanceAssociation(Topic type, Topic instance) { + Role typeRole = new TypeInstanceRole(this, _type, type); + Role instanceRole = new TypeInstanceRole(this, _instance, instance); + _roles = new TypeInstanceRoleSet(typeRole, instanceRole); + } + + public Set<Role> getRoles() { + return _roles; + } + + public Topic getType() { + return _typeInstance; + } + + public Set<Topic> getRoleTypes() { return null; } + public Set<Role> getRoles(Topic type) { return null; } + public void setReifier(Topic reifier) { } + public void addItemIdentifier(Locator itemIdentifier) { } + public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); } + public TopicMap getParent() { return null; } + public void removeItemIdentifier(Locator itemIdentifier) { } + public Role createRole(Topic arg0, Topic arg1) { return null; } + public Topic getReifier() { return null; } + public void remove() {} + public void setType(Topic arg0) {} + public void addTheme(Topic arg0) {} + public Set<Topic> getScope() { return Collections.emptySet(); } + public void removeTheme(Topic arg0) {} + public String getId() { return null; } + public TopicMap getTopicMap() { return null; } + } + + /** + * Immutable association role. + */ + private class TypeInstanceRole implements Role { + private final Topic _type; + private final Topic _player; + private final Association _parent; + + TypeInstanceRole(Association parent, Topic type, Topic player) { + _type = type; + _player = player; + _parent = parent; + List<Role> roles = _topic2Roles.get(player); + if (roles == null) { + roles = CollectionFactory.createList(); + _topic2Roles.put(player, roles); + } + roles.add(this); + } + + public Topic getType() { + return _type; + } + + public Topic getPlayer() { + return _player; + } + + public void setReifier(Topic reifier) { } + public void addItemIdentifier(Locator itemIdentifier) { } + public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); } + public Association getParent() { return _parent; } + public void removeItemIdentifier(Locator itemIdentifier) { } + public Association getAssociation() { return _parent; } + public Topic getReifier() { return null; } + public void remove() {} + public void setPlayer(Topic arg0) {} + public void setType(Topic arg0) {} + public String getId() { return null; } + public TopicMap getTopicMap() { return null; } + } + + /** + * Immutable 'set' of two roles. + */ + private static class TypeInstanceRoleSet extends AbstractSet<Role> { + + private final Role _role1; + private final Role _role2; + + TypeInstanceRoleSet(Role role1, Role role2) { + _role1 = role1; + _role2 = role2; + } + + @Override + public Iterator<Role> iterator() { + return new TypeInstanceRoleSetIterator(); + } + + @Override + public int size() { + return 2; + } + + private class TypeInstanceRoleSetIterator implements Iterator<Role> { + + private int _idx; + + public boolean hasNext() { + return _idx < 2; + } + + public Role next() { + if (_idx > 1) { + throw new NoSuchElementException(); + } + return 0 == _idx++ ? _role1 : _role2; + } + + public void remove() { + new UnsupportedOperationException(); + } + } + } + +} Property changes on: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Deleted: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMWriter.java 2008-11-15 13:02:58 UTC (rev 197) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMWriter.java 2008-11-15 13:09:09 UTC (rev 198) @@ -1,1230 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed 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 org.tinytim.mio; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.AbstractSet; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.logging.Logger; - -import org.tinytim.internal.utils.CollectionFactory; -import org.tinytim.utils.DuplicateRemovalUtils; -import org.tinytim.voc.TMDM; -import org.tinytim.voc.XSD; -import org.tmapi.core.Association; -import org.tmapi.core.Construct; -import org.tmapi.core.DatatypeAware; -import org.tmapi.core.Locator; -import org.tmapi.core.Name; -import org.tmapi.core.Occurrence; -import org.tmapi.core.Reifiable; -import org.tmapi.core.Role; -import org.tmapi.core.Scoped; -import org.tmapi.core.Topic; -import org.tmapi.core.TopicInUseException; -import org.tmapi.core.TopicMap; -import org.tmapi.core.Typed; -import org.tmapi.core.Variant; -import org.tmapi.index.TypeInstanceIndex; - -import org.xml.sax.Attributes; -import org.xml.sax.helpers.AttributesImpl; - -/** - * Provides serialization of topic maps into Canonical XTM (CXTM). - * <p> - * CXTM is a format that guarantees that two equivalent Topic Maps Data Model - * instances [ISO/IEC 13250-2] will always produce byte-by-byte identical - * serializations, and that non-equivalent instances will always produce - * different serializations. - * </p> - * <p> - * See <a href="http://www.isotopicmaps.org/cxtm/">http://www.isotopicmaps.org/cxtm/</a> - * for details. - * </p> - * <p> - * <em>CAUTION</em>: This class implements the - * <a href="http://www.isotopicmaps.org/cxtm/">CXTM draft dtd. 2008-05-15</a>, - * the output may change in the future. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public final class CXTMWriter implements TopicMapWriter { - - private static final Logger LOG = Logger.getLogger(CXTMWriter.class.getName()); - - private static final Role[] _EMPTY_ROLES = new Role[0]; - - private final AttributesImpl _attrs; - - private Topic _type; - private Topic _instance; - private Topic _typeInstance; - - private final XMLC14NWriter _out; - private final String _normBase; - private final Map<Construct, Integer> _construct2Id; - private final Map<Topic, List<Role>> _topic2Roles; - private final Map<Locator, String> _locator2Norm; - private final Map<Association, Role[]> _assoc2Roles; - - private final Comparator<Topic> _topicComparator; - private final Comparator<Association> _assocComparator; - private final Comparator<Role> _roleComparator; - private final Comparator<Occurrence> _occComparator; - private final Comparator<Name> _nameComparator; - private final Comparator<Variant> _variantComparator; - private final Comparator<Set<Locator>> _locSetComparator; - private final Comparator<Locator> _locComparator; - private final Comparator<Set<Topic>> _scopeComparator; - - /** - * Creates a canonicalizer. - * - * @param out The stream the CXTM is written onto. - * @param baseLocator The base locator which is used to resolve IRIs against. - * @throws IOException If an error occurs. - */ - public CXTMWriter(OutputStream out, String baseLocator) throws IOException { - if (baseLocator == null) { - throw new IllegalArgumentException("The base locator must not be null"); - } - _out = new XMLC14NWriter(out); - _attrs = new AttributesImpl(); - _normBase = _normalizeBaseLocator(baseLocator); - _construct2Id = CollectionFactory.createIdentityMap(); - _locator2Norm = CollectionFactory.createIdentityMap(); - _assoc2Roles = CollectionFactory.createIdentityMap(); - _topic2Roles = CollectionFactory.createIdentityMap(); - _topicComparator = new TopicComparator(); - _assocComparator = new AssociationComparator(); - _roleComparator = new RoleComparator(); - _occComparator = new OccurrenceComparator(); - _nameComparator = new NameComparator(); - _variantComparator = new VariantComparator(); - _locSetComparator = new LocatorSetComparator(); - _locComparator = new LocatorComparator(); - _scopeComparator = new ScopeComparator(); - } - - /** - * Serializes the specified <tt>topicMap</tt> into the CXTM format. - * <p> - * <em>CAUTION</em>: This method MAY modify the topic map since duplicate - * Topic Maps constructs (if any) are removed in advance. - * </p> - * - * @param topicMap The topic map to serialize. - * @throws IOException If an error occurs. - */ - public void write(TopicMap topicMap) throws IOException { - DuplicateRemovalUtils.removeDuplicates(topicMap); - TypeInstanceIndex typeInstanceIndex = topicMap.getIndex(TypeInstanceIndex.class); - if (!typeInstanceIndex.isAutoUpdated()) { - ... [truncated message content] |
From: <lh...@us...> - 2008-11-15 13:03:10
|
Revision: 197 http://tinytim.svn.sourceforge.net/tinytim/?rev=197&view=rev Author: lheuer Date: 2008-11-15 13:02:58 +0000 (Sat, 15 Nov 2008) Log Message: ----------- - Restricted constructor visibility of abstract classes to protected - Simplified theme handling for variants in NameImpl - Docs Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMap.java tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/value/BooleanLiteral.java Modified: tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMap.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMap.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMap.java 2008-11-15 13:02:58 UTC (rev 197) @@ -23,7 +23,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ abstract class AbstractTopicMap extends ConstructImpl implements ITopicMap { Modified: tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2008-11-15 13:02:58 UTC (rev 197) @@ -37,7 +37,7 @@ protected final Map<String, Boolean> _features; protected final Map<String, Object> _properties; - AbstractTopicMapSystem(Map<String, Boolean> features, Map<String, Object> properties) throws TMAPIException { + protected AbstractTopicMapSystem(Map<String, Boolean> features, Map<String, Object> properties) throws TMAPIException { _features = features; _properties = properties; } Modified: tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2008-11-15 13:02:58 UTC (rev 197) @@ -102,11 +102,9 @@ public void addTheme(Topic theme) { IScope scope = _scope; super.addTheme(theme); - if (scope != _scope) { - if (_variants != null) { - for (Variant variant: _variants) { - ((VariantImpl) variant)._addNameTheme(theme); - } + if (_variants != null && scope != _scope) { + for (Variant variant: _variants) { + ((VariantImpl) variant)._addNameTheme(theme); } } } @@ -118,11 +116,9 @@ public void removeTheme(Topic theme) { IScope scope = _scope; super.removeTheme(theme); - if (scope != _scope) { - if (_variants != null) { - for (Variant variant: _variants) { - ((VariantImpl) variant)._removeNameTheme(theme); - } + if (_variants != null && scope != _scope) { + for (Variant variant: _variants) { + ((VariantImpl) variant)._removeNameTheme(theme); } } } Modified: tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2008-11-15 13:02:58 UTC (rev 197) @@ -38,12 +38,12 @@ protected IScope _scope; - ScopedImpl(ITopicMap tm) { + protected ScopedImpl(ITopicMap tm) { super(tm); _scope = Scope.UCS; } - ScopedImpl(ITopicMap topicMap, Topic type, IScope scope) { + protected ScopedImpl(ITopicMap topicMap, Topic type, IScope scope) { super(topicMap, type); _scope = scope; } Modified: tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2008-11-15 13:02:58 UTC (rev 197) @@ -38,11 +38,11 @@ private Topic _type; private Topic _reifier; - TypedImpl(ITopicMap tm) { + protected TypedImpl(ITopicMap tm) { super(tm); } - TypedImpl(ITopicMap topicMap, Topic type) { + protected TypedImpl(ITopicMap topicMap, Topic type) { super(topicMap); _type = type; } Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/BooleanLiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/BooleanLiteral.java 2008-11-14 15:51:56 UTC (rev 196) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/BooleanLiteral.java 2008-11-15 13:02:58 UTC (rev 197) @@ -26,7 +26,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ final class BooleanLiteral implements ILiteral { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-14 15:52:06
|
Revision: 196 http://tinytim.svn.sourceforge.net/tinytim/?rev=196&view=rev Author: lheuer Date: 2008-11-14 15:51:56 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Forgot to add release date :/ Modified Paths: -------------- tinytim/tags/release-2_0_0a3/CHANGES.txt tinytim/trunk/CHANGES.txt Modified: tinytim/tags/release-2_0_0a3/CHANGES.txt =================================================================== --- tinytim/tags/release-2_0_0a3/CHANGES.txt 2008-11-14 15:48:10 UTC (rev 195) +++ tinytim/tags/release-2_0_0a3/CHANGES.txt 2008-11-14 15:51:56 UTC (rev 196) @@ -2,7 +2,7 @@ Changes Log =========== -2.0.0 a3 (xx.11.2008) +2.0.0 a3 (14.11.2008) --------------------- * Moved to Apache License 2.0 * Internal code refactoring Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-11-14 15:48:10 UTC (rev 195) +++ tinytim/trunk/CHANGES.txt 2008-11-14 15:51:56 UTC (rev 196) @@ -2,7 +2,7 @@ Changes Log =========== -2.0.0 a3 (xx.11.2008) +2.0.0 a3 (14.11.2008) --------------------- * Moved to Apache License 2.0 * Internal code refactoring This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-14 15:48:13
|
Revision: 195 http://tinytim.svn.sourceforge.net/tinytim/?rev=195&view=rev Author: lheuer Date: 2008-11-14 15:48:10 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Increased status Modified Paths: -------------- tinytim/trunk/build.properties Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-11-14 15:44:03 UTC (rev 194) +++ tinytim/trunk/build.properties 2008-11-14 15:48:10 UTC (rev 195) @@ -1,5 +1,5 @@ version=2.0.0 -version_suffix=a3 +version_suffix=a4 #release_type= debug=off optimize=on This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |