2 * JavaInspect - Utility to visualize java software
3 * Copyright (C) 2013-2015, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 3 of the GNU Lesser General Public License
7 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.inspector.java.methods;
12 public class Modifiers {
15 PUBLIC("public"), PROTECTED("protected"), DEFAULT(""), PRIVATE(
18 public final String name;
20 Access(final String name) {
25 Access access = Access.DEFAULT;
27 boolean isStatic = false;;
29 boolean isFinal = false;
31 boolean isAbstract = false;
33 public boolean parseModifier(final String string) {
34 for (final Access access : Access.values())
35 if (access.name.equals(string)) {
40 if ("static".equals(string)) {
45 if ("final".equals(string)) {
50 if ("abstract".equals(string)) {
61 access = Access.DEFAULT;
65 public String toString() {
66 final StringBuffer result = new StringBuffer();
68 result.append(access.name);
71 if (result.length() > 0)
73 result.append("static");
77 if (result.length() > 0)
79 result.append("final");
82 return result.toString();