public final int getModifiers() { int mask = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED; return (componentType.getModifiers() & mask) | Modifier.FINAL; }
public final boolean isAbstract() { return Modifier.isAbstract(getModifiers()); }
public final boolean isInterface() { return Modifier.isInterface(getModifiers()); }
public final boolean isFinal() { return Modifier.isFinal(getModifiers()); }
public boolean canBeSeenBy(ResolvedType from) { int targetMods = getModifiers(); if (Modifier.isPublic(targetMods)) { return true; } if (Modifier.isPrivate(targetMods)) { return false; } // isProtected() or isDefault() return getPackageName().equals(from.getPackageName()); }
@Override public FuzzyBoolean matchesInstanceof(ResolvedType type) { if (Modifier.isFinal(type.getModifiers())) { return FuzzyBoolean.fromBoolean(matchesExactly(type)); } return FuzzyBoolean.MAYBE; }
/** * @return true if the supplied type is of the category specified for this type pattern */ private boolean isRightCategory(ResolvedType type) { switch (category) { case CLASS: return type.isClass(); case INTERFACE: return type.isInterface(); case ASPECT: return type.isAspect(); case ANONYMOUS: return type.isAnonymous(); case INNER: return type.isNested(); case ENUM: return type.isEnum(); case ANNOTATION: return type.isAnnotation(); case FINAL: return Modifier.isFinal(type.getModifiers()); } return false; }
private static IProgramElement createDeclareErrorOrWarningChild(AsmManager model, ResolvedType aspect, DeclareErrorOrWarning decl, int count) { IProgramElement deowNode = new ProgramElement(model, decl.getName(), decl.isError() ? IProgramElement.Kind.DECLARE_ERROR : IProgramElement.Kind.DECLARE_WARNING, getBinarySourceLocation(aspect, decl.getSourceLocation()), decl .getDeclaringType().getModifiers(), null, null); deowNode.setDetails("\"" + AsmRelationshipUtils.genDeclareMessage(decl.getMessage()) + "\""); if (count != -1) { deowNode.setBytecodeName(decl.getName() + "_" + count); } return deowNode; }
int implModifiers = impl.getModifiers(); boolean defaultVisibilityImpl = !(Modifier.isPrivate(implModifiers) || Modifier.isProtected(implModifiers) || Modifier.isPublic(implModifiers));
getBinarySourceLocation(aspect, aspect.getSourceLocation()), aspect.getModifiers(), null, null); classFileNode.addChild(aspectNode);
munger.getBinarySourceLocation(aspect.getSourceLocation()), aspect.getModifiers(), null, null); classFileNode.addChild(aspectNode);