public void addBehaviour(Class<?> role, URI type) throws ObjectStoreConfigException { assertBehaviour(role); recordRole(role, null, type, true, false, false); }
public void addBehaviour(Class<?> role, URI type) throws ObjectStoreConfigException { assertBehaviour(role); recordRole(role, null, type, true, false, false); }
public void addBehaviour(Class<?> role) throws ObjectStoreConfigException { assertBehaviour(role); boolean hasType = false; for (Class<?> face : role.getInterfaces()) { boolean recorded = recordRole(role, face, null, true, false, false); if (recorded && hasType) { throw new ObjectStoreConfigException(role.getSimpleName() + " can only implement one concept"); } else { hasType |= recorded; } } if (!hasType) throw new ObjectStoreConfigException(role.getSimpleName() + " must implement a concept or mapped explicitly"); }
public void addBehaviour(Class<?> role) throws ObjectStoreConfigException { assertBehaviour(role); boolean hasType = false; for (Class<?> face : role.getInterfaces()) { boolean recorded = recordRole(role, face, null, true, false, false); if (recorded && hasType) { throw new ObjectStoreConfigException(role.getSimpleName() + " can only implement one concept"); } else { hasType |= recorded; } } if (!hasType) throw new ObjectStoreConfigException(role.getSimpleName() + " must implement a concept or mapped explicitly"); }
private void recordMixins(Class<?> role, Class<?> elm, URI rdfType) throws ObjectStoreConfigException { Mixin mixin = role.getAnnotation(Mixin.class); if (mixin != null) { for (Class<?> mix : mixin.value()) { assertBehaviour(mix); recordRole(mix, elm, rdfType, true, false, false); } for (String name : mixin.name()) { Classpath cp = role.getAnnotation(Classpath.class); String[] jars = cp == null ? new String[0] : cp.value(); Class<?> mix = findClass(name, role.getClassLoader(), jars, role); if (mix != null) { assertBehaviour(mix); recordRole(mix, elm, rdfType, true, false, false); } else { logger.error("Could not find {} in {}", name, jars); } } } }