protected void checkStaticFlag(JvmDeclaredType type) { if (!type.isStatic()) { throw new IllegalArgumentException("type may not be an inner class"); } }
@Override protected void checkStaticFlag(JvmDeclaredType type) { if (type.isStatic()) { throw new IllegalArgumentException("type must be an inner class"); } }
@Override protected void checkStaticFlag(JvmDeclaredType type) { if (type.isStatic()) { throw new IllegalArgumentException("type must be an inner class"); } }
protected boolean isStatic(JvmIdentifiableElement declarator) { if (declarator instanceof JvmFeature) { return ((JvmFeature) declarator).isStatic(); } if (declarator instanceof JvmDeclaredType) { return ((JvmDeclaredType) declarator).isStatic(); } return false; }
protected boolean isStaticContext(EObject element) { if(element instanceof JvmConstructor) return false; if(element instanceof JvmFeature) return ((JvmFeature) element).isStatic(); if(element instanceof JvmDeclaredType) return ((JvmDeclaredType) element).isStatic() || ( ((JvmDeclaredType)element).getDeclaringType() == null && !isLocalType(element)); return false; }
protected void setTypeModifiers(int accessFlags) { result.setAbstract((accessFlags & ACC_ABSTRACT) != 0); result.setStatic((accessFlags & ACC_STATIC) != 0); result.setDeprecated((accessFlags & ACC_DEPRECATED) != 0); if (result.eClass() != TypesPackage.Literals.JVM_ENUMERATION_TYPE) { if (result.isStatic()) { offset = 0; } result.setFinal((accessFlags & ACC_FINAL) != 0); } }
protected IFeatureScopeSession addThisAndSuper( IFeatureScopeSession session, ITypeReferenceOwner owner, JvmDeclaredType thisType, /* @Nullable */ JvmTypeReference superType, boolean addNestedTypes) { IFeatureScopeSession childSession = session; if (thisType.eContainer() != null) { if (thisType.isStatic()) { childSession = childSession.dropLocalElements(); } else { childSession = childSession.captureLocalElements(); } } if (superType != null && superType.getType() != null) { ImmutableMap.Builder<QualifiedName, JvmIdentifiableElement> builder = ImmutableMap.builder(); builder.put(IFeatureNames.THIS, thisType); builder.put(IFeatureNames.SUPER, superType.getType()); childSession = childSession.addLocalElements(builder.build(), owner); } else { childSession = childSession.addLocalElement(IFeatureNames.THIS, thisType, owner); } childSession = addThisTypeToStaticScope(childSession, thisType); if (addNestedTypes) childSession = childSession.addNestedTypesToScope(thisType); return childSession; }
public boolean isLocalTypeParameter(EObject context, JvmTypeParameter parameter) { if (context == parameter.getDeclarator()) return true; if (context instanceof JvmOperation && ((JvmOperation) context).isStatic()) return false; if (context instanceof JvmDeclaredType && ((JvmDeclaredType) context).isStatic()) return false; JvmIdentifiableElement jvmElement = contextProvider.getNearestLogicalContainer(context); if (jvmElement != null) { return isLocalTypeParameter(jvmElement, parameter); } EObject container = context.eContainer(); if (container == null) { return false; } return isLocalTypeParameter(container, parameter); }
public SignatureHashBuilder appendSignature(JvmDeclaredType type) { if (type.getVisibility() != JvmVisibility.PRIVATE) { appendAnnotationReferences(type); appendVisibility(type.getVisibility()).append(" "); if (type.isAbstract()) append("abstract "); if (type.isStatic()) append("static "); if (type.isFinal()) append("final "); append("class ").append(type.getIdentifier()); if (type instanceof JvmTypeParameterDeclarator) appendTypeParameters((JvmTypeParameterDeclarator) type); append("\n").appendSuperTypeSignatures(type).appendMemberSignatures(type, false); } return this; }