本文整理汇总了Java中org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccInterface方法的典型用法代码示例。如果您正苦于以下问题:Java ClassFileConstants.AccInterface方法的具体用法?Java ClassFileConstants.AccInterface怎么用?Java ClassFileConstants.AccInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants
的用法示例。
在下文中一共展示了ClassFileConstants.AccInterface方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setModifiers
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* @param typeDecl
* @param typeDeclaration
*/
protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) {
switch(this.ast.apiLevel) {
case AST.JLS2_INTERNAL :
int modifiers = typeDeclaration.modifiers;
modifiers &= ~ClassFileConstants.AccInterface; // remove AccInterface flags
modifiers &= ExtraCompilerModifiers.AccJustFlag;
typeDecl.internalSetModifiers(modifiers);
if (typeDeclaration.annotations != null) {
typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED);
}
break;
default :
this.scanner.resetTo(typeDeclaration.declarationSourceStart, typeDeclaration.sourceStart);
this.setModifiers(typeDecl, typeDeclaration.annotations, typeDeclaration.sourceStart);
}
}
示例2: illegalLocalTypeDeclaration
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public void illegalLocalTypeDeclaration(TypeDeclaration typeDeclaration) {
if (isRecoveredName(typeDeclaration.name)) return;
int problemID = 0;
if ((typeDeclaration.modifiers & ClassFileConstants.AccEnum) != 0) {
problemID = IProblem.CannotDefineEnumInLocalType;
} else if ((typeDeclaration.modifiers & ClassFileConstants.AccAnnotation) != 0) {
problemID = IProblem.CannotDefineAnnotationInLocalType;
} else if ((typeDeclaration.modifiers & ClassFileConstants.AccInterface) != 0) {
problemID = IProblem.CannotDefineInterfaceInLocalType;
}
if (problemID != 0) {
String[] arguments = new String[] {new String(typeDeclaration.name)};
this.handle(
problemID,
arguments,
arguments,
typeDeclaration.sourceStart,
typeDeclaration.sourceEnd);
}
}
示例3: consumeCompilationUnit
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeCompilationUnit() {
this.javadoc = null;
checkComment();
if (this.javadoc != null && this.cursorLocation > this.javadoc.sourceStart && this.cursorLocation < this.javadoc.sourceEnd) {
// completion is in an orphan javadoc comment => replace compilation unit one to allow completion resolution
this.compilationUnit.javadoc = this.javadoc;
// create a fake interface declaration to allow resolution
if (this.compilationUnit.types == null) {
this.compilationUnit.types = new TypeDeclaration[1];
TypeDeclaration declaration = new TypeDeclaration(this.compilationUnit.compilationResult);
declaration.name = FAKE_TYPE_NAME;
declaration.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccInterface;
this.compilationUnit.types[0] = declaration;
}
}
super.consumeCompilationUnit();
}
示例4: decodeModifiers
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void decodeModifiers() {
// Extract suffix from modifiers instead of index key
switch (this.modifiers & (ClassFileConstants.AccInterface|ClassFileConstants.AccEnum|ClassFileConstants.AccAnnotation)) {
case ClassFileConstants.AccAnnotation:
case ClassFileConstants.AccAnnotation+ClassFileConstants.AccInterface:
this.typeSuffix = ANNOTATION_TYPE_SUFFIX;
break;
case ClassFileConstants.AccEnum:
this.typeSuffix = ENUM_SUFFIX;
break;
case ClassFileConstants.AccInterface:
this.typeSuffix = INTERFACE_SUFFIX;
break;
default:
this.typeSuffix = CLASS_SUFFIX;
break;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:20,代码来源:TypeDeclarationPattern.java
示例5: kind
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public final static int kind(int flags) {
switch (flags & (ClassFileConstants.AccInterface|ClassFileConstants.AccAnnotation|ClassFileConstants.AccEnum)) {
case ClassFileConstants.AccInterface :
return TypeDeclaration.INTERFACE_DECL;
case ClassFileConstants.AccInterface|ClassFileConstants.AccAnnotation :
return TypeDeclaration.ANNOTATION_TYPE_DECL;
case ClassFileConstants.AccEnum :
return TypeDeclaration.ENUM_DECL;
default :
return TypeDeclaration.CLASS_DECL;
}
}
示例6: createPackageInfoType
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public void createPackageInfoType() {
TypeDeclaration declaration = new TypeDeclaration(this.compilationResult);
declaration.name = TypeConstants.PACKAGE_INFO_NAME;
declaration.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccInterface;
declaration.javadoc = this.javadoc;
this.types[0] = declaration; // Assumes the first slot is meant for this type
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:CompilationUnitDeclaration.java
示例7: IntersectionCastTypeBinding
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public IntersectionCastTypeBinding(ReferenceBinding[] intersectingTypes, LookupEnvironment environment) {
this.intersectingTypes = intersectingTypes;
this.length = intersectingTypes.length;
if (!intersectingTypes[0].isClass()) {
this.javaLangObject = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null);
this.modifiers |= ClassFileConstants.AccInterface;
}
}
示例8: changeModifiersAndGenerateConstructor
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private void changeModifiersAndGenerateConstructor(EclipseNode typeNode, EclipseNode annotationNode) {
TypeDeclaration classDecl = (TypeDeclaration) typeNode.get();
boolean makeConstructor = true;
classDecl.modifiers |= ClassFileConstants.AccFinal;
boolean markStatic = true;
boolean requiresClInit = false;
boolean alreadyHasClinit = false;
if (typeNode.up().getKind() == Kind.COMPILATION_UNIT) markStatic = false;
if (markStatic && typeNode.up().getKind() == Kind.TYPE) {
TypeDeclaration typeDecl = (TypeDeclaration) typeNode.up().get();
if ((typeDecl.modifiers & ClassFileConstants.AccInterface) != 0) markStatic = false;
}
if (markStatic) classDecl.modifiers |= ClassFileConstants.AccStatic;
for (EclipseNode element : typeNode.down()) {
if (element.getKind() == Kind.FIELD) {
FieldDeclaration fieldDecl = (FieldDeclaration) element.get();
if ((fieldDecl.modifiers & ClassFileConstants.AccStatic) == 0) {
requiresClInit = true;
fieldDecl.modifiers |= ClassFileConstants.AccStatic;
}
} else if (element.getKind() == Kind.METHOD) {
AbstractMethodDeclaration amd = (AbstractMethodDeclaration) element.get();
if (amd instanceof ConstructorDeclaration) {
ConstructorDeclaration constrDecl = (ConstructorDeclaration) element.get();
if (getGeneratedBy(constrDecl) == null && (constrDecl.bits & ASTNode.IsDefaultConstructor) == 0) {
element.addError("@UtilityClasses cannot have declared constructors.");
makeConstructor = false;
continue;
}
} else if (amd instanceof MethodDeclaration) {
amd.modifiers |= ClassFileConstants.AccStatic;
} else if (amd instanceof Clinit) {
alreadyHasClinit = true;
}
} else if (element.getKind() == Kind.TYPE) {
((TypeDeclaration) element.get()).modifiers |= ClassFileConstants.AccStatic;
}
}
if (makeConstructor) createPrivateDefaultConstructor(typeNode, annotationNode);
if (requiresClInit && !alreadyHasClinit) classDecl.addClinit();
}
示例9: isStatic
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Answer true if the receiver is a static member type (or toplevel)
*/
public final boolean isStatic() {
return (this.modifiers & (ClassFileConstants.AccStatic | ClassFileConstants.AccInterface)) != 0 || (this.tagBits & TagBits.IsNestedType) == 0;
}
示例10: consumeInterfaceHeaderName1
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeInterfaceHeaderName1() {
// InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier'
TypeDeclaration typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
typeDecl.bits |= ASTNode.IsMemberType;
}
} else {
// Record that the block has a declaration for local types
typeDecl.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
typeDecl.sourceEnd = (int) pos;
typeDecl.sourceStart = (int) (pos >>> 32);
typeDecl.name = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
//compute the declaration source too
// 'class' and 'interface' push an int position
this.typeStartPosition = typeDecl.declarationSourceStart = this.intStack[this.intPtr--];
this.intPtr--;
int declSourceStart = this.intStack[this.intPtr--];
typeDecl.modifiersSourceStart = this.intStack[this.intPtr--];
typeDecl.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccInterface;
if (typeDecl.declarationSourceStart > declSourceStart) {
typeDecl.declarationSourceStart = declSourceStart;
}
// consume annotations
int length;
if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
System.arraycopy(
this.expressionStack,
(this.expressionPtr -= length) + 1,
typeDecl.annotations = new Annotation[length],
0,
length);
}
typeDecl.bodyStart = typeDecl.sourceEnd + 1;
pushOnAstStack(typeDecl);
// javadoc
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
示例11: consumeAnnotationTypeDeclarationHeaderName
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeAnnotationTypeDeclarationHeaderName() {
// consumeAnnotationTypeDeclarationHeader ::= Modifiers '@' PushModifiers interface Identifier
// consumeAnnotationTypeDeclarationHeader ::= '@' PushModifiers interface Identifier
TypeDeclaration annotationTypeDeclaration = new TypeDeclaration(this.compilationUnit.compilationResult);
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
annotationTypeDeclaration.bits |= ASTNode.IsMemberType;
}
} else {
// Record that the block has a declaration for local types
annotationTypeDeclaration.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
annotationTypeDeclaration.sourceEnd = (int) pos;
annotationTypeDeclaration.sourceStart = (int) (pos >>> 32);
annotationTypeDeclaration.name = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
//compute the declaration source too
// 'interface' push two int positions: the beginning of the class token and its end.
// we want to keep the beginning position but get rid of the end position
// it is only used for the ClassLiteralAccess positions.
this.intPtr--; // remove the start position of the interface token
this.intPtr--; // remove the end position of the interface token
annotationTypeDeclaration.modifiersSourceStart = this.intStack[this.intPtr--];
annotationTypeDeclaration.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccAnnotation | ClassFileConstants.AccInterface;
if (annotationTypeDeclaration.modifiersSourceStart >= 0) {
annotationTypeDeclaration.declarationSourceStart = annotationTypeDeclaration.modifiersSourceStart;
this.intPtr--; // remove the position of the '@' token as we have modifiers
} else {
int atPosition = this.intStack[this.intPtr--];
// remove the position of the '@' token as we don't have modifiers
annotationTypeDeclaration.declarationSourceStart = atPosition;
}
// Store secondary info
if ((annotationTypeDeclaration.bits & ASTNode.IsMemberType) == 0 && (annotationTypeDeclaration.bits & ASTNode.IsLocalType) == 0) {
if (this.compilationUnit != null && !CharOperation.equals(annotationTypeDeclaration.name, this.compilationUnit.getMainTypeName())) {
annotationTypeDeclaration.bits |= ASTNode.IsSecondaryType;
}
}
// consume annotations
int length;
if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
System.arraycopy(
this.expressionStack,
(this.expressionPtr -= length) + 1,
annotationTypeDeclaration.annotations = new Annotation[length],
0,
length);
}
annotationTypeDeclaration.bodyStart = annotationTypeDeclaration.sourceEnd + 1;
// javadoc
annotationTypeDeclaration.javadoc = this.javadoc;
this.javadoc = null;
pushOnAstStack(annotationTypeDeclaration);
if(!this.statementRecoveryActivated &&
this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
problemReporter().invalidUsageOfAnnotationDeclarations(annotationTypeDeclaration);
}
// recovery
if (this.currentElement != null){
this.lastCheckPoint = annotationTypeDeclaration.bodyStart;
this.currentElement = this.currentElement.add(annotationTypeDeclaration, 0);
this.lastIgnoredToken = -1;
}
}
示例12: consumeInterfaceHeaderName1
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeInterfaceHeaderName1() {
// InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier'
TypeDeclaration typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
if (this.nestedMethod[this.nestedType] == 0) {
if (this.nestedType != 0) {
typeDecl.bits |= ASTNode.IsMemberType;
}
} else {
// Record that the block has a declaration for local types
typeDecl.bits |= ASTNode.IsLocalType;
markEnclosingMemberWithLocalType();
blockReal();
}
//highlight the name of the type
long pos = this.identifierPositionStack[this.identifierPtr];
typeDecl.sourceEnd = (int) pos;
typeDecl.sourceStart = (int) (pos >>> 32);
typeDecl.name = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
//compute the declaration source too
// 'class' and 'interface' push two int positions: the beginning of the class token and its end.
// we want to keep the beginning position but get rid of the end position
// it is only used for the ClassLiteralAccess positions.
typeDecl.declarationSourceStart = this.intStack[this.intPtr--];
this.intPtr--; // remove the end position of the class token
typeDecl.modifiersSourceStart = this.intStack[this.intPtr--];
typeDecl.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccInterface;
if (typeDecl.modifiersSourceStart >= 0) {
typeDecl.declarationSourceStart = typeDecl.modifiersSourceStart;
}
// Store secondary info
if ((typeDecl.bits & ASTNode.IsMemberType) == 0 && (typeDecl.bits & ASTNode.IsLocalType) == 0) {
if (this.compilationUnit != null && !CharOperation.equals(typeDecl.name, this.compilationUnit.getMainTypeName())) {
typeDecl.bits |= ASTNode.IsSecondaryType;
}
}
// consume annotations
int length;
if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
System.arraycopy(
this.expressionStack,
(this.expressionPtr -= length) + 1,
typeDecl.annotations = new Annotation[length],
0,
length);
}
typeDecl.bodyStart = typeDecl.sourceEnd + 1;
pushOnAstStack(typeDecl);
this.listLength = 0; // will be updated when reading super-interfaces
// recovery
if (this.currentElement != null){ // is recovering
this.lastCheckPoint = typeDecl.bodyStart;
this.currentElement = this.currentElement.add(typeDecl, 0);
this.lastIgnoredToken = -1;
}
// javadoc
typeDecl.javadoc = this.javadoc;
this.javadoc = null;
}
示例13: canBeInstantiated
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
* Answer true if the receiver can be instantiated
*/
public boolean canBeInstantiated() {
return (this.modifiers & (ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation)) == 0;
}
示例14: isClass
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public boolean isClass() {
return (this.modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation | ClassFileConstants.AccEnum)) == 0;
}
示例15: isInterface
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public boolean isInterface() {
// consider strict interfaces and annotation types
return (this.modifiers & ClassFileConstants.AccInterface) != 0;
}