Subversion Repositories aduna

Compare Revisions

Rev 11523 → Rev 11492

src/main/java/org/openrdf/repository/object/managers/RoleMapper.java
70,7 → 70,6
256);
private RoleMatcher matches = new RoleMatcher();
private Map<Method, URI> annotations = new HashMap<Method, URI>();
private Map<URI, Method> annotationURIs = new HashMap<URI, Method>();
private Map<Class<?>, Class<?>> complements;
private Map<Class<?>, List<Class<?>>> intersections;
private Set<Class<?>> conceptClasses = new HashSet<Class<?>>();
93,7 → 92,6
cloned.instances = clone(instances);
cloned.matches = matches.clone();
cloned.annotations = new HashMap<Method, URI>(annotations);
cloned.annotationURIs = new HashMap<URI, Method>(annotationURIs);
cloned.complements = new ConcurrentHashMap<Class<?>, Class<?>>(complements);
cloned.intersections = clone(intersections);
cloned.conceptClasses = new HashSet<Class<?>>(conceptClasses);
260,7 → 258,12
}
 
public Method findAnnotationMethod(URI uri) {
return annotationURIs.get(uri);
for (Map.Entry<Method, URI> e : annotations.entrySet()) {
if (e.getValue().equals(uri)) {
return e.getKey();
}
}
return null;
}
 
public boolean isRecordedAnnotation(URI uri) {
283,7 → 286,7
throw new IllegalArgumentException(
"Must specify annotation method if multiple methods exist: "
+ annotation);
addAnnotation(annotation.getDeclaredMethods()[0], uri);
annotations.put(annotation.getDeclaredMethods()[0], uri);
}
 
public void addAnnotation(Method annotation) {
296,13 → 299,6
 
public void addAnnotation(Method annotation, URI uri) {
annotations.put(annotation, uri);
annotationURIs.put(uri, annotation);
if (annotation.isAnnotationPresent(Iri.class)) {
String iri = annotation.getAnnotation(Iri.class).value();
if (!uri.stringValue().equals(iri)) {
addAnnotation(annotation);
}
}
}
 
public void addConcept(Class<?> role) throws ObjectStoreConfigException {