001/*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019 */
020package org.sonar.java.bytecode.asm;
021
022import org.objectweb.asm.Opcodes;
023
024public final class AsmAccessFlags {
025
026  private AsmAccessFlags() {
027    // utils class : only static methods
028  }
029
030  public static boolean isPrivate(int accessFlags) {
031    return (accessFlags & Opcodes.ACC_PRIVATE) != 0;
032  }
033
034  public static boolean isProtected(int accessFlags) {
035    return (accessFlags & Opcodes.ACC_PROTECTED) != 0;
036  }
037
038  public static boolean isPublic(int accessFlags) {
039    return (accessFlags & Opcodes.ACC_PUBLIC) != 0;
040  }
041
042  public static boolean isStatic(int accessFlags) {
043    return (accessFlags & Opcodes.ACC_STATIC) != 0;
044  }
045
046  public static boolean isAbstract(int accessFlags) {
047    return (accessFlags & Opcodes.ACC_ABSTRACT) != 0;
048  }
049
050  public static boolean isInterface(int accessFlags) {
051    return (accessFlags & Opcodes.ACC_INTERFACE) != 0;
052  }
053
054  public static boolean isDeprecated(int accessFlags) {
055    return (accessFlags & Opcodes.ACC_DEPRECATED) != 0;
056  }
057
058  public static boolean isFinal(int accessFlags) {
059    return (accessFlags & Opcodes.ACC_FINAL) != 0;
060  }
061}