private <C extends Collection<URI>> C getTypes(Class<?> role, C set) throws RepositoryException { URI type = of.getNameOf(role); if (type == null) { Class<?> superclass = role.getSuperclass(); if (superclass != null) { getTypes(superclass, set); } Class<?>[] interfaces = role.getInterfaces(); for (int i = 0, n = interfaces.length; i < n; i++) { getTypes(interfaces[i], set); } } else { set.add(type); } return set; }
private <C extends Collection<URI>> C getTypes(Class<?> role, C set) throws RepositoryException { URI type = of.getNameOf(role); if (type == null) { Class<?> superclass = role.getSuperclass(); if (superclass != null) { getTypes(superclass, set); } Class<?>[] interfaces = role.getInterfaces(); for (int i = 0, n = interfaces.length; i < n; i++) { getTypes(interfaces[i], set); } } else { set.add(type); } return set; }
/** * Explicitly adds the concept to the entity. * * @return the entity with new composed concept */ public <T> T addDesignation(Object entity, Class<T> concept) throws RepositoryException { if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignation(delegate, concept); } } Resource resource = findResource(entity); Set<URI> types = new HashSet<URI>(4); getTypes(entity.getClass(), types); addConcept(resource, concept, types); Object bean = of.createObject(resource, types); assert assertConceptRecorded(bean, concept); return (T) bean; }
/** * Explicitly adds the concept to the entity. * * @return the entity with new composed concept */ public <T> T addDesignation(Object entity, Class<T> concept) throws RepositoryException { if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignation(delegate, concept); } } Resource resource = findResource(entity); Set<URI> types = new HashSet<URI>(4); getTypes(entity.getClass(), types); addConcept(resource, concept, types); RDFObject bean = of.createObject(resource, types); assert assertConceptRecorded(bean, concept); return (T) cache(bean); }
Set<URI> list = getTypes(proxy, new HashSet<URI>(4)); for (URI type : list) { types.addTypeStatement(resource, type);
Resource resource = findResource(entity); Set<URI> list = new HashSet<URI>(4); getTypes(entity.getClass(), list); boolean autoCommit = isAutoCommit(); if (autoCommit) {
Set<URI> list = getTypes(proxy, new HashSet<URI>(4)); for (URI type : list) { types.addTypeStatement(resource, type);
Resource resource = findResource(entity); Set<URI> list = new HashSet<URI>(4); getTypes(entity.getClass(), list); boolean autoCommit = isAutoCommit(); if (autoCommit) {