/*
* 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.
*/
/**
* Represents a java program element: class, interface, field,
* constructor, or method.
* This is an abstract class dealing with information common to
* these elements.
*
* @see MemberDocImpl
* @see ClassDocImpl
*
* @author Robert Field
* @author Neal Gafter (rewrite)
* @author Scott Seligman (generics, enums, annotations)
*/
public abstract class ProgramElementDocImpl
extends DocImpl implements ProgramElementDoc {
// For source position information.
// Cache for getModifiers().
}
}
/**
* Subclasses override to identify the containing class
*/
/**
* Returns the flags in terms of javac's flags
*/
abstract protected long getFlags();
/**
* Returns the modifier flags in terms of java.lang.reflect.Modifier.
*/
protected int getModifiers() {
if (modifiers == -1) {
}
return modifiers;
}
/**
* Get the containing class of this program element.
*
* @return a ClassDocImpl for this element's containing class.
* If this is a class with no outer class, return null.
*/
if (getContainingClass() == null) {
return null;
}
}
/**
* Return the package that this member is contained in.
* Return "" if in unnamed package.
*/
}
/**
* Get the modifier specifier integer.
*
* @see java.lang.reflect.Modifier
*/
public int modifierSpecifier() {
int modifiers = getModifiers();
// Remove the implicit abstract modifier.
return modifiers;
}
/**
* Get modifiers string.
* <pre>
* Example, for:
* public abstract int foo() { ... }
* modifiers() would return:
* 'public abstract'
* </pre>
* Annotations are not included.
*/
int modifiers = getModifiers();
if (isAnnotationTypeElement() ||
// Remove the implicit abstract modifier.
} else {
}
}
/**
* Get the annotations of this program element.
* Return an empty array if there are none.
*/
int i = 0;
}
return res;
}
/**
* Return true if this program element is public
*/
public boolean isPublic() {
int modifiers = getModifiers();
}
/**
* Return true if this program element is protected
*/
public boolean isProtected() {
int modifiers = getModifiers();
}
/**
* Return true if this program element is private
*/
public boolean isPrivate() {
int modifiers = getModifiers();
}
/**
* Return true if this program element is package private
*/
public boolean isPackagePrivate() {
}
/**
* Return true if this program element is static
*/
public boolean isStatic() {
int modifiers = getModifiers();
}
/**
* Return true if this program element is final
*/
public boolean isFinal() {
int modifiers = getModifiers();
}
/**
* Generate a key for sorting.
*/
// System.out.println("COLLATION KEY FOR " + this + " is \"" + k + "\"");
}
}