|
From: <lh...@us...> - 2009-07-03 06:54:10
|
Revision: 299
http://tinytim.svn.sourceforge.net/tinytim/?rev=299&view=rev
Author: lheuer
Date: 2009-07-02 11:07:24 +0000 (Thu, 02 Jul 2009)
Log Message:
-----------
- Applied patch from Hannes Niederhausen (TMCL voc)
- Internal change: All constructs are now checked if they belong to the same topic map
- Fixes issue #2812460
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java
tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java
tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
Modified: tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -50,7 +50,7 @@
if (supported == null) {
TopicMapSystemFactoryImpl.reportFeatureNotRecognized(featureName);
}
- return supported;
+ return supported.booleanValue();
}
/* (non-Javadoc)
Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -103,6 +103,7 @@
public Role createRole(Topic type, Topic player) {
Check.typeNotNull(this, type);
Check.playerNotNull(this, player);
+ Check.sameTopicMap(this, type, player);
RoleImpl role = new RoleImpl(_tm, type, player);
addRole(role);
return role;
@@ -130,9 +131,7 @@
* @see org.tmapi.core.Association#getRoles(org.tmapi.core.Topic)
*/
public Set<Role> getRoles(Topic type) {
- if (type == null) {
- throw new IllegalArgumentException("The type must not be null");
- }
+ Check.typeNotNull(type);
Set<Role> roles = CollectionFactory.createIdentitySet(_roles.size());
for (Role role: _roles) {
if (type == role.getType()) {
Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -22,11 +22,11 @@
import org.tinytim.internal.api.IConstant;
import org.tinytim.internal.api.IConstruct;
import org.tinytim.internal.api.ITopicMap;
+import org.tinytim.internal.utils.Check;
import org.tinytim.internal.utils.CollectionFactory;
import org.tmapi.core.Construct;
import org.tmapi.core.Locator;
-import org.tmapi.core.ModelConstraintException;
import org.tmapi.core.TopicMap;
/**
@@ -78,18 +78,16 @@
/* (non-Javadoc)
* @see org.tmapi.core.Construct#addItemIdentifier(org.tmapi.core.Locator)
*/
- public void addItemIdentifier(Locator itemIdentifier) {
- if (itemIdentifier == null) {
- throw new ModelConstraintException(this, "The item identifier must not be null");
- }
- if (_iids != null && _iids.contains(itemIdentifier)) {
+ public void addItemIdentifier(Locator iid) {
+ Check.itemIdentifierNotNull(this, iid);
+ if (_iids != null && _iids.contains(iid)) {
return;
}
- _fireEvent(Event.ADD_IID, null, itemIdentifier);
+ _fireEvent(Event.ADD_IID, null, iid);
if (_iids == null) {
_iids = CollectionFactory.createIdentitySet(IConstant.CONSTRUCT_IID_SIZE);
}
- _iids.add(itemIdentifier);
+ _iids.add(iid);
}
/* (non-Javadoc)
Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -36,7 +36,6 @@
import org.tmapi.core.Association;
import org.tmapi.core.IdentityConstraintException;
-import org.tmapi.core.ModelConstraintException;
import org.tmapi.core.Role;
import org.tmapi.core.Locator;
import org.tmapi.core.Occurrence;
@@ -127,9 +126,7 @@
* @see org.tmapi.core.TopicMap#createTopicByItemIdentifier(org.tmapi.core.Locator)
*/
public Topic createTopicByItemIdentifier(Locator iid) {
- if (iid == null) {
- throw new ModelConstraintException(null, "The item identifier must not be null");
- }
+ Check.itemIdentifierNotNull(this, iid);
Construct construct = getConstructByItemIdentifier(iid);
if (construct != null) {
if (construct instanceof Topic) {
@@ -153,9 +150,7 @@
* @see org.tmapi.core.TopicMap#createTopicBySubjectIdentifier(org.tmapi.core.Locator)
*/
public Topic createTopicBySubjectIdentifier(Locator sid) {
- if (sid == null) {
- throw new ModelConstraintException(null, "The subject identifier must not be null");
- }
+ Check.subjectIdentifierNotNull(this, sid);
Topic topic = getTopicBySubjectIdentifier(sid);
if (topic != null) {
return topic;
@@ -177,9 +172,7 @@
* @see org.tmapi.core.TopicMap#createTopicBySubjectLocator(org.tmapi.core.Locator)
*/
public Topic createTopicBySubjectLocator(Locator slo) {
- if (slo == null) {
- throw new ModelConstraintException(null, "The subject locator must not be null");
- }
+ Check.subjectLocatorNotNull(this, slo);
Topic topic = getTopicBySubjectLocator(slo);
if (topic != null) {
return topic;
@@ -229,6 +222,8 @@
public Association createAssociation(Topic type, Collection<Topic> scope) {
Check.typeNotNull(this, type);
Check.scopeNotNull(this, scope);
+ Check.sameTopicMap(this, type);
+ Check.sameTopicMap(this, scope);
AssociationImpl assoc = new AssociationImpl(this, type, Scope.create(scope));
addAssociation(assoc);
return assoc;
@@ -270,22 +265,25 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getTopicBySubjectIdentifier(org.tmapi.core.Locator)
*/
- public Topic getTopicBySubjectIdentifier(Locator subjectIdentifier) {
- return _identityManager.getTopicBySubjectIdentifier(subjectIdentifier);
+ public Topic getTopicBySubjectIdentifier(Locator sid) {
+ Check.subjectIdentifierNotNull(sid);
+ return _identityManager.getTopicBySubjectIdentifier(sid);
}
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getTopicBySubjectLocator(org.tmapi.core.Locator)
*/
- public Topic getTopicBySubjectLocator(Locator subjectLocator) {
- return _identityManager.getTopicBySubjectLocator(subjectLocator);
+ public Topic getTopicBySubjectLocator(Locator slo) {
+ Check.subjectLocatorNotNull(slo);
+ return _identityManager.getTopicBySubjectLocator(slo);
}
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getConstructByItemIdentifier(org.tmapi.core.Locator)
*/
- public Construct getConstructByItemIdentifier(Locator itemIdentifier) {
- return _identityManager.getConstructByItemIdentifier(itemIdentifier);
+ public Construct getConstructByItemIdentifier(Locator iid) {
+ Check.itemIdentifierNotNull(iid);
+ return _identityManager.getConstructByItemIdentifier(iid);
}
/* (non-Javadoc)
@@ -299,6 +297,7 @@
* @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic)
*/
public void setReifier(Topic reifier) {
+ Check.sameTopicMap(this, reifier);
if (_reifier == reifier) {
return;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -186,6 +186,7 @@
}
public IVariant createVariant(ILiteral literal, Collection<Topic> scope) {
+ Check.sameTopicMap(this, scope);
if (scope.isEmpty()) {
throw new ModelConstraintException(this, "The scope of the variant must not be unconstrained");
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -61,6 +61,7 @@
*/
public void setPlayer(Topic player) {
Check.playerNotNull(this, player);
+ Check.sameTopicMap(this, player);
if (_player == player) {
return;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -21,8 +21,8 @@
import org.tinytim.internal.api.IScope;
import org.tinytim.internal.api.IScoped;
import org.tinytim.internal.api.ITopicMap;
+import org.tinytim.internal.utils.Check;
-import org.tmapi.core.ModelConstraintException;
import org.tmapi.core.Topic;
/**
@@ -77,9 +77,8 @@
* @see org.tmapi.core.Scoped#addTheme(org.tmapi.core.Topic)
*/
public void addTheme(Topic theme) {
- if (theme == null) {
- throw new ModelConstraintException(this, "The theme must not be null");
- }
+ Check.themeNotNull(this, theme);
+ Check.sameTopicMap(this, theme);
setScopeObject(_scope.add(theme));
}
@@ -87,6 +86,9 @@
* @see org.tmapi.core.Scoped#removeTheme(org.tmapi.core.Topic)
*/
public void removeTheme(Topic theme) {
+ if (theme == null) {
+ return;
+ }
setScopeObject(_scope.remove(theme));
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -35,7 +35,6 @@
import org.tinytim.voc.TMDM;
import org.tmapi.core.Locator;
-import org.tmapi.core.ModelConstraintException;
import org.tmapi.core.Name;
import org.tmapi.core.Occurrence;
import org.tmapi.core.Reifiable;
@@ -86,9 +85,7 @@
* @see org.tmapi.core.Topic#addSubjectIdentifier(org.tmapi.core.Locator)
*/
public void addSubjectIdentifier(Locator sid) {
- if (sid == null) {
- throw new ModelConstraintException(this, "The subject identifier must not be null");
- }
+ Check.subjectIdentifierNotNull(this, sid);
if (_sids.contains(sid)) {
return;
}
@@ -119,9 +116,7 @@
* @see org.tmapi.core.Topic#addSubjectLocator(org.tmapi.core.Locator)
*/
public void addSubjectLocator(Locator slo) {
- if (slo == null) {
- throw new ModelConstraintException(this, "The subject locator must not be null");
- }
+ Check.subjectLocatorNotNull(this, slo);
if (_slos != null && _sids.contains(slo)) {
return;
}
@@ -201,6 +196,8 @@
public IOccurrence createOccurrence(Topic type, ILiteral literal, Collection<Topic> scope) {
Check.typeNotNull(this, type);
Check.scopeNotNull(this, scope);
+ Check.sameTopicMap(this, type);
+ Check.sameTopicMap(this, scope);
IOccurrence occ = new OccurrenceImpl(_tm, type, literal, Scope.create(scope));
addOccurrence(occ);
return occ;
@@ -261,9 +258,7 @@
* @see org.tmapi.core.Topic#getNames(org.tmapi.core.Topic)
*/
public Set<Name> getNames(Topic type) {
- if (type == null) {
- throw new IllegalArgumentException("The type must not be null");
- }
+ Check.typeNotNull(type);
Set<Name> names = CollectionFactory.createIdentitySet();
for (Name name: _names) {
if (type == name.getType()) {
@@ -293,9 +288,7 @@
* @see org.tmapi.core.Topic#getOccurrences(org.tmapi.core.Topic)
*/
public Set<Occurrence> getOccurrences(Topic type) {
- if (type == null) {
- throw new IllegalArgumentException("The type must not be null");
- }
+ Check.typeNotNull(type);
Set<Occurrence> occs = CollectionFactory.createIdentitySet();
for (Occurrence occ: _occs) {
if (type == occ.getType()) {
@@ -323,6 +316,8 @@
public IName createName(Topic type, ILiteral literal, Collection<Topic> scope) {
Check.typeNotNull(this, type);
Check.scopeNotNull(this, scope);
+ Check.sameTopicMap(this, type);
+ Check.sameTopicMap(this, scope);
NameImpl name = new NameImpl(_tm, type, literal, Scope.create(scope));
addName(name);
return name;
@@ -382,9 +377,7 @@
* @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic)
*/
public Set<Role> getRolesPlayed(Topic type) {
- if (type == null) {
- throw new IllegalArgumentException("The type must not be null");
- }
+ Check.typeNotNull(type);
if (_rolesPlayed == null) {
return Collections.emptySet();
}
@@ -401,9 +394,7 @@
* @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic, org.tmapi.core.Topic)
*/
public Set<Role> getRolesPlayed(Topic type, Topic assoc) {
- if (type == null) {
- throw new IllegalArgumentException("The type must not be null");
- }
+ Check.typeNotNull(type);
if (assoc == null) {
throw new IllegalArgumentException("The association type must not be null");
}
@@ -446,6 +437,7 @@
*/
public void addType(Topic type) {
Check.typeNotNull(this, type);
+ Check.sameTopicMap(this, type);
if (_types != null && _types.contains(type)) {
return;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -40,11 +40,7 @@
private static final FeatureInfo[] _FEATURES = new FeatureInfo[] {
// Feature IRI, default value, fixed?
- new FeatureInfo(Feature.NOTATION_URI, true, true),
- new FeatureInfo(Feature.XTM_1_0, false, true),
- new FeatureInfo(Feature.XTM_1_1, true, true),
new FeatureInfo(Feature.AUTOMERGE, false, true),
- new FeatureInfo(Feature.TNC, false, true),
new FeatureInfo(Feature.READ_ONLY, false, true)
};
@@ -114,7 +110,7 @@
if (supported == null) {
reportFeatureNotRecognized(featureName);
}
- return supported;
+ return supported.booleanValue();
}
/* (non-Javadoc)
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -59,6 +59,7 @@
*/
public void setType(Topic type) {
Check.typeNotNull(this, type);
+ Check.sameTopicMap(this, type);
if (_type == type) {
return;
}
@@ -77,6 +78,7 @@
* @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic)
*/
public void setReifier(Topic reifier) {
+ Check.sameTopicMap(this, reifier);
if (_reifier == reifier) {
return;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -21,6 +21,7 @@
import org.tmapi.core.Locator;
import org.tmapi.core.ModelConstraintException;
import org.tmapi.core.Topic;
+import org.tmapi.core.TopicMap;
/**
* Provides various argument constraint checks.
@@ -41,11 +42,20 @@
* @param sender The sender
* @param msg The error message
*/
- private static void _reportError(Construct sender, String msg) {
+ private static void _reportModelConstraintViolation(Construct sender, String msg) {
throw new ModelConstraintException(sender, msg);
}
/**
+ *
+ *
+ * @param msg
+ */
+ private static void _reportIllegalArgument(String msg) {
+ throw new IllegalArgumentException(msg);
+ }
+
+ /**
* Throws a {@link ModelConstraintException} iff the <tt>scope</tt> is
* <tt>null</tt>.
*
@@ -54,7 +64,7 @@
*/
public static void scopeNotNull(Construct sender, Topic[] scope) {
if (scope == null) {
- _reportError(sender, "The scope must not be null");
+ _reportModelConstraintViolation(sender, "The scope must not be null");
}
}
@@ -67,7 +77,7 @@
*/
public static void scopeNotNull(Construct sender, Collection<Topic> scope) {
if (scope == null) {
- _reportError(sender, "The scope must not be null");
+ _reportModelConstraintViolation(sender, "The scope must not be null");
}
}
@@ -80,7 +90,7 @@
*/
public static void typeNotNull(Construct sender, Topic type) {
if (type == null) {
- _reportError(sender, "The type must not be null");
+ _reportModelConstraintViolation(sender, "The type must not be null");
}
}
@@ -93,7 +103,7 @@
*/
public static void valueNotNull(Construct sender, Object value) {
if (value == null) {
- _reportError(sender, "The value must not be null");
+ _reportModelConstraintViolation(sender, "The value must not be null");
}
}
@@ -108,7 +118,7 @@
public static void valueNotNull(Construct sender, Object value, Locator datatype) {
valueNotNull(sender, value);
if (datatype == null) {
- _reportError(sender, "The datatype must not be null");
+ _reportModelConstraintViolation(sender, "The datatype must not be null");
}
}
@@ -121,8 +131,147 @@
*/
public static void playerNotNull(Construct sender, Topic player) {
if (player == null) {
- _reportError(sender, "The role player must not be null");
+ _reportModelConstraintViolation(sender, "The role player must not be null");
}
}
+ /**
+ * Throws a {@link ModelConstraintException} iff the <tt>iid</tt> is
+ * <tt>null</tt>.
+ *
+ * @param sender The sender
+ * @param iid The item identifier.
+ */
+ public static void itemIdentifierNotNull(Construct sender, Locator iid) {
+ if (iid == null) {
+ _reportModelConstraintViolation(sender, "The item identifier must not be null");
+ }
+ }
+
+ /**
+ * Throws a {@link ModelConstraintException} iff the <tt>sid</tt> is
+ * <tt>null</tt>.
+ *
+ * @param sender The sender
+ * @param sid The subject identifier.
+ */
+ public static void subjectIdentifierNotNull(Construct sender, Locator sid) {
+ if (sid == null) {
+ _reportModelConstraintViolation(sender, "The subject identifier must not be null");
+ }
+ }
+
+ /**
+ * Throws a {@link ModelConstraintException} iff the <tt>slo</tt> is
+ * <tt>null</tt>.
+ *
+ * @param sender The sender
+ * @param slo The subject locator.
+ */
+ public static void subjectLocatorNotNull(Construct sender, Locator slo) {
+ if (slo == null) {
+ _reportModelConstraintViolation(sender, "The subject locator must not be null");
+ }
+ }
+
+ /**
+ * Throws an {@link ModelConstraintException} iff the <tt>theme</tt> is
+ * <tt>null</tt>.
+ *
+ * @param theme The theme.
+ */
+ public static void themeNotNull(Construct sender, Topic theme) {
+ if (theme == null) {
+ _reportModelConstraintViolation(sender, "The theme must not be null");
+ }
+ }
+
+ /**
+ * Reports a {@link ModelConstraintException} iff the <tt>sender<tt> and
+ * the <tt>construct</tt> do not belong to the same topic map.
+ *
+ * @param sender The sender.
+ * @param construct The construct.
+ */
+ public static void sameTopicMap(Construct sender, Construct construct) {
+ if (construct == null) {
+ return;
+ }
+ _sameTopicMap(sender, sender.getTopicMap(), construct);
+ }
+
+ public static void sameTopicMap(Construct sender, Construct...constructs) {
+ if (constructs == null || constructs.length == 0) {
+ return;
+ }
+ TopicMap tm = sender.getTopicMap();
+ for (Construct construct: constructs) {
+ _sameTopicMap(sender, tm, construct);
+ }
+ }
+
+ public static void sameTopicMap(Construct sender, Collection<? extends Construct> constructs) {
+ if (constructs == null) {
+ return;
+ }
+ TopicMap tm = sender.getTopicMap();
+ for (Construct construct: constructs) {
+ _sameTopicMap(sender, tm, construct);
+ }
+ }
+
+ private static void _sameTopicMap(Construct sender, TopicMap tm, Construct other) {
+ if (!tm.equals(other.getTopicMap())) {
+ _reportModelConstraintViolation(sender, "All constructs must belong to the same topic map");
+ }
+ }
+
+ /**
+ * Throws an {@link IllegalArgumentException} iff the <tt>type</tt> is
+ * <tt>null</tt>.
+ *
+ * @param type The type.
+ */
+ public static void typeNotNull(Topic type) {
+ if (type == null) {
+ _reportIllegalArgument("The type must not be null");
+ }
+ }
+
+ /**
+ * Reports an {@link IllegalArgumentException} iff the <tt>sid</tt> is
+ * <tt>null</tt>.
+ *
+ * @param sid The subject identifier.
+ */
+ public static void subjectIdentifierNotNull(Locator sid) {
+ if (sid == null) {
+ _reportIllegalArgument("The subject identifier must not be null");
+ }
+ }
+
+ /**
+ * Reports an {@link IllegalArgumentException} iff the <tt>slo</tt> is
+ * <tt>null</tt>.
+ *
+ * @param slo The subject locator.
+ */
+ public static void subjectLocatorNotNull(Locator slo) {
+ if (slo == null) {
+ _reportIllegalArgument("The subject locator must not be null");
+ }
+ }
+
+ /**
+ * Reports an {@link IllegalArgumentException} iff the <tt>iid</tt> is
+ * <tt>null</tt>.
+ *
+ * @param iid The item identifier.
+ */
+ public static void itemIdentifierNotNull(Locator iid) {
+ if (iid == null) {
+ _reportIllegalArgument("The item identifier must not be null");
+ }
+ }
+
}
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-05-13 15:02:57 UTC (rev 298)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-07-02 11:07:24 UTC (rev 299)
@@ -36,92 +36,98 @@
// Topic types
- public static final Locator TOPIC_TYPE = _createLocator(_BASE + "topictype");
+ public static final Locator TOPIC_TYPE = _createLocator(_BASE + "topic-type");
- public static final Locator ASSOCIATION_TYPE = _createLocator(_BASE + "associationtype");
+ public static final Locator ASSOCIATION_TYPE = _createLocator(_BASE + "association-type");
- public static final Locator ROLE_TYPE = _createLocator(_BASE + "roletype");
+ public static final Locator ROLE_TYPE = _createLocator(_BASE + "role-type");
- public static final Locator OCCURRENCE_TYPE = _createLocator(_BASE + "occurrencetype");
+ public static final Locator OCCURRENCE_TYPE = _createLocator(_BASE + "occurrence-type");
- public static final Locator NAME_TYPE = _createLocator(_BASE + "nametype");
+ public static final Locator NAME_TYPE = _createLocator(_BASE + "name-type");
- public static final Locator SCOPE_TYPE = _createLocator(_BASE + "scopetype");
+ public static final Locator SCOPE_TYPE = _createLocator(_BASE + "scope-type");
// Role types
+ public static final Locator ALLOWS = _createLocator(_BASE + "allows");
+
+ public static final Locator ALLOWED = _createLocator(_BASE + "allowed");
+
+ public static final Locator CONSTRAINS = _createLocator(_BASE + "constrains");
+
+ public static final Locator CONSTRAINED = _createLocator(_BASE + "constrained");
- public static final Locator TOPIC_TYPE_ROLE = _createLocator(_BASE + "topictype-role");
-
- public static final Locator ASSOCIATION_TYPE_ROLE = _createLocator(_BASE + "associationtype-role");
-
- public static final Locator ROLE_TYPE_ROLE = _createLocator(_BASE + "roletype-role");
-
- public static final Locator OTHERROLE_TYPE_ROLE = _createLocator(_BASE + "roletype-role");
-
- public static final Locator OCCURRENCE_TYPE_ROLE = _createLocator(_BASE + "occurrencetype-role");
-
- public static final Locator NAME_TYPE_ROLE = _createLocator(_BASE + "nametype-role");
-
- public static final Locator SCOPE_TYPE_ROLE = _createLocator(_BASE + "scopetype-role");
-
- public static final Locator CONSTRAINT_ROLE = _createLocator(_BASE + "constraint-role");
-
-
+ // Association types - applies-to is no more
+ public static final Locator CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "constrained-topic-type");
+
+ public static final Locator CONSTRAINED_STATEMENT = _createLocator(_BASE + "constrained-statement");
+
+ public static final Locator CONSTRAINED_ROLE = _createLocator(_BASE + "constrained-role");
+
+ public static final Locator OVERLAPS = _createLocator(_BASE + "overlaps");
+
+ public static final Locator ALLOWED_SCOPE = _createLocator(_BASE + "allowed-scope");
+
+ public static final Locator ALLOWED_REIFIER = _createLocator(_BASE + "allowed-reifier");
+
+ public static final Locator OTHER_CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "other-constrained-topic-type");
+
+ public static final Locator OTHER_CONSTRAINED_ROLE = _createLocator(_BASE + "other-constrained-role");
+
+ public static final Locator BELONGS_TO_SCHEMA = _createLocator(_BASE + "belongs-to-schema");
+
// Model topics
+
+ public static final Locator SCHEMA = _createLocator(_BASE + "schema");
+
public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint");
public static final Locator VALIDATION_EXPRESSION = _createLocator(_BASE + "validation-expression");
- public static final Locator APPLIES_TO = _createLocator(_BASE + "applies-to");
-
public static final Locator CARD_MIN = _createLocator(_BASE + "card-min");
public static final Locator CARD_MAX = _createLocator(_BASE + "card-max");
- //TODO: TMCL uses sometimes "regexp" and sometimes "reg-exp"
- public static final Locator REGEXP = _createLocator(_BASE + "reg-exp");
+ public static final Locator REGEXP = _createLocator(_BASE + "regexp");
public static final Locator DATATYPE = _createLocator(_BASE + "datatype");
+
+ public static final Locator VERSION = _createLocator(_BASE + "version");
+ public static final Locator DESCRIPTION = _createLocator(_BASE + "description");
+
+ public static final Locator COMMENT = _createLocator(_BASE + "comment");
+
+ public static final Locator SEE_ALSO = _createLocator(_BASE + "see-also");
// Constraint types
- public static final Locator TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "topictype-constraint");
+
+ public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "abstract-constraint");
+
+ public static final Locator OVERLAP_DECLARATION = _createLocator(_BASE + "overlap-declaration");
+
+ public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subject-identifier-constraint");
- public static final Locator ASSOCIATION_TYPE_CONSTRAINT = _createLocator(_BASE + "associationtype-constraint");
+ public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subject-locator-constraint");
+
+ public static final Locator TOPIC_NAME_CONSTRAINT = _createLocator(_BASE + "topic-name-constraint");
+
+ public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topic-occurrence-constraint");
+
+ public static final Locator ROLE_PLAYER_CONSTRAINT = _createLocator(_BASE + "role-player-constraint");
+
+ public static final Locator SCOPE_CONSTRAINT = _createLocator(_BASE + "scope-constraint");
+
+ public static final Locator REIFIER_CONSTRAINT = _createLocator(_BASE + "reifier-constraint");
- public static final Locator ROLE_TYPE_CONSTRAINT = _createLocator(_BASE + "roletype-constraint");
+ public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "association-role-constraint");
+
+ public static final Locator OTHER_ROLE_CONSTRAINT = _createLocator(_BASE + "other-role-constraint");
+
+ public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrence-datatype-constraint");
- public static final Locator OCCURRENCE_TYPE_CONSTRAINT = _createLocator(_BASE + "occurrencetype-constraint");
-
- public static final Locator NAME_TYPE_CONSTRAINT = _createLocator(_BASE + "nametype-constraint");
-
- public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "abstract-topictype-constraint");
+ public static final Locator UNIQUE_VALUE_CONSTRAINT = _createLocator(_BASE + "unique-value-constraint");
- public static final Locator EXCLUSIVE_INSTANCE = _createLocator(_BASE + "exclusive-instance");
-
- public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subjectidentifier-constraint");
-
- public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subjectlocator-constraint");
-
- public static final Locator NAME_CONSTRAINT = _createLocator(_BASE + "topicname-constraint");
-
- public static final Locator NAME_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "nametypescope-constraint");
-
- public static final Locator OCCURRENCE_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "occurrencetypescope-constraint");
-
- public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrencedatatype-constraint");
-
- public static final Locator ASSOCIATION_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "associationtypescope-constraint");
-
- public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "associationrole-constraint");
-
- public static final Locator ROLE_PLAYER_CONSTRAINT = _createLocator(_BASE + "roleplayer-constraint");
-
- public static final Locator OTHERROLE_CONSTRAINT = _createLocator(_BASE + "otherrole-constraint");
-
- public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topicoccurrence-constraint");
-
- public static final Locator UNIQUE_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "uniqueoccurrence-constraint");
-
+ public static final Locator REGULAR_EXPRESSION_CONSTRAINT = _createLocator(_BASE + "regular-expression-constraint");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|