/** * Returns a dummy object for unknown authors. * * @return unknown author dummy */ public static Author unknown() { return new Author(AbstractAnnotation.DEFAULT_CATEGORY, AbstractAnnotation.DEFAULT_CATEGORY, AbstractAnnotation.DEFAULT_CATEGORY, AbstractAnnotation.DEFAULT_CATEGORY, Hierarchy.USER); } }
/** * Creates a new instance of {@code AuthorDetail}. * * @param owner current build as owner of this action. * @param detailFactory factory to create detail objects with * @param authorContainer the author to show the details for * @param defaultEncoding the default encoding to be used when reading and parsing files * @param header header to be shown on detail page */ public AuthorDetail(final Run<?, ?> owner, final DetailFactory detailFactory, final Author authorContainer, final String defaultEncoding, final String header) { super(owner, detailFactory, authorContainer.getAnnotations(), defaultEncoding, header, authorContainer.getHierarchy()); this.authorName = authorContainer.getFullName(); this.authorEmail = authorContainer.getEmail(); }
/** * Indexes an annotation by author name. * * @param annotation the new annotation */ private void addAuthorName(final FileAnnotation annotation) { String key = annotation.getAuthor(); if (!authorsByName.containsKey(key)) { Author container = new Author(key, annotation.getAuthorDetails(), annotation.getAuthorName(), annotation.getAuthorEmail(), Hierarchy.USER); authorsByName.put(key, container); authorsByHashCode.put(key.hashCode(), container); } authorsByName.get(key).addAnnotation(annotation); }