|
From: <lh...@us...> - 2008-08-14 12:05:25
|
Revision: 123
http://tinytim.svn.sourceforge.net/tinytim/?rev=123&view=rev
Author: lheuer
Date: 2008-08-14 12:05:34 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
- 1.5.0beta version changes
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/MapInputHandler.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java
tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestMapInputHandler.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/MapInputHandler.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/MapInputHandler.java 2008-08-14 11:58:37 UTC (rev 122)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/MapInputHandler.java 2008-08-14 12:05:34 UTC (rev 123)
@@ -115,8 +115,7 @@
* @see com.semagia.mio.IMapHandler#endTopic()
*/
public void endTopic() throws MIOException {
- Topic topic = _peekTopic();
- _leaveStatePopConstruct(State.TOPIC);
+ Topic topic = (Topic) _leaveStatePopConstruct(State.TOPIC);
_handleTopic(topic);
}
@@ -190,8 +189,7 @@
* @see com.semagia.mio.IMapHandler#endName()
*/
public void endName() throws MIOException {
- TopicName name = (TopicName) _peekConstruct();
- _leaveStatePopConstruct(State.NAME);
+ TopicName name = (TopicName) _leaveStatePopConstruct(State.NAME);
if (name.getType() == null) {
name.setType(_topicBySubjectIdentifier(TMDM.TOPIC_NAME));
}
@@ -210,8 +208,7 @@
*/
@SuppressWarnings("unchecked")
public void endVariant() throws MIOException {
- Variant variant = (Variant) _peekConstruct();
- _leaveStatePopConstruct(State.VARIANT);
+ 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");
@@ -434,11 +431,12 @@
* 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 void _leaveStatePopConstruct(State state) throws MIOException {
+ private TopicMapObject _leaveStatePopConstruct(State state) throws MIOException {
_leaveState(state);
- _constructStack.remove(_constructStack.size()-1);
+ return _constructStack.remove(_constructStack.size()-1);
}
/**
@@ -484,11 +482,11 @@
}
/**
- * Merges the <code>source</code> topic with the <code>target</code>.
+ * Merges the <tt>source</tt> topic with the <tt>target</tt>.
*
* Further, this method ensures that the construct stack stays valid: If
- * the <code>source</code> is part of the stack, it is replaced with
- * <code>target</code>.
+ * 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.
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java 2008-08-14 11:58:37 UTC (rev 122)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/TopicMapImporter.java 2008-08-14 12:05:34 UTC (rev 123)
@@ -33,6 +33,7 @@
import com.semagia.mio.DeserializerRegistry;
import com.semagia.mio.IDeserializer;
import com.semagia.mio.MIOException;
+import com.semagia.mio.Property;
import com.semagia.mio.Syntax;
/**
@@ -48,8 +49,8 @@
}
/**
- * Reads a XML topic map from <code>input</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a XML topic map from <tt>input</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
* @param topicMap The topic map instance which receives the
@@ -63,8 +64,8 @@
}
/**
- * Reads a XML topic map from <code>input</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a XML topic map from <tt>input</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
* @param topicMap The topic map instance which receives the
@@ -78,8 +79,8 @@
}
/**
- * Reads a topic map from <code>file</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a topic map from <tt>file</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
* The syntax of the serialized topic map is guessed by the file name. If
@@ -97,11 +98,11 @@
}
/**
- * Reads a topic map from <code>file</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a topic map from <tt>file</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
- * The <code>syntax</code> is a string with the abbreviated Topic Maps syntax
+ * The <tt>syntax</tt> is a string with the abbreviated Topic Maps syntax
* name; i.e. "xtm", "ltm", "ctm". The name is matched case-insensitve, that
* means "xtm" is the same as "xTm", "XTM" etc.
*
@@ -117,11 +118,11 @@
}
/**
- * Reads a topic map from <code>input</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a topic map from <tt>input</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
- * The <code>syntax</code> is a string with the abbreviated Topic Maps syntax
+ * The <tt>syntax</tt> is a string with the abbreviated Topic Maps syntax
* name; i.e. "xtm", "ltm", "ctm". The name is matched case-insensitve, that
* means "xtm" is the same as "xTm", "XTM" etc.
*
@@ -137,11 +138,11 @@
}
/**
- * Reads a topic map from <code>input</code> and adds the content to the
- * specified <code>topicMap</code>. The <code>docIRI</code> is used to
+ * Reads a topic map from <tt>input</tt> and adds the content to the
+ * specified <tt>topicMap</tt>. The <tt>docIRI</tt> is used to
* resolve IRIs against.
*
- * The <code>syntax</code> is a string with the abbreviated Topic Maps syntax
+ * The <tt>syntax</tt> is a string with the abbreviated Topic Maps syntax
* name; i.e. "xtm", "ltm", "ctm". The name is matched case-insensitve, that
* means "xtm" is the same as "xTm", "XTM" etc.
*
@@ -176,8 +177,8 @@
}
/**
- * Reads a topic map from <code>input</code> and adds the content to the
- * <code>topicMap</code>.
+ * Reads a topic map from <tt>input</tt> and adds the content to the
+ * <tt>topicMap</tt>.
*
* @param syntax A syntax instance.
* @param topicMap A topic map instance.
@@ -191,8 +192,8 @@
}
/**
- * Reads a topic map from <code>input</code> and adds the content to the
- * <code>topicMap</code>.
+ * Reads a topic map from <tt>input</tt> and adds the content to the
+ * <tt>topicMap</tt>.
*
* @param syntax A syntax instance.
* @param topicMap A topic map instance.
@@ -206,6 +207,7 @@
if (deser == null) {
throw new IOException("No deserializer found for the syntax '" + syntax.getName() + "'");
}
+ deser.setProperty(Property.VALIDATE, "false");
deser.setMapHandler(new MapInputHandler(topicMap));
try {
deser.parse(input, docIRI);
@@ -215,6 +217,7 @@
throw (IOException) ex.getException();
}
else {
+ ex.printStackTrace();
throw new TMAPIRuntimeException(ex);
}
}
Modified: tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestMapInputHandler.java
===================================================================
--- tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestMapInputHandler.java 2008-08-14 11:58:37 UTC (rev 122)
+++ tinytim-mio/trunk/src/test/java/org/tinytim/mio/TestMapInputHandler.java 2008-08-14 12:05:34 UTC (rev 123)
@@ -36,7 +36,7 @@
import junit.framework.TestCase;
/**
- * Tests against the {@link org.tinytim.io.MapInputHandler}.
+ * Tests against the {@link org.tinytim.mio.MapInputHandler}.
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|