本文整理汇总了Java中org.eclipse.jdt.core.Flags.isSynthetic方法的典型用法代码示例。如果您正苦于以下问题:Java Flags.isSynthetic方法的具体用法?Java Flags.isSynthetic怎么用?Java Flags.isSynthetic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.Flags
的用法示例。
在下文中一共展示了Flags.isSynthetic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSyntheticElement
import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
private boolean isSyntheticElement(IJavaElement element) {
if (!(element instanceof IMember)) {
return false;
}
IMember member= (IMember)element;
if (!(member.isBinary())) {
return false;
}
try {
return Flags.isSynthetic(member.getFlags());
} catch (JavaModelException e) {
return false;
}
}
示例2: isSynthetic
import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
public static boolean isSynthetic(IMember member) throws JavaModelException {
return Flags.isSynthetic(member.getFlags());
}
示例3: appendMembers
import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
protected void appendMembers(final IType type, final IProgressMonitor monitor)
throws JavaModelException {
try {
monitor.beginTask(RefactoringCoreMessages.StubCreationOperation_creating_type_stubs, 1);
final IJavaElement[] children = type.getChildren();
for (int index = 0; index < children.length; index++) {
final IMember child = (IMember) children[index];
final int flags = child.getFlags();
final boolean isPrivate = Flags.isPrivate(flags);
final boolean isDefault = !Flags.isPublic(flags) && !Flags.isProtected(flags) && !isPrivate;
final boolean stub = fStubInvisible || (!isPrivate && !isDefault);
if (child instanceof IType) {
if (stub) appendTypeDeclaration((IType) child, new SubProgressMonitor(monitor, 1));
} else if (child instanceof IField) {
if (stub && !Flags.isEnum(flags) && !Flags.isSynthetic(flags))
appendFieldDeclaration((IField) child);
} else if (child instanceof IMethod) {
final IMethod method = (IMethod) child;
final String name = method.getElementName();
if (method.getDeclaringType().isEnum()) {
final int count = method.getNumberOfParameters();
if (count == 0 && "values".equals(name)) // $NON-NLS-1$
continue;
if (count == 1
&& "valueOf".equals(name)
&& "Ljava.lang.String;"
.equals(method.getParameterTypes()[0])) // $NON-NLS-1$ //$NON-NLS-2$
continue;
if (method.isConstructor()) continue;
}
boolean skip = !stub || name.equals("<clinit>"); // $NON-NLS-1$
if (method.isConstructor()) skip = false;
skip = skip || Flags.isSynthetic(flags) || Flags.isBridge(flags);
if (!skip) appendMethodDeclaration(method);
}
fBuffer.append("\n"); // $NON-NLS-1$
}
} finally {
monitor.done();
}
}