/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Manages the<code>Taglet</code>s used by doclets.
*
* This code is not part of an API.
* It is implementation that is subject to change.
* Do not use it as an API
*
* @author Jamie Ho
* @since 1.4
*/
public class TagletManager {
/**
* The default seperator for the simple tag option.
*/
/**
* The alternate seperator for simple tag options. Use this
* with you want the default seperator to be in the name of the
* custom tag.
*/
/**
* The map of custom tags.
*/
/**
* The array of custom tags that can appear in packages.
*/
/**
* The array of custom tags that can appear in classes or interfaces.
*/
/**
* The array of custom tags that can appear in fields.
*/
/**
* The array of custom tags that can appear in constructors.
*/
/**
* The array of custom tags that can appear in methods.
*/
/**
* The array of custom tags that can appear in the overview.
*/
/**
* The array of custom tags that can appear in comments.
*/
/**
* The array of custom tags that can appear in the serialized form.
*/
/**
* The message retriever that will be used to print error messages.
*/
/**
* Keep track of standard tags.
*/
/**
* Keep track of standard tags in lowercase to compare for better
* error messages when a tag like @docRoot is mistakenly spelled
* lowercase @docroot.
*/
/**
* Keep track of overriden standard tags.
*/
/**
* Keep track of the tags that may conflict
* with standard tags in the future (any custom tag without
* a period in its name).
*/
/**
* The set of unseen custom tags.
*/
/**
* True if we do not want to use @since tags.
*/
private boolean nosince;
/**
* True if we want to use @version tags.
*/
private boolean showversion;
/**
* True if we want to use @author tags.
*/
private boolean showauthor;
/**
* Construct a new <code>TagletManager</code>.
* @param nosince true if we do not want to use @since tags.
* @param showversion true if we want to use @version tags.
* @param showauthor true if we want to use @author tags.
* @param message the message retriever to print warnings.
*/
this.showversion = showversion;
this.showauthor = showauthor;
}
/**
* Add a new <code>CustomTag</code>. This is used to add a Taglet from within
* a Doclet. No message is printed to indicate that the Taglet is properly
* registered because these Taglets are typically added for every execution of the
* Doclet. We don't want to see this type of error message every time.
* @param customTag the new <code>CustomTag</code> to add.
*/
}
}
}
/**
* Add a new <code>Taglet</code>. Print a message to indicate whether or not
* the Taglet was registered properly.
* @param classname the name of the class representing the custom tag.
* @param tagletPath the path to the class representing the custom tag.
*/
try {
// construct class loader
// do prepends to get correct ordering
if (lastTag != newLastTag) {
//New taglets must always be added to the end of the LinkedHashMap.
//If the current and previous last taglet are not equal, that
//means a new Taglet has been added.
if (newLastTag != null) {
}
}
}
}
return path1;
} else {
}
}
/**
* Utility method for converting a search path string to an array
* of directory and JAR file URLs.
*
* @param path the search path string
* @return the resulting array of directory and JAR file URLs
*/
int count = 0;
while (st.hasMoreTokens()) {
}
}
}
return urls;
}
/**
* Returns the directory or JAR file URL corresponding to the specified
* local file name.
*
* @param file the File object
* @return the resulting directory or JAR file URL, or null if unknown
*/
try {
} catch (IOException e) {
}
}
// If the file does not exist, then assume that it's a directory
}
try {
} catch (MalformedURLException e) {
throw new IllegalArgumentException("file");
}
}
/**
* Add a new <code>SimpleTaglet</code>. If this tag already exists
* and the header passed as an argument is null, move tag to the back of the
* list. If this tag already exists and the header passed as an argument is
* not null, overwrite previous tag with new one. Otherwise, add new
* SimpleTaglet to list.
* @param tagName the name of this tag
* @param header the header to output.
* @param locations the possible locations that this tag
* can appear in.
*/
return;
}
}
} else {
//Move to back
}
}
/**
* Given a tag name, add it to the set of tags it belongs to.
*/
} else {
}
}
}
/**
* Check the taglet to see if it is a legacy taglet. Also
* check its name for errors.
*/
} else {
throw new IllegalArgumentException("Given object is not a taglet.");
}
}
/**
* Given a name of a seen custom tag, remove it from the set of unseen
* custom tags.
* @param name the name of the seen custom tag.
*/
}
/**
* Given an array of <code>Tag</code>s, check for spelling mistakes.
* @param doc the Doc object that holds the tags.
* @param tags the list of <code>Tag</code>s to check.
* @param areInlineTags true if the array of tags are inline and false otherwise.
*/
return;
}
}
continue;
} else {
continue;
}
}
//Check if this tag is being used in the wrong location.
}
}
}
}
}
/**
* Given the taglet, the tag and the type of documentation that the tag
* was found in, print a tag misuse warning.
* @param taglet the taglet representing the misused tag.
* @param tag the misused tag.
* @param holderType the type of documentation that the misused tag was found in.
*/
if (taglet.inOverview()) {
}
}
}
if (taglet.inConstructor()) {
}
}
}
if (taglet.isInlineTag()) {
}
//This known tag is excluded.
return;
}
if (i > 0) {
}
}
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in packages.
* @return the array of <code>Taglet</code>s that can
* appear in packages.
*/
if (packageTags == null) {
}
return packageTags;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in classes or interfaces.
* @return the array of <code>Taglet</code>s that can
* appear in classes or interfaces.
*/
}
return typeTags;
}
/**
* Return the array of inline <code>Taglet</code>s that can
* appear in comments.
* @return the array of <code>Taglet</code>s that can
* appear in comments.
*/
if (inlineTags == null) {
}
return inlineTags;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in fields.
* @return the array of <code>Taglet</code>s that can
* appear in field.
*/
}
return fieldTags;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in the serialized form.
* @return the array of <code>Taglet</code>s that can
* appear in the serialized form.
*/
if (serializedFormTags == null) {
}
return serializedFormTags;
}
/**
* @return the array of <code>Taglet</code>s that can
* appear in the given Doc.
*/
if (doc instanceof ConstructorDoc) {
return getConstructorCustomTags();
return getMethodCustomTags();
return getFieldCustomTags();
return getTypeCustomTags();
} else if (doc instanceof PackageDoc) {
return getPackageCustomTags();
return getOverviewCustomTags();
}
return null;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in constructors.
* @return the array of <code>Taglet</code>s that can
* appear in constructors.
*/
if (constructorTags == null) {
}
return constructorTags;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in methods.
* @return the array of <code>Taglet</code>s that can
* appear in methods.
*/
if (methodTags == null) {
}
return methodTags;
}
/**
* Return the array of <code>Taglet</code>s that can
* appear in an overview.
* @return the array of <code>Taglet</code>s that can
* appear in overview.
*/
if (overviewTags == null) {
}
return overviewTags;
}
/**
* Initialize the custom tag arrays.
*/
private void initCustomTagArrays() {
}
}
}
}
}
if (current.isInlineTag()) {
}
}
}
//Init the serialized form tags
if (!nosince)
}
/**
* Initialize standard Javadoc tags for ordering purposes.
*/
private void initStandardTags() {
if (!nosince) {
}
if (showversion) {
}
if (showauthor) {
}
//Standard inline tags
temp);
temp);
//Keep track of the names of standard tags for error
//checking purposes.
}
/**
* Initialize lowercase version of standard Javadoc tags.
*/
private void initStandardTagsLowercase() {
}
}
}
/**
* Print a list of {@link Taglet}s that might conflict with
* standard tags in the future and a list of standard tags
* that have been overriden.
*/
public void printReport() {
}
result += ", ";
}
}
}
}
/**
* Given the name of a tag, return the corresponding taglet.
* Return null if the tag is unknown.
*
* @param name the name of the taglet to retrieve.
* @return return the corresponding taglet. Return null if the tag is
* unknown.
*/
} else {
}
}
}