123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This file is part of the debugger and core tools for the AspectJ(tm)
- * programming language; see http://aspectj.org
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is AspectJ.
- *
- * The Initial Developer of the Original Code is Xerox Corporation. Portions
- * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
- * All Rights Reserved.
- */
- package org.aspectj.tools.ajdoc;
-
- import org.aspectj.ajdoc.Doc;
-
- import com.sun.javadoc.SeeTag;
- import com.sun.javadoc.Tag;
-
- import java.util.Locale;
-
- public abstract class DocImpl
- implements org.aspectj.ajdoc.Doc {
-
- /** Keep track of whether this is included or not. */
- private boolean isIncluded = true;
-
- /** The comment for this Doc. */
- private Comment comment;
-
- /** The error printer for this Doc. */
- private ErrPrinter err;
-
- /** Keep track of whether this is included or not. */
- private boolean isInterface = true;
-
- /** The locale of the object -- default to <code>Locale.US</code>. */
- private Locale locale = Locale.US; //TODO
-
- /**
- * Returns the locale.
- *
- * @return the locale.
- */
- public Locale locale() { //XXX
- return locale;
- }
-
-
- public void setErr(ErrPrinter err) { this.err = err; }
- public ErrPrinter err() { return ErrPrinter.instance; }
-
- public void setComment(Comment comment) { this.comment = comment; }
- public Comment getComment() { return comment; }
-
- /**
- * Delegates to {@link Util#compareTo(Object)} to compare
- * with another Object.
- *
- * @return a negative integer, zero, or a positive integer
- * as this object is less than, equal to, or greater
- * than the specified object based on name.
- * @see java.lang.Comparable.compareTo(Object)
- */
- public int compareTo(Object other) {
- return other instanceof Doc
- ? Util.compareTo(this, (Doc)other)
- : -1;
- }
-
- /**
- * Returns the Tags that comprise the first
- * sentence of the comment.
- *
- * @return an array of Tag representing the first
- * sentence of the comment.
- */
- public Tag[] firstSentenceTags() {
- return getComment() != null
- ? getComment().firstSentenceTags()
- : new Tag[0];
- }
-
- /**
- * Returns the full unprocessed text of the comment.
- *
- * @return the full unprocessed text of the comment.
- */
- public String getRawCommentText() {
- return getComment() != null
- ? getComment().rawCommentText()
- : "";
- }
-
- /**
- * Sets the full unprocessed text of the comment.
- *
- * @param rawCommentText the new full unprocessed text of the comment..
- */
- public void setRawCommentText(String rawCommentText) {
- if (getComment() != null) {
- getComment().setRawCommentText(rawCommentText);
- }
- }
-
- /**
- * Returns the comment as an array of Tag.
- *
- * @return an array of Tag representing the comment.
- */
- public Tag[] inlineTags() {
- return getComment() != null
- ? getComment().inlineTags()
- : new Tag[0];
- }
-
- /**
- * Returns the see tags of the comment.
- *
- * @return an array of SeeTag representing the
- * see tags of the comment.
- */
- public SeeTag[] seeTags() {
- return getComment() != null
- ? getComment().seeTags()
- : new SeeTag[0];
- }
-
- /**
- * Returns all tags of the comment.
- *
- * @return an array of Tag representing all
- * tags of the comment.
- */
- public Tag[] tags() {
- return getComment() != null
- ? getComment().tags()
- : new Tag[0];
- }
-
- /**
- * Returns all tags of the comment whose name equals
- * <code>tagname</code>.
- *
- * @return an array of Tag representing all tags of the
- * comment whose name equals <code>tagname</code>.
- */
- public Tag[] tags(String tagname) {
- return getComment() != null
- ? getComment().tags(tagname)
- : new Tag[0];
- }
-
- /**
- * Returns the commext text for non-null comments,
- * otherwise the empty String.
- *
- * @return non-null comment text.
- */
- public String commentText() {
- return getComment() != null
- ? getComment().commentText()
- : "";
- }
-
- /**
- * Sets <code>isIncluded</code>.
- *
- * @param isIncluded the new value of <code>isIncluded</code>.
- */
- public void setIncluded(boolean isIncluded) {
- this.isIncluded = isIncluded;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <code>false</code> by default.
- */
- public boolean isClass() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <code>false</code> by default.
- */
- public boolean isConstructor() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <code>false</code> by default.
- */
- public boolean isError() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <code>false</code> by default.
- */
- public boolean isException() {
- return false;
- }
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isField() {
- return false;
- }
- /**
- * Returns <code>isIncluded</code> by default.
- *
- * @return <codesIncluded</code> by default./
- */
- public boolean isIncluded() {
- return isIncluded;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isInterface() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isMethod() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isOrdinaryClass() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isPointcut() {
- return false;
- }
-
- /**
- * Returns <code>false</code> by default.
- *
- * @return <codealse</code> by default./
- */
- public boolean isAdvice() {
- return false;
- }
- }
|