本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.enclosingSourceType()
方法的一些代码示例,展示了BlockScope.enclosingSourceType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.enclosingSourceType()
方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:enclosingSourceType
暂无
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
public void setAnnotations(AnnotationBinding[] annotations) {
if (this.declaringScope == null) return;
SourceTypeBinding sourceType = this.declaringScope.enclosingSourceType();
if (sourceType != null)
sourceType.storeAnnotations(this, annotations);
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public void setAnnotations(AnnotationBinding[] annotations) {
if (this.declaringScope == null) return;
SourceTypeBinding sourceType = this.declaringScope.enclosingSourceType();
if (sourceType != null)
sourceType.storeAnnotations(this, annotations);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
public final void addAnonymousType(TypeDeclaration anonymousType, ReferenceBinding superBinding) {
ClassScope anonymousClassScope = new ClassScope(this, anonymousType);
anonymousClassScope.buildAnonymousTypeBinding(
enclosingSourceType(),
superBinding);
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
public final void addAnonymousType(TypeDeclaration anonymousType, ReferenceBinding superBinding) {
ClassScope anonymousClassScope = new ClassScope(this, anonymousType);
anonymousClassScope.buildAnonymousTypeBinding(
enclosingSourceType(),
superBinding);
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public final void addAnonymousType(TypeDeclaration anonymousType, ReferenceBinding superBinding) {
ClassScope anonymousClassScope = new ClassScope(this, anonymousType);
anonymousClassScope.buildAnonymousTypeBinding(
enclosingSourceType(),
superBinding);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps
public final void addLocalType(TypeDeclaration localType) {
ClassScope localTypeScope = new ClassScope(this, localType);
addSubscope(localTypeScope);
localTypeScope.buildLocalTypeBinding(enclosingSourceType());
// See comment in addAnonymousType.
MethodScope methodScope = methodScope();
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
if (!lambda.scope.isStatic && !lambda.scope.isConstructorCall) {
lambda.shouldCaptureInstance = true;
}
methodScope = methodScope.enclosingMethodScope();
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
ReferenceBinding superTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
// perform some emulation work in case there is some and we are inside a local type only
if (superTypeErasure.isNestedType()
&& currentScope.enclosingSourceType().isLocalType()) {
if (superTypeErasure.isLocalType()) {
((LocalTypeBinding) superTypeErasure).addInnerEmulationDependent(currentScope, this.qualification != null);
} else {
// locally propagate, since we already now the desired shape for sure
currentScope.propagateInnerEmulation(superTypeErasure, this.qualification != null);
}
}
}
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
// perform some extra emulation work in case there is some and we are inside a local type only
if (allocatedTypeErasure.isNestedType()
&& currentScope.enclosingSourceType().isLocalType()) {
if (allocatedTypeErasure.isLocalType()) {
((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
} else {
// locally propagate, since we already now the desired shape for sure
currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
}
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
// perform some extra emulation work in case there is some and we are inside a local type only
if (allocatedTypeErasure.isNestedType()
&& (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
if (allocatedTypeErasure.isLocalType()) {
((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, this.enclosingInstance != null);
} else {
// locally propagate, since we already now the desired shape for sure
currentScope.propagateInnerEmulation(allocatedTypeErasure, this.enclosingInstance != null);
}
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
ReferenceBinding allocatedTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure();
// perform some emulation work in case there is some and we are inside a local type only
if (allocatedTypeErasure.isNestedType()
&& (currentScope.enclosingSourceType().isLocalType() || currentScope.isLambdaSubscope())) {
if (allocatedTypeErasure.isLocalType()) {
((LocalTypeBinding) allocatedTypeErasure).addInnerEmulationDependent(currentScope, false);
// request cascade of accesses
} else {
// locally propagate, since we already now the desired shape for sure
currentScope.propagateInnerEmulation(allocatedTypeErasure, false);
// request cascade of accesses
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
// if constructor from parameterized type got found, use the original constructor at codegen time
MethodBinding codegenBinding = this.binding.original();
ReferenceBinding declaringClass;
if (codegenBinding.isPrivate() && TypeBinding.notEquals(currentScope.enclosingSourceType(), (declaringClass = codegenBinding.declaringClass))) {
// from 1.4 on, local type constructor can lose their private flag to ease emulation
if ((declaringClass.tagBits & TagBits.IsLocalType) != 0 && currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) {
// constructor will not be dumped as private, no emulation required thus
codegenBinding.tagBits |= TagBits.ClearPrivateModifier;
} else {
this.syntheticAccessor = ((SourceTypeBinding) declaringClass).addSyntheticMethod(codegenBinding, isSuperAccess());
currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!