Exemplo n.º 1
0
 private void printModifiers(int modifiers) {
   if (ModifierSet.isPrivate(modifiers)) {}
   if (ModifierSet.isProtected(modifiers)) {}
   if (ModifierSet.isPublic(modifiers)) {}
   if (ModifierSet.isAbstract(modifiers)) {}
   if (ModifierSet.isStatic(modifiers)) {}
   if (ModifierSet.isFinal(modifiers)) {}
   if (ModifierSet.isNative(modifiers)) {}
   if (ModifierSet.isStrictfp(modifiers)) {}
   if (ModifierSet.isSynchronized(modifiers)) {}
   if (ModifierSet.isTransient(modifiers)) {}
   if (ModifierSet.isVolatile(modifiers)) {}
 }
  public static String translateModifiers(int modifiers) {
    String returnString = "";
    if (ModifierSet.isPrivate(modifiers)) {
      returnString += "private ";
    }
    if (ModifierSet.isProtected(modifiers)) {
      returnString += "protected ";
    }
    if (ModifierSet.isPublic(modifiers)) {
      returnString += "public ";
    }
    if (ModifierSet.isAbstract(modifiers)) {
      returnString += "abstract ";
    }
    if (ModifierSet.isStatic(modifiers)) {
      returnString += "static ";
    }
    if (ModifierSet.isFinal(modifiers)) {
      returnString += "final ";
    }
    if (ModifierSet.isNative(modifiers)) {
      returnString += "native ";
    }
    if (ModifierSet.isStrictfp(modifiers)) {
      returnString += "strictfp ";
    }
    if (ModifierSet.isSynchronized(modifiers)) {
      returnString += "synchronized ";
    }
    if (ModifierSet.isTransient(modifiers)) {
      returnString += "transient ";
    }
    if (ModifierSet.isVolatile(modifiers)) {
      returnString += "volatile ";
    }

    if (!returnString.isEmpty())
      returnString = returnString.substring(0, returnString.length() - 1);

    return returnString;
  }