|
From: <lh...@us...> - 2008-04-26 09:51:35
|
Revision: 42
http://tinytim.svn.sourceforge.net/tinytim/?rev=42&view=rev
Author: lheuer
Date: 2008-04-26 02:51:39 -0700 (Sat, 26 Apr 2008)
Log Message:
-----------
- Moved the IDatatypeAwareConstruct constants to the abstract class
- DatatypeAwareConstruct sends now the correct SET_LOCATOR event if the resource is set
- Minor Java Doc tweaks
- TopicMapImpl cleans up the cached HelperObjects
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/DatatypeAwareConstruct.java
tinytim/trunk/src/main/java/org/tinytim/IDatatypeAwareConstruct.java
tinytim/trunk/src/main/java/org/tinytim/SignatureGenerator.java
tinytim/trunk/src/main/java/org/tinytim/TopicMapImpl.java
tinytim/trunk/src/main/java/org/tinytim/TopicMapSystemFactoryImpl.java
tinytim/trunk/src/main/java/org/tinytim/Typed.java
tinytim/trunk/src/test/java/org/tinytim/AllTests.java
tinytim/trunk/src/test/java/org/tinytim/TestTopicUtils.java
Modified: tinytim/trunk/src/main/java/org/tinytim/DatatypeAwareConstruct.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/DatatypeAwareConstruct.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/DatatypeAwareConstruct.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -34,6 +34,10 @@
abstract class DatatypeAwareConstruct extends Scoped implements
IDatatypeAwareConstruct {
+ private static final String _XSD_BASE = "http://www.w3.org/2001/XMLSchema#";
+ private static final Locator STRING = new IRI(_XSD_BASE + "string");
+ private static final Locator ANY_URI = new IRI(_XSD_BASE + "anyURI");
+
private String _value;
private Locator _resource;
@@ -96,7 +100,7 @@
* @param value The locator.
*/
public void setResource(Locator value) {
- _fireEvent(Event.SET_VALUE, _value, value);
+ _fireEvent(Event.SET_LOCATOR, _resource, value);
_value = null;
_resource = value;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/IDatatypeAwareConstruct.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/IDatatypeAwareConstruct.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/IDatatypeAwareConstruct.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -25,15 +25,13 @@
/**
* Indicates that a Topic Maps construct has a value and a datatype.
*
+ * This interface is not meant to be used outside of the tinyTiM package.
+ *
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
*/
interface IDatatypeAwareConstruct extends IConstruct {
- static final String _XSD_BASE = "http://www.w3.org/2001/XMLSchema#";
- static final Locator STRING = new IRI(_XSD_BASE + "string");
- static final Locator ANY_URI = new IRI(_XSD_BASE + "anyURI");
-
/**
* The value of this Topic Maps construct.
*
Modified: tinytim/trunk/src/main/java/org/tinytim/SignatureGenerator.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/SignatureGenerator.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/SignatureGenerator.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -34,7 +34,7 @@
* Generates signatures for Topic Maps constructs.
*
* This class can be used to detect duplicates: If two Topic Maps constructs
- * have the same signature, they should be merged (if they belong to the same
+ * have the same signature, they should be merged (if they belong to the same
* parent).
*
* Neither the topic map, the parent, the reifier, nor item identifiers
Modified: tinytim/trunk/src/main/java/org/tinytim/TopicMapImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/TopicMapImpl.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/TopicMapImpl.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -243,7 +243,7 @@
}
/**
- * Returns a toic by its subject identifier.
+ * Returns a topic by its subject identifier.
*
* @param subjectIdentifier The subject identifier.
* @return A topic or <code>null</code> if no topic with the specified
@@ -254,7 +254,7 @@
}
/**
- * Returns a toic by its subject locator.
+ * Returns a topic by its subject locator.
*
* @param subjectLocator The subject locator.
* @return A topic or <code>null</code> if no topic with the specified
@@ -335,6 +335,8 @@
_identityManager.close();
_identityManager = null;
_eventMultiplier = null;
+ _helperObjects.clear();
+ _helperObjects = null;
super.dispose();
}
@@ -362,7 +364,7 @@
_helperObjects.put(interfaceName, instance);
}
catch (Exception ex) {
- throw new HelperObjectInstantiationException("");
+ throw new HelperObjectInstantiationException("Failed to initialize the helper object");
}
}
return instance;
Modified: tinytim/trunk/src/main/java/org/tinytim/TopicMapSystemFactoryImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/TopicMapSystemFactoryImpl.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/TopicMapSystemFactoryImpl.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -80,7 +80,7 @@
}
/**
- * Creates a collection factory based according to the
+ * Creates a collection factory according to the
* {@link Property#COLLECTION_FACTORY} value. If the collection factory
* is not available, a default collection factory implementation is returned.
*
Modified: tinytim/trunk/src/main/java/org/tinytim/Typed.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/Typed.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/main/java/org/tinytim/Typed.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -23,9 +23,9 @@
import org.tmapi.core.Topic;
/**
- * Class that provides a "type" property and fires an event if that type
- * property changes. Additionally, this class provides
- * a {@link IReifiable} implementation.
+ * Class that provides a "type" property and fires an event if that property
+ * changes. Additionally, this class provides a {@link IReifiable}
+ * implementation.
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
Modified: tinytim/trunk/src/test/java/org/tinytim/AllTests.java
===================================================================
--- tinytim/trunk/src/test/java/org/tinytim/AllTests.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/test/java/org/tinytim/AllTests.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -30,7 +30,7 @@
* Runs all tests.
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev:$ - $Date:$
+ * @version $Rev$ - $Date$
*/
public class AllTests extends TestSuite {
Modified: tinytim/trunk/src/test/java/org/tinytim/TestTopicUtils.java
===================================================================
--- tinytim/trunk/src/test/java/org/tinytim/TestTopicUtils.java 2008-04-25 20:24:19 UTC (rev 41)
+++ tinytim/trunk/src/test/java/org/tinytim/TestTopicUtils.java 2008-04-26 09:51:39 UTC (rev 42)
@@ -60,6 +60,7 @@
assertFalse(TopicUtils.isRemovable(topic, true));
((IReifiable) assoc).setReifier(null);
assertTrue(TopicUtils.isRemovable(topic));
+ assertTrue(TopicUtils.isRemovable(topic, true));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|