当前位置: 首页>>代码示例>>Java>>正文


Java ClassFileConstants.AccDefault方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccDefault方法的典型用法代码示例。如果您正苦于以下问题:Java ClassFileConstants.AccDefault方法的具体用法?Java ClassFileConstants.AccDefault怎么用?Java ClassFileConstants.AccDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants的用法示例。


在下文中一共展示了ClassFileConstants.AccDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeElidedArgument

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected Argument typeElidedArgument() {
	char[] selector = this.identifierStack[this.identifierPtr];
	if (selector != assistIdentifier()){
		return super.typeElidedArgument();
	}	
	this.identifierLengthPtr--;
	char[] identifierName = this.identifierStack[this.identifierPtr];
	long namePositions = this.identifierPositionStack[this.identifierPtr--];

	Argument argument =
		new SelectionOnArgumentName(
			identifierName,
			namePositions,
			null, // elided type
			ClassFileConstants.AccDefault,
			true);
	argument.declarationSourceStart = (int) (namePositions >>> 32);
	this.assistNode = argument;
	return argument;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:SelectionParser.java

示例2: generateMethodInfoHeaderForClinit

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * INTERNAL USE-ONLY
 * That method generates the method info header of a clinit:
 * The header consists in:
 * - the access flags (always default access + static)
 * - the name index of the method name (always <clinit>) inside the constant pool
 * - the descriptor index of the signature (always ()V) of the method inside the constant pool.
 */
public void generateMethodInfoHeaderForClinit() {
	// check that there is enough space to write all the bytes for the method info corresponding
	// to the @methodBinding
	this.methodCount++; // add one more method
	if (this.contentsOffset + 10 >= this.contents.length) {
		resizeContents(10);
	}
	this.contents[this.contentsOffset++] = (byte) ((ClassFileConstants.AccDefault | ClassFileConstants.AccStatic) >> 8);
	this.contents[this.contentsOffset++] = (byte) (ClassFileConstants.AccDefault | ClassFileConstants.AccStatic);
	int nameIndex = this.constantPool.literalIndex(ConstantPool.Clinit);
	this.contents[this.contentsOffset++] = (byte) (nameIndex >> 8);
	this.contents[this.contentsOffset++] = (byte) nameIndex;
	int descriptorIndex =
		this.constantPool.literalIndex(ConstantPool.ClinitSignature);
	this.contents[this.contentsOffset++] = (byte) (descriptorIndex >> 8);
	this.contents[this.contentsOffset++] = (byte) descriptorIndex;
	// We know that we won't get more than 1 attribute: the code attribute
	this.contents[this.contentsOffset++] = 0;
	this.contents[this.contentsOffset++] = 1;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:29,代码来源:ClassFile.java

示例3: javadocVisibilityArgument

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private String javadocVisibilityArgument(int visibility, int modifiers) {
	String argument = null;
	switch (modifiers & ExtraCompilerModifiers.AccVisibilityMASK) {
		case ClassFileConstants.AccPublic :
			argument = CompilerOptions.PUBLIC;
			break;
		case ClassFileConstants.AccProtected:
			if (visibility != ClassFileConstants.AccPublic) {
				argument = CompilerOptions.PROTECTED;
			}
			break;
		case ClassFileConstants.AccDefault:
			if (visibility == ClassFileConstants.AccDefault || visibility == ClassFileConstants.AccPrivate) {
				argument = CompilerOptions.DEFAULT;
			}
			break;
		case ClassFileConstants.AccPrivate:
			if (visibility == ClassFileConstants.AccPrivate) {
				argument = CompilerOptions.PRIVATE;
			}
			break;
	}
	return argument;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:ProblemReporter.java

示例4: attach

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
void attach(TypeParameter[] parameters, int startPos) {
	if(this.methodDeclaration.modifiers != ClassFileConstants.AccDefault) return;

	int lastParameterEnd = parameters[parameters.length - 1].sourceEnd;

	Parser parser = parser();
	Scanner scanner = parser.scanner;
	if(Util.getLineNumber(this.methodDeclaration.declarationSourceStart, scanner.lineEnds, 0, scanner.linePtr)
			!= Util.getLineNumber(lastParameterEnd, scanner.lineEnds, 0, scanner.linePtr)) return;

	if(parser.modifiersSourceStart > lastParameterEnd
			&& parser.modifiersSourceStart < this.methodDeclaration.declarationSourceStart) return;

	if (this.methodDeclaration instanceof MethodDeclaration) {
		((MethodDeclaration)this.methodDeclaration).typeParameters = parameters;
		this.methodDeclaration.declarationSourceStart = startPos;
	} else if (this.methodDeclaration instanceof ConstructorDeclaration){
		((ConstructorDeclaration)this.methodDeclaration).typeParameters = parameters;
		this.methodDeclaration.declarationSourceStart = startPos;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:RecoveredMethod.java

示例5: convert

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private Initializer convert(
    InitializerElementInfo initializerInfo, CompilationResult compilationResult)
    throws JavaModelException {

  Block block = new Block(0);
  Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);

  int start = initializerInfo.getDeclarationSourceStart();
  int end = initializerInfo.getDeclarationSourceEnd();

  initializer.sourceStart = initializer.declarationSourceStart = start;
  initializer.sourceEnd = initializer.declarationSourceEnd = end;
  initializer.modifiers = initializerInfo.getModifiers();

  /* convert local and anonymous types */
  IJavaElement[] children = initializerInfo.getChildren();
  int typesLength = children.length;
  if (typesLength > 0) {
    Statement[] statements = new Statement[typesLength];
    for (int i = 0; i < typesLength; i++) {
      SourceType type = (SourceType) children[i];
      TypeDeclaration localType = convert(type, compilationResult);
      if ((localType.bits & ASTNode.IsAnonymousType) != 0) {
        QualifiedAllocationExpression expression = new QualifiedAllocationExpression(localType);
        expression.type = localType.superclass;
        localType.superclass = null;
        localType.superInterfaces = null;
        localType.allocation = expression;
        statements[i] = expression;
      } else {
        statements[i] = localType;
      }
    }
    block.statements = statements;
  }

  return initializer;
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:SourceTypeConverter.java

示例6: completionOnFieldType

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private void completionOnFieldType(ASTNode astNode, Scope scope) {
	CompletionOnFieldType field = (CompletionOnFieldType) astNode;
	CompletionOnSingleTypeReference type = (CompletionOnSingleTypeReference) field.type;
	this.completionToken = type.token;
	setSourceAndTokenRange(type.sourceStart, type.sourceEnd);

	findTypesAndPackages(this.completionToken, scope, true, true, new ObjectVector());
	if (!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
		findKeywordsForMember(this.completionToken, field.modifiers, astNode);
	}

	if (!field.isLocalVariable && field.modifiers == ClassFileConstants.AccDefault) {
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
		if (!enclosingType.isAnnotationType()) {
			if (!this.requestor.isIgnored(CompletionProposal.METHOD_DECLARATION)) {
				findMethodDeclarations(
						this.completionToken,
						enclosingType,
						scope,
						new ObjectVector(),
						null,
						null,
						null,
						false);
			}
			if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) {
				proposeNewMethod(this.completionToken, enclosingType);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:CompletionEngine.java

示例7: buildTypeDeclaration

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * Convert a binary type into an AST type declaration and put it in the given compilation unit.
 */
public TypeDeclaration buildTypeDeclaration(IType type, CompilationUnitDeclaration compilationUnit)  throws JavaModelException {
	PackageFragment pkg = (PackageFragment) type.getPackageFragment();
	char[][] packageName = Util.toCharArrays(pkg.names);

	if (packageName.length > 0) {
		compilationUnit.currentPackage = new ImportReference(packageName, new long[]{0}, false, ClassFileConstants.AccDefault);
	}

	/* convert type */
	TypeDeclaration typeDeclaration = convert(type, null, null);

	IType alreadyComputedMember = type;
	IType parent = type.getDeclaringType();
	TypeDeclaration previousDeclaration = typeDeclaration;
	while(parent != null) {
		TypeDeclaration declaration = convert(parent, alreadyComputedMember, previousDeclaration);

		alreadyComputedMember = parent;
		previousDeclaration = declaration;
		parent = parent.getDeclaringType();
	}

	compilationUnit.types = new TypeDeclaration[]{previousDeclaration};

	return typeDeclaration;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:30,代码来源:BinaryTypeConverter.java

示例8: convert

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
private Initializer convert(InitializerElementInfo initializerInfo, CompilationResult compilationResult) throws JavaModelException {

		Block block = new Block(0);
		Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);

		int start = initializerInfo.getDeclarationSourceStart();
		int end = initializerInfo.getDeclarationSourceEnd();

		initializer.sourceStart = initializer.declarationSourceStart = start;
		initializer.sourceEnd = initializer.declarationSourceEnd = end;
		initializer.modifiers = initializerInfo.getModifiers();

		/* convert local and anonymous types */
		IJavaElement[] children = initializerInfo.getChildren();
		int typesLength = children.length;
		if (typesLength > 0) {
			Statement[] statements = new Statement[typesLength];
			for (int i = 0; i < typesLength; i++) {
				SourceType type = (SourceType) children[i];
				TypeDeclaration localType = convert(type, compilationResult);
				if ((localType.bits & ASTNode.IsAnonymousType) != 0) {
					QualifiedAllocationExpression expression = new QualifiedAllocationExpression(localType);
					expression.type = localType.superclass;
					localType.superclass = null;
					localType.superInterfaces = null;
					localType.allocation = expression;
					statements[i] = expression;
				} else {
					statements[i] = localType;
				}
			}
			block.statements = statements;
		}

		return initializer;
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:37,代码来源:SourceTypeConverter.java

示例9: 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,代码行数:8,代码来源:CompilationUnitDeclaration.java

示例10: add

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public RecoveredElement add(Block nestedBlockDeclaration,int bracketBalanceValue) {
	this.pendingTypeParameters = null;
	resetPendingModifiers();

	int mods = ClassFileConstants.AccDefault;
	if(parser().recoveredStaticInitializerStart != 0) {
		mods = ClassFileConstants.AccStatic;
	}
	return this.add(new Initializer(nestedBlockDeclaration, mods), bracketBalanceValue);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:RecoveredType.java

示例11: JavadocArgumentExpression

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public JavadocArgumentExpression(char[] name, int startPos, int endPos, TypeReference typeRef) {
	this.token = name;
	this.sourceStart = startPos;
	this.sourceEnd = endPos;
	long pos = (((long) startPos) << 32) + endPos;
	this.argument = new Argument(name, pos, typeRef, ClassFileConstants.AccDefault);
	this.bits |= InsideJavadoc;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:JavadocArgumentExpression.java

示例12: consumeSingleStaticImportDeclarationName

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeSingleStaticImportDeclarationName() {
	// SingleTypeImportDeclarationName ::= 'import' 'static' Name
	/* push an ImportRef build from the last name
	stored in the identifier stack. */

	ImportReference impt;
	int length;
	char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
	this.identifierPtr -= length;
	long[] positions = new long[length];
	System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
	System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
	pushOnAstStack(impt = new ImportReference(tokens, positions, false, ClassFileConstants.AccStatic));

	this.modifiers = ClassFileConstants.AccDefault;
	this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)

	if (this.currentToken == TokenNameSEMICOLON){
		impt.declarationSourceEnd = this.scanner.currentPosition - 1;
	} else {
		impt.declarationSourceEnd = impt.sourceEnd;
	}
	impt.declarationEnd = impt.declarationSourceEnd;
	//this.endPosition is just before the ;
	impt.declarationSourceStart = this.intStack[this.intPtr--];

	if(!this.statementRecoveryActivated &&
			this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
			this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
		impt.modifiers = ClassFileConstants.AccDefault; // convert the static import reference to a non-static importe reference
		problemReporter().invalidUsageOfStaticImports(impt);
	}

	// recovery
	if (this.currentElement != null){
		this.lastCheckPoint = impt.declarationSourceEnd+1;
		this.currentElement = this.currentElement.add(impt, 0);
		this.lastIgnoredToken = -1;
		this.restartRecovery = true; // used to avoid branching back into the regular automaton
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:42,代码来源:Parser.java

示例13: SelectionOnPackageReference

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public SelectionOnPackageReference(char[][] tokens , long[] positions) {
	super(tokens, positions, false, ClassFileConstants.AccDefault);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:SelectionOnPackageReference.java

示例14: CompletionOnKeyword2

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public CompletionOnKeyword2(char[] token, long pos, char[][] possibleKeywords) {
	super(new char[][]{token}, new long[]{pos}, false, ClassFileConstants.AccDefault);
	this.token = token;
	this.possibleKeywords = possibleKeywords;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:CompletionOnKeyword2.java

示例15: resetModifiers

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * Reset modifiers buffer and comment stack. Should be call only for nodes that claim both.
 */
protected void resetModifiers() {
	this.modifiers = ClassFileConstants.AccDefault;
	this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)
	this.scanner.commentPtr = -1;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:Parser.java


注:本文中的org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。