/org.openrdf/alibaba/trunk/object-composition
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<?>>(); |
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); |
} |
|
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) { |
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) { |
|
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 { |