本文整理汇总了Java中org.eclipse.jdt.core.IMember.isBinary方法的典型用法代码示例。如果您正苦于以下问题:Java IMember.isBinary方法的具体用法?Java IMember.isBinary怎么用?Java IMember.isBinary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IMember
的用法示例。
在下文中一共展示了IMember.isBinary方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSyntheticElement
import org.eclipse.jdt.core.IMember; //导入方法依赖的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: setRootPath
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private void setRootPath(IMember iMember, Member member) {
if (iMember.isBinary()) {
member.setBinary(true);
member.setRootPath(iMember.getClassFile().getType().getFullyQualifiedName());
member.setLibId(
iMember
.getClassFile()
.getAncestor(IPackageFragmentRoot.PACKAGE_FRAGMENT_ROOT)
.hashCode());
} else {
member.setBinary(false);
member.setRootPath(iMember.getCompilationUnit().getPath().toOSString());
}
}
示例3: setRange
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private void setRange(Member member, IMember iMember) throws JavaModelException {
ISourceRange nameRange = iMember.getNameRange();
if (iMember.isBinary()) {
nameRange = iMember.getSourceRange();
}
if (nameRange == null) {
return;
}
member.setFileRegion(convertToRegionDTO(iMember.getSourceRange()));
}
示例4: isAbstract
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
public static boolean isAbstract(IMember member) throws JavaModelException {
int flags = member.getFlags();
if (!member.isBinary() && isInterfaceOrAnnotationMethod(member)) {
return !Flags.isStatic(flags) && !Flags.isDefaultMethod(flags);
}
return Flags.isAbstract(flags);
}
示例5: adjustOutgoingVisibility
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* Adjusts the visibilities of the referenced element from the search match found in a compilation
* unit.
*
* @param match the search match representing the element declaration
* @param monitor the progress monitor to use
* @throws JavaModelException if the visibility could not be determined
*/
private void adjustOutgoingVisibility(final SearchMatch match, final IProgressMonitor monitor)
throws JavaModelException {
final Object element = match.getElement();
if (element instanceof IMember) {
final IMember member = (IMember) element;
if (!member.isBinary() && !member.isReadOnly() && !isInsideMovedMember(member)) {
adjustOutgoingVisibilityChain(member, monitor);
}
}
}
示例6: canEnable
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
@Override
public boolean canEnable() throws JavaModelException {
if (!super.canEnable() || fJavaElements.length == 0) return false;
for (int i = 0; i < fJavaElements.length; i++) {
if (fJavaElements[i] instanceof IMember) {
IMember member = (IMember) fJavaElements[i];
// we can copy some binary members, but not all
if (member.isBinary() && member.getSourceRange() == null) return false;
}
}
return true;
}
示例7: checkWritabilitiy
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private RefactoringStatus checkWritabilitiy(IMember member, PreconditionFailure failure) {
if (member.isBinary() || member.isReadOnly())
return createError(failure, member);
return new RefactoringStatus();
}
开发者ID:ponder-lab,项目名称:Migrate-Skeletal-Implementation-to-Interface-Refactoring,代码行数:6,代码来源:MigrateSkeletalImplementationToInterfaceRefactoringProcessor.java
示例8: adjustVisibility
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private RefactoringStatus adjustVisibility(
IMember whoToAdjust,
ModifierKeyword neededVisibility,
boolean alsoIncreaseEnclosing,
IProgressMonitor monitor)
throws CoreException {
Map<IMember, IncomingMemberVisibilityAdjustment> adjustments;
if (isRewriteKept(whoToAdjust.getCompilationUnit())) adjustments = fIntermediaryAdjustments;
else adjustments = new HashMap<IMember, IncomingMemberVisibilityAdjustment>();
int existingAdjustments = adjustments.size();
addAdjustment(whoToAdjust, neededVisibility, adjustments);
if (alsoIncreaseEnclosing)
while (whoToAdjust.getDeclaringType() != null) {
whoToAdjust = whoToAdjust.getDeclaringType();
addAdjustment(whoToAdjust, neededVisibility, adjustments);
}
boolean hasNewAdjustments = (adjustments.size() - existingAdjustments) > 0;
if (hasNewAdjustments && ((whoToAdjust.isReadOnly() || whoToAdjust.isBinary())))
return RefactoringStatus.createErrorStatus(
Messages.format(
RefactoringCoreMessages
.IntroduceIndirectionRefactoring_cannot_update_binary_target_visibility,
new String[] {
JavaElementLabels.getElementLabel(whoToAdjust, JavaElementLabels.ALL_DEFAULT)
}),
JavaStatusContext.create(whoToAdjust));
RefactoringStatus status = new RefactoringStatus();
// Don't create a rewrite if it is not necessary
if (!hasNewAdjustments) return status;
try {
monitor.beginTask(RefactoringCoreMessages.MemberVisibilityAdjustor_adjusting, 2);
Map<ICompilationUnit, CompilationUnitRewrite> rewrites;
if (!isRewriteKept(whoToAdjust.getCompilationUnit())) {
CompilationUnitRewrite rewrite =
new CompilationUnitRewrite(whoToAdjust.getCompilationUnit());
rewrite.setResolveBindings(false);
rewrites = new HashMap<ICompilationUnit, CompilationUnitRewrite>();
rewrites.put(whoToAdjust.getCompilationUnit(), rewrite);
status.merge(
rewriteVisibility(
adjustments,
rewrites,
new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)));
rewrite.attachChange(
(CompilationUnitChange) fTextChangeManager.get(whoToAdjust.getCompilationUnit()),
true,
new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
}
} finally {
monitor.done();
}
return status;
}
示例9: hasSourceAvailable
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
public static boolean hasSourceAvailable(IMember member) throws JavaModelException {
return !member.isBinary()
|| (member.getSourceRange() != null && !fgUnknownRange.equals(member.getSourceRange()));
}