本文整理汇总了Java中sun.tools.java.ClassDefinition.getFirstMember方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDefinition.getFirstMember方法的具体用法?Java ClassDefinition.getFirstMember怎么用?Java ClassDefinition.getFirstMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.java.ClassDefinition
的用法示例。
在下文中一共展示了ClassDefinition.getFirstMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkMethods
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
private boolean checkMethods(ClassDefinition theClass, Vector list,
ContextStack stack, boolean quiet) {
// Convert vector to array...
Method[] methods = new Method[list.size()];
list.copyInto(methods);
for (MemberDefinition member = theClass.getFirstMember();
member != null;
member = member.getNextMember()) {
if (member.isMethod() && !member.isConstructor()
&& !member.isInitializer()) {
// It's a method...
if (!updateExceptions(member,methods,stack,quiet)) {
return false;
}
}
}
return true;
}
示例2: updateParentClassMethods
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
protected Vector updateParentClassMethods(ClassDefinition current,
Vector currentMethods,
boolean quiet,
ContextStack stack)
throws ClassNotFound {
ClassDeclaration parentDecl = current.getSuperClass(env);
while (parentDecl != null) {
ClassDefinition parentDef = parentDecl.getClassDefinition(env);
Identifier currentID = parentDecl.getName();
if ( currentID == idJavaLangObject ) break;
// Walk all members of this class and update any that
// already exist in currentMethods...
for (MemberDefinition member = parentDef.getFirstMember();
member != null;
member = member.getNextMember()) {
if (member.isMethod() &&
!member.isInitializer() &&
!member.isConstructor() &&
!member.isPrivate()) {
// It's a method. Is it valid?
Method method;
try {
method = new Method((CompoundType)this,member,quiet,stack);
} catch (Exception e) {
// Don't report anything here, it's already been reported...
return null;
}
// Have we already seen it?
int index = currentMethods.indexOf(method);
if (index >= 0) {
// Yes, so update it...
Method currentMethod = (Method)currentMethods.elementAt(index);
currentMethod.setDeclaredBy(currentID);
}
else currentMethods.addElement(method);
}
}
// Update parent and keep walking up the chain...
parentDecl = parentDef.getSuperClass(env);
}
return currentMethods;
}