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 {
14 Access access = Access.DEFAULT;
15 boolean isStatic = false;
16 boolean isFinal = false;
17 boolean isAbstract = false;
19 public boolean parseModifier(final String string) {
20 for (final Access access : Access.values())
21 if (access.name.equals(string)) {
26 if ("static".equals(string)) {
31 if ("final".equals(string)) {
36 if ("abstract".equals(string)) {
47 access = Access.DEFAULT;
51 public String toString() {
52 final StringBuffer result = new StringBuffer();
54 result.append(access.name);
57 if (result.length() > 0)
59 result.append("static");
63 if (result.length() > 0)
65 result.append("final");
68 return result.toString();
72 PUBLIC("public"), PROTECTED("protected"), DEFAULT(""), PRIVATE(
75 public final String name;
77 Access(final String name) {