本文整理了Java中org.eclipse.jdt.core.Flags.isDeprecated()
方法的一些代码示例,展示了Flags.isDeprecated()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flags.isDeprecated()
方法的具体详情如下:
包路径:org.eclipse.jdt.core.Flags
类名称:Flags
方法名:isDeprecated
[英]Returns whether the given integer includes the indication that the element is deprecated (@deprecated
tag in Javadoc comment).
[中]返回给定整数是否包含元素已弃用的指示(@deprecated
标记在Javadoc comment中)。
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private int compareDeprecation(int leftType, int rightType) {
boolean rightIsDeprecated= Flags.isDeprecated(rightType);
if (Flags.isDeprecated(leftType))
return rightIsDeprecated ? 0 : +1;
return rightIsDeprecated ? -1 : 0;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private int compareDeprecation(int leftType, int rightType) {
boolean rightIsDeprecated= Flags.isDeprecated(rightType);
if (Flags.isDeprecated(leftType))
return rightIsDeprecated ? 0 : +1;
return rightIsDeprecated ? -1 : 0;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public boolean select(final Viewer viewer, final Object parentElement, final Object element) {
if (element instanceof IMember) {
IMember member= (IMember) element;
if (member instanceof IField || member instanceof IMethod) {
try {
return !Flags.isDeprecated(member.getFlags());
} catch (final JavaModelException e) {
// flags aren't determinable so let element through this filter
}
}
}
return true;
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
public static boolean isDeprecated(IMember member) throws JavaModelException{
return Flags.isDeprecated(member.getFlags());
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static boolean isDeprecated(IMember member) throws JavaModelException{
return Flags.isDeprecated(member.getFlags());
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation
public static boolean isDeprecated(IMember member) throws JavaModelException{
return Flags.isDeprecated(member.getFlags());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static boolean isDeprecated(IMember member) throws JavaModelException{
return Flags.isDeprecated(member.getFlags());
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
private boolean isDeprecated(IJavaElement element) throws JavaModelException {
if (element instanceof ITypeRoot) {
return Flags.isDeprecated(((ITypeRoot) element).findPrimaryType().getFlags());
}
return false;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
/**
* @see IDOMMember#setFlags(int)
*/
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
/**
* @see IDOMMember#setFlags(int)
*/
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
/**
* @see IDOMMember#setFlags(int)
*/
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
/**
* @see IDOMMember#setFlags(int)
*/
@Override
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
/**
* @see IDOMMember#setFlags(int)
*/
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
/**
* @see IDOMMember#setFlags(int)
*/
public void setFlags(int flags) {
becomeDetailed();
if (Flags.isDeprecated(this.fFlags)) {
this.fFlags= flags | ClassFileConstants.AccDeprecated;
} else {
this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
}
fragment();
this.fModifiers= generateFlags();
}
/**
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private ImageDescriptor decorate(ImageDescriptor descriptor, int modifiers, boolean isField) {
int flags= 0;
if (Flags.isDeprecated(modifiers))
flags |= JavaElementImageDescriptor.DEPRECATED;
if (Flags.isStatic(modifiers))
flags |= JavaElementImageDescriptor.STATIC;
if (Flags.isFinal(modifiers))
flags |= JavaElementImageDescriptor.FINAL;
if (Flags.isSynchronized(modifiers))
flags |= JavaElementImageDescriptor.SYNCHRONIZED;
if (Flags.isAbstract(modifiers))
flags |= JavaElementImageDescriptor.ABSTRACT;
if (isField) {
if (Flags.isVolatile(modifiers))
flags |= JavaElementImageDescriptor.VOLATILE;
if (Flags.isTransient(modifiers))
flags |= JavaElementImageDescriptor.TRANSIENT;
}
return new JavaElementImageDescriptor(descriptor, flags, JavaElementImageProvider.SMALL_SIZE);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public static ImageDescriptor getImageDescriptor(TypeNameMatch typeRef, int flags) {
if (isSet(SHOW_TYPE_CONTAINER_ONLY, flags)) {
if (typeRef.getPackageName().equals(typeRef.getTypeContainerName()))
return JavaPluginImages.DESC_OBJS_PACKAGE;
// XXX cannot check outer type for interface efficiently (5887)
return JavaPluginImages.DESC_OBJS_CLASS;
} else if (isSet(SHOW_PACKAGE_ONLY, flags)) {
return JavaPluginImages.DESC_OBJS_PACKAGE;
} else {
boolean isInner= typeRef.getTypeContainerName().indexOf('.') != -1;
int modifiers= typeRef.getModifiers();
ImageDescriptor desc= JavaElementImageProvider.getTypeImageDescriptor(isInner, false, modifiers, false);
int adornmentFlags= 0;
if (Flags.isFinal(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.FINAL;
}
if (Flags.isAbstract(modifiers) && !Flags.isInterface(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.ABSTRACT;
}
if (Flags.isStatic(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.STATIC;
}
if (Flags.isDeprecated(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.DEPRECATED;
}
return new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static ImageDescriptor getImageDescriptor(TypeNameMatch typeRef, int flags) {
if (isSet(SHOW_TYPE_CONTAINER_ONLY, flags)) {
if (typeRef.getPackageName().equals(typeRef.getTypeContainerName()))
return JavaPluginImages.DESC_OBJS_PACKAGE;
// XXX cannot check outer type for interface efficiently (5887)
return JavaPluginImages.DESC_OBJS_CLASS;
} else if (isSet(SHOW_PACKAGE_ONLY, flags)) {
return JavaPluginImages.DESC_OBJS_PACKAGE;
} else {
boolean isInner= typeRef.getTypeContainerName().indexOf('.') != -1;
int modifiers= typeRef.getModifiers();
ImageDescriptor desc= JavaElementImageProvider.getTypeImageDescriptor(isInner, false, modifiers, false);
int adornmentFlags= 0;
if (Flags.isFinal(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.FINAL;
}
if (Flags.isAbstract(modifiers) && !Flags.isInterface(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.ABSTRACT;
}
if (Flags.isStatic(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.STATIC;
}
if (Flags.isDeprecated(modifiers)) {
adornmentFlags |= JavaElementImageDescriptor.DEPRECATED;
}
return new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void addOverlaysFromFlags(int flags, IDecoration decoration) {
ImageDescriptor type;
if (Flags.isAnnotation(flags)) {
type= JavaPluginImages.DESC_OVR_ANNOTATION;
} else if (Flags.isEnum(flags)) {
type= JavaPluginImages.DESC_OVR_ENUM;
} else if (Flags.isInterface(flags)) {
type= JavaPluginImages.DESC_OVR_INTERFACE;
} else if (/* is class */ Flags.isAbstract(flags)) {
type= JavaPluginImages.DESC_OVR_ABSTRACT_CLASS;
} else {
type= null;
}
boolean deprecated= Flags.isDeprecated(flags);
boolean packageDefault= Flags.isPackageDefault(flags);
/* Each decoration position can only be used once. Since we don't want to take all positions
* away from other decorators, we confine ourselves to only use the top right position. */
if (type != null && !deprecated && !packageDefault) {
decoration.addOverlay(type, IDecoration.TOP_RIGHT);
} else if (type == null && deprecated && !packageDefault) {
decoration.addOverlay(JavaPluginImages.DESC_OVR_DEPRECATED, IDecoration.TOP_RIGHT);
} else if (type != null || deprecated || packageDefault) {
decoration.addOverlay(new TypeIndicatorOverlay(type, deprecated, packageDefault), IDecoration.TOP_RIGHT);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void addOverlaysFromFlags(int flags, IDecoration decoration) {
ImageDescriptor type;
if (Flags.isAnnotation(flags)) {
type= JavaPluginImages.DESC_OVR_ANNOTATION;
} else if (Flags.isEnum(flags)) {
type= JavaPluginImages.DESC_OVR_ENUM;
} else if (Flags.isInterface(flags)) {
type= JavaPluginImages.DESC_OVR_INTERFACE;
} else if (/* is class */ Flags.isAbstract(flags)) {
type= JavaPluginImages.DESC_OVR_ABSTRACT_CLASS;
} else {
type= null;
}
boolean deprecated= Flags.isDeprecated(flags);
boolean packageDefault= Flags.isPackageDefault(flags);
/* Each decoration position can only be used once. Since we don't want to take all positions
* away from other decorators, we confine ourselves to only use the top right position. */
if (type != null && !deprecated && !packageDefault) {
decoration.addOverlay(type, IDecoration.TOP_RIGHT);
} else if (type == null && deprecated && !packageDefault) {
decoration.addOverlay(JavaPluginImages.DESC_OVR_DEPRECATED, IDecoration.TOP_RIGHT);
} else if (type != null || deprecated || packageDefault) {
decoration.addOverlay(new TypeIndicatorOverlay(type, deprecated, packageDefault), IDecoration.TOP_RIGHT);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui
flags |= JavaElementImageDescriptor.STATIC;
if (Flags.isDeprecated(modifiers))
flags |= JavaElementImageDescriptor.DEPRECATED;
内容来源于网络,如有侵权,请联系作者删除!