本文整理汇总了Java中spoon.reflect.declaration.CtModifiable类的典型用法代码示例。如果您正苦于以下问题:Java CtModifiable类的具体用法?Java CtModifiable怎么用?Java CtModifiable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CtModifiable类属于spoon.reflect.declaration包,在下文中一共展示了CtModifiable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isVisibleFrom
import spoon.reflect.declaration.CtModifiable; //导入依赖的package包/类
private static boolean isVisibleFrom(CtTypeReference<?> accessingClass, CtModifiable modifiable, CtTypeReference<?> declaringClass, CtTypeReference<?> actualClass) {
if (hasPublicModifier(modifiable)) {
return true;
}
if ((isNestedIn(accessingClass, actualClass) || isNestedIn(actualClass, accessingClass)) && areSameClass(declaringClass, actualClass)) {
return true;
}
if (hasNoVisibilityModifier(modifiable) && areFromSamePackage(declaringClass, actualClass) && areFromSamePackage(actualClass, accessingClass)) {
return true;
}
if (hasPrivateModifier(modifiable) && areSameClass(declaringClass, accessingClass)) {
return true;
}
if (hasProtectedModifier(modifiable) && areFromSamePackage(declaringClass, accessingClass)) {
return true;
}
if (hasProtectedModifier(modifiable) && isSubclassOf(declaringClass, accessingClass) && areSameClass(actualClass, accessingClass)) {
return true;
}
return false;
}
示例2: process
import spoon.reflect.declaration.CtModifiable; //导入依赖的package包/类
public void process(CtElement element) {
if (element instanceof CtNamedElement || element instanceof CtField || element instanceof CtExecutable) {
if (((CtModifiable) element).getModifiers().contains(ModifierKind.PUBLIC) || ((CtModifiable) element).getModifiers().contains(ModifierKind.PROTECTED)) {
if (element.getDocComment() == null || element.getDocComment().equals("")) {
undocumentedElements.add(element);
}
}
}
}
示例3: scanCtModifiable
import spoon.reflect.declaration.CtModifiable; //导入依赖的package包/类
@Override
public void scanCtModifiable(CtModifiable m) {
ITree modifiers = builder.createNode("Modifiers", "");
modifiers.setMetadata(SpoonGumTreeBuilder.SPOON_OBJECT, m);
for (ModifierKind kind : m.getModifiers()) {
ITree modifier = builder.createNode("Modifier", kind.toString());
modifier.setMetadata(SpoonGumTreeBuilder.SPOON_OBJECT, m);
modifiers.addChild(modifier);
}
builder.addSiblingNode(modifiers);
}