本文整理汇总了Java中org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.ATTR_METHOD_PARAMETERS属性的典型用法代码示例。如果您正苦于以下问题:Java ClassFileConstants.ATTR_METHOD_PARAMETERS属性的具体用法?Java ClassFileConstants.ATTR_METHOD_PARAMETERS怎么用?Java ClassFileConstants.ATTR_METHOD_PARAMETERS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants
的用法示例。
在下文中一共展示了ClassFileConstants.ATTR_METHOD_PARAMETERS属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSyntheticDeserializeLambda
public void addSyntheticDeserializeLambda(SyntheticMethodBinding methodBinding, SyntheticMethodBinding[] syntheticMethodBindings ) {
generateMethodInfoHeader(methodBinding);
int methodAttributeOffset = this.contentsOffset;
// this will add exception attribute, synthetic attribute, deprecated attribute,...
int attributeNumber = generateMethodInfoAttributes(methodBinding);
// Code attribute
int codeAttributeOffset = this.contentsOffset;
attributeNumber++; // add code attribute
generateCodeAttributeHeader();
this.codeStream.init(this);
this.codeStream.generateSyntheticBodyForDeserializeLambda(methodBinding, syntheticMethodBindings);
completeCodeAttributeForSyntheticMethod(
methodBinding,
codeAttributeOffset,
((SourceTypeBinding) methodBinding.declaringClass)
.scope
.referenceCompilationUnit()
.compilationResult
.getLineSeparatorPositions());
// update the number of attributes
if ((this.produceAttributes & ClassFileConstants.ATTR_METHOD_PARAMETERS) != 0) {
attributeNumber += generateMethodParameters(methodBinding);
}
this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);
this.contents[methodAttributeOffset] = (byte) attributeNumber;
}
示例2: ClassFile
public ClassFile(SourceTypeBinding typeBinding) {
// default constructor for subclasses
this.constantPool = new ConstantPool(this);
final CompilerOptions options = typeBinding.scope.compilerOptions();
this.targetJDK = options.targetJDK;
this.produceAttributes = options.produceDebugAttributes;
this.referenceBinding = typeBinding;
this.isNestedType = typeBinding.isNestedType();
if (this.targetJDK >= ClassFileConstants.JDK1_6) {
this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE;
if (this.targetJDK >= ClassFileConstants.JDK1_8) {
this.produceAttributes |= ClassFileConstants.ATTR_TYPE_ANNOTATION;
this.codeStream = new TypeAnnotationCodeStream(this);
if (options.produceMethodParameters) {
this.produceAttributes |= ClassFileConstants.ATTR_METHOD_PARAMETERS;
}
} else {
this.codeStream = new StackMapFrameCodeStream(this);
}
} else if (this.targetJDK == ClassFileConstants.CLDC_1_1) {
this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3
this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP;
this.codeStream = new StackMapFrameCodeStream(this);
} else {
this.codeStream = new CodeStream(this);
}
initByteArrays();
}
示例3: addSyntheticEnumValueOfMethod
/**
* INTERNAL USE-ONLY
* Generate the bytes for a synthetic method that implements Enum#valueOf(String) for a given enum type
*
* @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.SyntheticAccessMethodBinding
*/
public void addSyntheticEnumValueOfMethod(SyntheticMethodBinding methodBinding) {
generateMethodInfoHeader(methodBinding);
int methodAttributeOffset = this.contentsOffset;
// this will add exception attribute, synthetic attribute, deprecated attribute,...
int attributeNumber = generateMethodInfoAttributes(methodBinding);
// Code attribute
int codeAttributeOffset = this.contentsOffset;
attributeNumber++; // add code attribute
generateCodeAttributeHeader();
this.codeStream.init(this);
this.codeStream.generateSyntheticBodyForEnumValueOf(methodBinding);
completeCodeAttributeForSyntheticMethod(
methodBinding,
codeAttributeOffset,
((SourceTypeBinding) methodBinding.declaringClass)
.scope
.referenceCompilationUnit()
.compilationResult
.getLineSeparatorPositions());
// update the number of attributes
if ((this.produceAttributes & ClassFileConstants.ATTR_METHOD_PARAMETERS) != 0) {
attributeNumber += generateMethodParameters(methodBinding);
}
this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);
this.contents[methodAttributeOffset] = (byte) attributeNumber;
}
示例4: reset
public void reset(SourceTypeBinding typeBinding) {
// the code stream is reinitialized for each method
final CompilerOptions options = typeBinding.scope.compilerOptions();
this.referenceBinding = typeBinding;
this.isNestedType = typeBinding.isNestedType();
this.targetJDK = options.targetJDK;
this.produceAttributes = options.produceDebugAttributes;
if (this.targetJDK >= ClassFileConstants.JDK1_6) {
this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE;
if (this.targetJDK >= ClassFileConstants.JDK1_8) {
this.produceAttributes |= ClassFileConstants.ATTR_TYPE_ANNOTATION;
if (options.produceMethodParameters) {
this.produceAttributes |= ClassFileConstants.ATTR_METHOD_PARAMETERS;
}
}
} else if (this.targetJDK == ClassFileConstants.CLDC_1_1) {
this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3
this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP;
}
this.bytes = null;
this.constantPool.reset();
this.codeStream.reset(this);
this.constantPoolOffset = 0;
this.contentsOffset = 0;
this.creatingProblemType = false;
this.enclosingClassFile = null;
this.headerOffset = 0;
this.methodCount = 0;
this.methodCountOffset = 0;
if (this.innerClassesBindings != null) {
this.innerClassesBindings.clear();
}
if (this.bootstrapMethods != null) {
this.bootstrapMethods.clear();
}
this.missingTypes = null;
this.visitedTypes = null;
}