/** * Returns the {@link IApiJavadocTag} that has the given id or * <code>null</code> if there is no tag with the given id * * @param id the id of the tag to fetch * @return the {@link IApiJavadocTag} with the given id or <code>null</code> */ public synchronized IApiJavadocTag getTag(String id) { initializeJavadocTags(); return tagcache.get(id); }
/** * Returns the complete listing of {@link IApiJavadocTag}s contained in the * manager or an empty array, never <code>null</code> * * @return the complete listing of tags in the manager or <code>null</code> */ public synchronized IApiJavadocTag[] getAllTags() { initializeJavadocTags(); if (tagcache == null) { return new IApiJavadocTag[0]; } Collection<IApiJavadocTag> values = tagcache.values(); return values.toArray(new IApiJavadocTag[values.size()]); }
/** * Returns all of the java doc tags for a given kind of type and member. See * {@link IApiJavadocTag} for a complete listing of tag Java type and member * types. * * @param type one of <code>CLASS</code> or <code>INTERFACE</code> * @param member one of <code>METHOD</code> or <code>FIELD</code> or * <code>NONE</code> * @return an array of {@link IApiJavadocTag}s that apply to the specified * Java type or an empty array, never <code>null</code> */ public synchronized IApiJavadocTag[] getTagsForType(int type, int member) { initializeJavadocTags(); List<IApiJavadocTag> list = new ArrayList<>(); for (IApiJavadocTag tag : tags) { if (tag.isApplicable(type, member)) { list.add(tag); } } return list.toArray(new IApiJavadocTag[list.size()]); }
/** * Returns the restriction modifier set on the javadoc tag with the given * name. If the manager has no entry for the specified tag name * <code>-1</code> is returned. * * @param tagname the name of the tag * @param type one of <code>CLASS</code> or <code>INTERFACE</code> * @param member one of <code>METHOD</code> or <code>FIELD</code> or * <code>NONE</code> * @return the restriction modifier for the given tag name or * {@link RestrictionModifiers#NO_RESTRICTIONS} if not found */ public synchronized int getRestrictionsForTag(String tagname, int type, int member) { if (tagname == null) { return RestrictionModifiers.NO_RESTRICTIONS; } initializeJavadocTags(); for (IApiJavadocTag tag : tags) { if (tag.getTagName().equals(tagname) && (tag.isApplicable(type, member))) { return tag.getRestrictionModifier(); } } return RestrictionModifiers.NO_RESTRICTIONS; } }