/** * Adds a new package to this container that will contain the specified * annotation. If the package already exists, then the annotation is only added * to this package. * * @param annotation the new annotation */ private void addPackage(final FileAnnotation annotation) { String packageName; if (annotation.hasPackageName()) { packageName = annotation.getPackageName(); } else { packageName = annotation.getPathName(); } if (StringUtils.isBlank(packageName)) { packageName = "-"; } if (!packagesByName.containsKey(packageName)) { JavaPackage javaPackage = new JavaPackage(packageName); packagesByName.put(packageName, javaPackage); packagesByHashCode.put(packageName.hashCode(), javaPackage); } packagesByName.get(packageName).addAnnotation(annotation); }
/** * Returns the package category title for the scanned files. * * @return the package category title for the scanned files */ public final String getPackageCategoryTitle() { if (hasAnnotations()) { FileAnnotation annotation = getAnnotations().iterator().next(); String fileName = annotation.getFileName(); if (fileName.endsWith(".cs")) { return Messages.NamespaceDetail_title(); } if (annotation.hasPackageName()) { return Messages.PackageDetail_title(); } else { return Messages.PathDetail_title(); } } return Messages.PackageDetail_title(); }
/** * Returns the package category name for the scanned files. Currently, only * java and c# files are supported. * * @return the package category name for the scanned files */ public final String getPackageCategoryName() { if (hasAnnotations()) { FileAnnotation annotation = getAnnotations().iterator().next(); String fileName = annotation.getFileName(); if (fileName.endsWith(".cs")) { return Messages.NamespaceDetail_header(); } if (annotation.hasPackageName()) { return Messages.PackageDetail_header(); } else { return Messages.PathDetail_header(); } } return Messages.PackageDetail_header(); }
/** * Returns the package category title for the scanned files. * * @return the package category title for the scanned files */ public final String getPackageCategoryTitle() { if (hasAnnotations()) { FileAnnotation annotation = getAnnotations().iterator().next(); String fileName = annotation.getFileName(); if (fileName.endsWith(".cs")) { return Messages.NamespaceDetail_title(); } if (annotation.hasPackageName()) { if (annotation.hasOverridePackageCategoryTitle()) { return annotation.getOverridePackageCategoryTitle(); } return Messages.PackageDetail_title(); } else { return Messages.PathDetail_title(); } } return Messages.PackageDetail_title(); }
/** * Returns the package category name for the scanned files. Currently, only * java and c# files are supported. * * @return the package category name for the scanned files */ public final String getPackageCategoryName() { if (hasAnnotations()) { FileAnnotation annotation = getAnnotations().iterator().next(); String fileName = annotation.getFileName(); if (fileName.endsWith(".cs")) { return Messages.NamespaceDetail_header(); } if (annotation.hasPackageName()) { if (annotation.hasOverridePackageCategoryName()) { return annotation.getOverridePackageCategoryName(); } return Messages.PackageDetail_header(); } else { return Messages.PathDetail_header(); } } return Messages.PackageDetail_header(); }