private List<MetaMethod> getSpecialTypeMethods() { final List<MetaMethod> meths = new ArrayList<MetaMethod>(); final JEnumType type = getEnclosedMetaObject().isEnum(); if (type != null) { meths.add( new GWTSpecialMethod(this, DefModifiers.none(), Scope.Public, String.class, "name")); meths.add( new GWTSpecialMethod( this, DefModifiers.none(), Scope.Public, Enum.class, "valueOf", Parameter.of(String.class, "p").getMetaParameter())); meths.add( new GWTSpecialMethod(this, DefModifiers.none(), Scope.Public, Enum[].class, "values")); } return meths; }
public static DefModifiers modifiersOf(final MetaClassMember member) { final DefModifiers defModifiers = new DefModifiers(); if (member.isAbstract()) { defModifiers.addModifiers(Modifier.Abstract); } else if (member.isFinal()) { defModifiers.addModifiers(Modifier.Final); } else if (member.isStatic()) { defModifiers.addModifiers(Modifier.Static); } else if (member.isSynchronized()) { defModifiers.addModifiers(Modifier.Synchronized); } else if (member.isVolatile()) { defModifiers.addModifiers(Modifier.Volatile); } else if (member.isTransient()) { defModifiers.addModifiers(Modifier.Transient); } return defModifiers; }