/** * Adds a ome.model.annotations.AnnotationAnnotationLink to annotationLinks, allowing for recursion -- whether * or not addAnnotationAnnotationLink will be called on the addition <b>if it is loaded</b> */ public void addAnnotationAnnotationLink (ome.model.annotations.AnnotationAnnotationLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { throwNullCollectionException("AnnotationLinks"); } getAnnotationLinks().add( link ); }
/** * unlinks all ome.model.annotations.Annotation instances from this instance. */ public void unlinkAnnotation (ome.model.annotations.Annotation removal) { if (! _loaded ) errorIfUnloaded(); java.util.Set<ome.model.annotations.AnnotationAnnotationLink> toRemove = findAnnotationAnnotationLink( removal ); java.util.Iterator<ome.model.annotations.AnnotationAnnotationLink> it = toRemove.iterator(); while ( it.hasNext() ) { removeAnnotationAnnotationLink( it.next(), true ); } }
/** * clears the set. */ public void clearAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); java.util.List<ome.model.annotations.AnnotationAnnotationLink> list = new java.util.ArrayList<ome.model.annotations.AnnotationAnnotationLink>( getAnnotationLinks() ); for (ome.model.annotations.AnnotationAnnotationLink link : list) { removeAnnotationAnnotationLink( link, true ); } }
/** * Returns an unmodifiable collection-view */ public java.util.Collection<ome.model.annotations.AnnotationAnnotationLink> unmodifiableAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return java.util.Collections.emptyList(); } return java.util.Collections.unmodifiableCollection( getAnnotationLinks() ); }
@Override public Object retrieve(String field) { if (field == null) { return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(VERSION)) { return getVersion(); } else if (field.equals(NS)) { return getNs(); } else if (field.equals(NAME)) { return getName(); } else if (field.equals(DESCRIPTION)) { return getDescription(); } else if (field.equals(ANNOTATIONLINKSCOUNTPEROWNER)) { return getAnnotationLinksCountPerOwner(); } else if (field.equals(ANNOTATIONLINKS)) { return getAnnotationLinks(); } else if (field.equals(DETAILS)) { return getDetails(); } else { if (_dynamicFields != null) { return _dynamicFields.get(field); } return null; } }
String at = annotationTypeString(annotation); add(document, "annotation.type", at, opts); if (annotation.getName() != null) { add(document, "annotation.name", annotation.getName(), opts); if (annotation.getNs() != null) { add(document, "annotation.ns", annotation.getNs(), opts); add(document, "tag", textValue, opts); List<Annotation> list2 = annotation .linkedAnnotationList(); for (Annotation annotation2 : list2) { if (annotation2 instanceof TextAnnotation) {
for (Annotation a : sc.getSession().linkedAnnotationList()) { if (a instanceof TextAnnotation) { if (roles.isRootUser(a.getDetails().getOwner())) { if (GROUP_SUDO_NS.equals(a.getNs())) { ta = (TextAnnotation) a;
/** * Main constructor. */ public Annotation (Long id, boolean loaded) { setId(id); if (loaded) { getDetails().setContext(this); } else { if (this.id == null) { throw new ApiUsageException("Id cannot be null for a proxy"); } unload(); } }
.get(ome.model.annotations.Annotation.class, a.getId().getValue()); ns = ann.getNs();
public void setName(java.lang.String name) { if (! _loaded ) errorIfUnloaded(); this.name = (java.lang.String) name; } protected java.lang.String description = null;
/** * produces a {@link java.util.List}-copy of the underlying collection. Unlike, * {@link #linkedAnnotationIterator()}, while using the returned {@link java.util.List}, * modifications can be made to the underlying collection without throwing * {@link java.util.ConcurrentModificationException}. */ public java.util.List<ome.model.annotations.Annotation> linkedAnnotationList() { if (! _loaded ) errorIfUnloaded(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); java.util.List<ome.model.annotations.Annotation> list = new java.util.ArrayList<ome.model.annotations.Annotation>(); while ( it.hasNext() ) { list.add( it.next() ); } return list; }
/** * find all ome.model.annotations.AnnotationAnnotationLink which have the argument as their child. */ public java.util.Set<ome.model.annotations.AnnotationAnnotationLink> findAnnotationAnnotationLink( ome.model.annotations.Annotation target ) { if (! _loaded ) errorIfUnloaded(); final java.util.Iterator<ome.model.annotations.AnnotationAnnotationLink> it = iterateAnnotationLinks(); final java.util.Set<ome.model.annotations.AnnotationAnnotationLink> result = new java.util.HashSet<ome.model.annotations.AnnotationAnnotationLink>(); while ( it.hasNext() ) { ome.model.annotations.AnnotationAnnotationLink link = it.next(); if ( link.child() == target ) { result.add( link ); } } return result; }
/** * Adds a ome.model.annotations.AnnotationAnnotationLink to annotationLinks . This entails changing our annotationLinks Set, * creating a new ome.model.annotations.AnnotationAnnotationLink and calling linkAnnotation on the ome.model.annotations.Annotation. */ public ome.model.annotations.AnnotationAnnotationLink linkAnnotation (ome.model.annotations.Annotation addition) { if (! _loaded ) errorIfUnloaded(); // Setup link ome.model.annotations.AnnotationAnnotationLink link = new ome.model.annotations.AnnotationAnnotationLink(); link.link( this, addition ); // Add it to us and possibly the other side. addAnnotationAnnotationLink( link, true ); return link; }
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
@RolesAllowed("user") @Transactional(readOnly = false) public void deleteComment(@NotNull Annotation comment) { List<SessionAnnotationLink> links = iQuery.findAllByQuery( "select l from SessionAnnotationLink l " + "where l.child.id = :id", new Parameters() .addId(comment.getId())); for (SessionAnnotationLink sessionAnnotationLink : links) { iUpdate.deleteObject(sessionAnnotationLink); } iUpdate.deleteObject(comment); }
.getNs(), useLike, values.caseSensitive);
/** * Use the {@link ome.model.internal.Details#copy(ome.model.internal.Details)} * or {@link ome.model.internal.Details#shallowCopy(ome.model.internal.Details)} * methods to set the {@link Details} instance instead. */ protected void setDetails(ome.model.internal.Details details) { if (! _loaded ) errorIfUnloaded(); this.details = (Details) details; }
/** * should be used rather than accessing the annotationLinks set directly. * This method will never return null, but rather will return an instance * of {@link ome.util.EmptyIterator}. To test for a null collection, * see of {@link #sizeOfAnnotationLinks()} is less than zero. */ public java.util.Iterator<ome.model.annotations.AnnotationAnnotationLink> iterateAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return new ome.util.EmptyIterator<ome.model.annotations.AnnotationAnnotationLink>(); } return getAnnotationLinks().iterator(); // TODO should this be direct access }
/** * takes a CBlock and calls the block once for each ome.model.annotations.Annotation while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> eachLinkedAnnotation(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); while ( it.hasNext() ) { ome.model.annotations.Annotation obj = it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }
/** * takes a CBlock and calls the block once for each ome.model.annotations.AnnotationAnnotationLink while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. This method uses * {@link #iterateAnnotationLinks} internally and so will return a value * even if the underlying collection is null. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> collectAnnotationLinks(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.AnnotationAnnotationLink> it = iterateAnnotationLinks(); while ( it.hasNext() ) { IObject obj = (IObject) it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }