emul/src/main/java/java/lang/reflect/Modifier.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 04 Dec 2012 14:08:19 +0100
branchreflection
changeset 259 9b0fbf4ec230
child 260 1d03cb35fbda
permissions -rw-r--r--
Merging in some reflection classes from jdk7-b147
jtulach@258
     1
/*
jtulach@258
     2
 * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
jtulach@258
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jtulach@258
     4
 *
jtulach@258
     5
 * This code is free software; you can redistribute it and/or modify it
jtulach@258
     6
 * under the terms of the GNU General Public License version 2 only, as
jtulach@258
     7
 * published by the Free Software Foundation.  Oracle designates this
jtulach@258
     8
 * particular file as subject to the "Classpath" exception as provided
jtulach@258
     9
 * by Oracle in the LICENSE file that accompanied this code.
jtulach@258
    10
 *
jtulach@258
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jtulach@258
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jtulach@258
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jtulach@258
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jtulach@258
    15
 * accompanied this code).
jtulach@258
    16
 *
jtulach@258
    17
 * You should have received a copy of the GNU General Public License version
jtulach@258
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jtulach@258
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jtulach@258
    20
 *
jtulach@258
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jtulach@258
    22
 * or visit www.oracle.com if you need additional information or have any
jtulach@258
    23
 * questions.
jtulach@258
    24
 */
jtulach@258
    25
jtulach@258
    26
package java.lang.reflect;
jtulach@258
    27
jtulach@258
    28
import java.security.AccessController;
jtulach@258
    29
import sun.reflect.LangReflectAccess;
jtulach@258
    30
import sun.reflect.ReflectionFactory;
jtulach@258
    31
jtulach@258
    32
/**
jtulach@258
    33
 * The Modifier class provides {@code static} methods and
jtulach@258
    34
 * constants to decode class and member access modifiers.  The sets of
jtulach@258
    35
 * modifiers are represented as integers with distinct bit positions
jtulach@258
    36
 * representing different modifiers.  The values for the constants
jtulach@258
    37
 * representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of
jtulach@258
    38
 * <cite>The Java&trade; Virtual Machine Specification</cite>.
jtulach@258
    39
 *
jtulach@258
    40
 * @see Class#getModifiers()
jtulach@258
    41
 * @see Member#getModifiers()
jtulach@258
    42
 *
jtulach@258
    43
 * @author Nakul Saraiya
jtulach@258
    44
 * @author Kenneth Russell
jtulach@258
    45
 */
jtulach@258
    46
public
jtulach@258
    47
class Modifier {
jtulach@258
    48
jtulach@258
    49
    /*
jtulach@258
    50
     * Bootstrapping protocol between java.lang and java.lang.reflect
jtulach@258
    51
     *  packages
jtulach@258
    52
     */
jtulach@258
    53
    static {
jtulach@258
    54
        sun.reflect.ReflectionFactory factory =
jtulach@258
    55
            AccessController.doPrivileged(
jtulach@258
    56
                new ReflectionFactory.GetReflectionFactoryAction());
jtulach@258
    57
        factory.setLangReflectAccess(new java.lang.reflect.ReflectAccess());
jtulach@258
    58
    }
jtulach@258
    59
jtulach@258
    60
    /**
jtulach@258
    61
     * Return {@code true} if the integer argument includes the
jtulach@258
    62
     * {@code public} modifier, {@code false} otherwise.
jtulach@258
    63
     *
jtulach@258
    64
     * @param   mod a set of modifiers
jtulach@258
    65
     * @return {@code true} if {@code mod} includes the
jtulach@258
    66
     * {@code public} modifier; {@code false} otherwise.
jtulach@258
    67
     */
jtulach@258
    68
    public static boolean isPublic(int mod) {
jtulach@258
    69
        return (mod & PUBLIC) != 0;
jtulach@258
    70
    }
jtulach@258
    71
jtulach@258
    72
    /**
jtulach@258
    73
     * Return {@code true} if the integer argument includes the
jtulach@258
    74
     * {@code private} modifier, {@code false} otherwise.
jtulach@258
    75
     *
jtulach@258
    76
     * @param   mod a set of modifiers
jtulach@258
    77
     * @return {@code true} if {@code mod} includes the
jtulach@258
    78
     * {@code private} modifier; {@code false} otherwise.
jtulach@258
    79
     */
jtulach@258
    80
    public static boolean isPrivate(int mod) {
jtulach@258
    81
        return (mod & PRIVATE) != 0;
jtulach@258
    82
    }
jtulach@258
    83
jtulach@258
    84
    /**
jtulach@258
    85
     * Return {@code true} if the integer argument includes the
jtulach@258
    86
     * {@code protected} modifier, {@code false} otherwise.
jtulach@258
    87
     *
jtulach@258
    88
     * @param   mod a set of modifiers
jtulach@258
    89
     * @return {@code true} if {@code mod} includes the
jtulach@258
    90
     * {@code protected} modifier; {@code false} otherwise.
jtulach@258
    91
     */
jtulach@258
    92
    public static boolean isProtected(int mod) {
jtulach@258
    93
        return (mod & PROTECTED) != 0;
jtulach@258
    94
    }
jtulach@258
    95
jtulach@258
    96
    /**
jtulach@258
    97
     * Return {@code true} if the integer argument includes the
jtulach@258
    98
     * {@code static} modifier, {@code false} otherwise.
jtulach@258
    99
     *
jtulach@258
   100
     * @param   mod a set of modifiers
jtulach@258
   101
     * @return {@code true} if {@code mod} includes the
jtulach@258
   102
     * {@code static} modifier; {@code false} otherwise.
jtulach@258
   103
     */
jtulach@258
   104
    public static boolean isStatic(int mod) {
jtulach@258
   105
        return (mod & STATIC) != 0;
jtulach@258
   106
    }
jtulach@258
   107
jtulach@258
   108
    /**
jtulach@258
   109
     * Return {@code true} if the integer argument includes the
jtulach@258
   110
     * {@code final} modifier, {@code false} otherwise.
jtulach@258
   111
     *
jtulach@258
   112
     * @param   mod a set of modifiers
jtulach@258
   113
     * @return {@code true} if {@code mod} includes the
jtulach@258
   114
     * {@code final} modifier; {@code false} otherwise.
jtulach@258
   115
     */
jtulach@258
   116
    public static boolean isFinal(int mod) {
jtulach@258
   117
        return (mod & FINAL) != 0;
jtulach@258
   118
    }
jtulach@258
   119
jtulach@258
   120
    /**
jtulach@258
   121
     * Return {@code true} if the integer argument includes the
jtulach@258
   122
     * {@code synchronized} modifier, {@code false} otherwise.
jtulach@258
   123
     *
jtulach@258
   124
     * @param   mod a set of modifiers
jtulach@258
   125
     * @return {@code true} if {@code mod} includes the
jtulach@258
   126
     * {@code synchronized} modifier; {@code false} otherwise.
jtulach@258
   127
     */
jtulach@258
   128
    public static boolean isSynchronized(int mod) {
jtulach@258
   129
        return (mod & SYNCHRONIZED) != 0;
jtulach@258
   130
    }
jtulach@258
   131
jtulach@258
   132
    /**
jtulach@258
   133
     * Return {@code true} if the integer argument includes the
jtulach@258
   134
     * {@code volatile} modifier, {@code false} otherwise.
jtulach@258
   135
     *
jtulach@258
   136
     * @param   mod a set of modifiers
jtulach@258
   137
     * @return {@code true} if {@code mod} includes the
jtulach@258
   138
     * {@code volatile} modifier; {@code false} otherwise.
jtulach@258
   139
     */
jtulach@258
   140
    public static boolean isVolatile(int mod) {
jtulach@258
   141
        return (mod & VOLATILE) != 0;
jtulach@258
   142
    }
jtulach@258
   143
jtulach@258
   144
    /**
jtulach@258
   145
     * Return {@code true} if the integer argument includes the
jtulach@258
   146
     * {@code transient} modifier, {@code false} otherwise.
jtulach@258
   147
     *
jtulach@258
   148
     * @param   mod a set of modifiers
jtulach@258
   149
     * @return {@code true} if {@code mod} includes the
jtulach@258
   150
     * {@code transient} modifier; {@code false} otherwise.
jtulach@258
   151
     */
jtulach@258
   152
    public static boolean isTransient(int mod) {
jtulach@258
   153
        return (mod & TRANSIENT) != 0;
jtulach@258
   154
    }
jtulach@258
   155
jtulach@258
   156
    /**
jtulach@258
   157
     * Return {@code true} if the integer argument includes the
jtulach@258
   158
     * {@code native} modifier, {@code false} otherwise.
jtulach@258
   159
     *
jtulach@258
   160
     * @param   mod a set of modifiers
jtulach@258
   161
     * @return {@code true} if {@code mod} includes the
jtulach@258
   162
     * {@code native} modifier; {@code false} otherwise.
jtulach@258
   163
     */
jtulach@258
   164
    public static boolean isNative(int mod) {
jtulach@258
   165
        return (mod & NATIVE) != 0;
jtulach@258
   166
    }
jtulach@258
   167
jtulach@258
   168
    /**
jtulach@258
   169
     * Return {@code true} if the integer argument includes the
jtulach@258
   170
     * {@code interface} modifier, {@code false} otherwise.
jtulach@258
   171
     *
jtulach@258
   172
     * @param   mod a set of modifiers
jtulach@258
   173
     * @return {@code true} if {@code mod} includes the
jtulach@258
   174
     * {@code interface} modifier; {@code false} otherwise.
jtulach@258
   175
     */
jtulach@258
   176
    public static boolean isInterface(int mod) {
jtulach@258
   177
        return (mod & INTERFACE) != 0;
jtulach@258
   178
    }
jtulach@258
   179
jtulach@258
   180
    /**
jtulach@258
   181
     * Return {@code true} if the integer argument includes the
jtulach@258
   182
     * {@code abstract} modifier, {@code false} otherwise.
jtulach@258
   183
     *
jtulach@258
   184
     * @param   mod a set of modifiers
jtulach@258
   185
     * @return {@code true} if {@code mod} includes the
jtulach@258
   186
     * {@code abstract} modifier; {@code false} otherwise.
jtulach@258
   187
     */
jtulach@258
   188
    public static boolean isAbstract(int mod) {
jtulach@258
   189
        return (mod & ABSTRACT) != 0;
jtulach@258
   190
    }
jtulach@258
   191
jtulach@258
   192
    /**
jtulach@258
   193
     * Return {@code true} if the integer argument includes the
jtulach@258
   194
     * {@code strictfp} modifier, {@code false} otherwise.
jtulach@258
   195
     *
jtulach@258
   196
     * @param   mod a set of modifiers
jtulach@258
   197
     * @return {@code true} if {@code mod} includes the
jtulach@258
   198
     * {@code strictfp} modifier; {@code false} otherwise.
jtulach@258
   199
     */
jtulach@258
   200
    public static boolean isStrict(int mod) {
jtulach@258
   201
        return (mod & STRICT) != 0;
jtulach@258
   202
    }
jtulach@258
   203
jtulach@258
   204
    /**
jtulach@258
   205
     * Return a string describing the access modifier flags in
jtulach@258
   206
     * the specified modifier. For example:
jtulach@258
   207
     * <blockquote><pre>
jtulach@258
   208
     *    public final synchronized strictfp
jtulach@258
   209
     * </pre></blockquote>
jtulach@258
   210
     * The modifier names are returned in an order consistent with the
jtulach@258
   211
     * suggested modifier orderings given in sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1 of
jtulach@258
   212
     * <cite>The Java&trade; Language Specification</cite>.
jtulach@258
   213
     * The full modifier ordering used by this method is:
jtulach@258
   214
     * <blockquote> {@code
jtulach@258
   215
     * public protected private abstract static final transient
jtulach@258
   216
     * volatile synchronized native strictfp
jtulach@258
   217
     * interface } </blockquote>
jtulach@258
   218
     * The {@code interface} modifier discussed in this class is
jtulach@258
   219
     * not a true modifier in the Java language and it appears after
jtulach@258
   220
     * all other modifiers listed by this method.  This method may
jtulach@258
   221
     * return a string of modifiers that are not valid modifiers of a
jtulach@258
   222
     * Java entity; in other words, no checking is done on the
jtulach@258
   223
     * possible validity of the combination of modifiers represented
jtulach@258
   224
     * by the input.
jtulach@258
   225
     *
jtulach@258
   226
     * Note that to perform such checking for a known kind of entity,
jtulach@258
   227
     * such as a constructor or method, first AND the argument of
jtulach@258
   228
     * {@code toString} with the appropriate mask from a method like
jtulach@258
   229
     * {@link #constructorModifiers} or {@link #methodModifiers}.
jtulach@258
   230
     *
jtulach@258
   231
     * @param   mod a set of modifiers
jtulach@258
   232
     * @return  a string representation of the set of modifiers
jtulach@258
   233
     * represented by {@code mod}
jtulach@258
   234
     */
jtulach@258
   235
    public static String toString(int mod) {
jtulach@258
   236
        StringBuffer sb = new StringBuffer();
jtulach@258
   237
        int len;
jtulach@258
   238
jtulach@258
   239
        if ((mod & PUBLIC) != 0)        sb.append("public ");
jtulach@258
   240
        if ((mod & PROTECTED) != 0)     sb.append("protected ");
jtulach@258
   241
        if ((mod & PRIVATE) != 0)       sb.append("private ");
jtulach@258
   242
jtulach@258
   243
        /* Canonical order */
jtulach@258
   244
        if ((mod & ABSTRACT) != 0)      sb.append("abstract ");
jtulach@258
   245
        if ((mod & STATIC) != 0)        sb.append("static ");
jtulach@258
   246
        if ((mod & FINAL) != 0)         sb.append("final ");
jtulach@258
   247
        if ((mod & TRANSIENT) != 0)     sb.append("transient ");
jtulach@258
   248
        if ((mod & VOLATILE) != 0)      sb.append("volatile ");
jtulach@258
   249
        if ((mod & SYNCHRONIZED) != 0)  sb.append("synchronized ");
jtulach@258
   250
        if ((mod & NATIVE) != 0)        sb.append("native ");
jtulach@258
   251
        if ((mod & STRICT) != 0)        sb.append("strictfp ");
jtulach@258
   252
        if ((mod & INTERFACE) != 0)     sb.append("interface ");
jtulach@258
   253
jtulach@258
   254
        if ((len = sb.length()) > 0)    /* trim trailing space */
jtulach@258
   255
            return sb.toString().substring(0, len-1);
jtulach@258
   256
        return "";
jtulach@258
   257
    }
jtulach@258
   258
jtulach@258
   259
    /*
jtulach@258
   260
     * Access modifier flag constants from tables 4.1, 4.4, 4.5, and 4.7 of
jtulach@258
   261
     * <cite>The Java&trade; Virtual Machine Specification</cite>
jtulach@258
   262
     */
jtulach@258
   263
jtulach@258
   264
    /**
jtulach@258
   265
     * The {@code int} value representing the {@code public}
jtulach@258
   266
     * modifier.
jtulach@258
   267
     */
jtulach@258
   268
    public static final int PUBLIC           = 0x00000001;
jtulach@258
   269
jtulach@258
   270
    /**
jtulach@258
   271
     * The {@code int} value representing the {@code private}
jtulach@258
   272
     * modifier.
jtulach@258
   273
     */
jtulach@258
   274
    public static final int PRIVATE          = 0x00000002;
jtulach@258
   275
jtulach@258
   276
    /**
jtulach@258
   277
     * The {@code int} value representing the {@code protected}
jtulach@258
   278
     * modifier.
jtulach@258
   279
     */
jtulach@258
   280
    public static final int PROTECTED        = 0x00000004;
jtulach@258
   281
jtulach@258
   282
    /**
jtulach@258
   283
     * The {@code int} value representing the {@code static}
jtulach@258
   284
     * modifier.
jtulach@258
   285
     */
jtulach@258
   286
    public static final int STATIC           = 0x00000008;
jtulach@258
   287
jtulach@258
   288
    /**
jtulach@258
   289
     * The {@code int} value representing the {@code final}
jtulach@258
   290
     * modifier.
jtulach@258
   291
     */
jtulach@258
   292
    public static final int FINAL            = 0x00000010;
jtulach@258
   293
jtulach@258
   294
    /**
jtulach@258
   295
     * The {@code int} value representing the {@code synchronized}
jtulach@258
   296
     * modifier.
jtulach@258
   297
     */
jtulach@258
   298
    public static final int SYNCHRONIZED     = 0x00000020;
jtulach@258
   299
jtulach@258
   300
    /**
jtulach@258
   301
     * The {@code int} value representing the {@code volatile}
jtulach@258
   302
     * modifier.
jtulach@258
   303
     */
jtulach@258
   304
    public static final int VOLATILE         = 0x00000040;
jtulach@258
   305
jtulach@258
   306
    /**
jtulach@258
   307
     * The {@code int} value representing the {@code transient}
jtulach@258
   308
     * modifier.
jtulach@258
   309
     */
jtulach@258
   310
    public static final int TRANSIENT        = 0x00000080;
jtulach@258
   311
jtulach@258
   312
    /**
jtulach@258
   313
     * The {@code int} value representing the {@code native}
jtulach@258
   314
     * modifier.
jtulach@258
   315
     */
jtulach@258
   316
    public static final int NATIVE           = 0x00000100;
jtulach@258
   317
jtulach@258
   318
    /**
jtulach@258
   319
     * The {@code int} value representing the {@code interface}
jtulach@258
   320
     * modifier.
jtulach@258
   321
     */
jtulach@258
   322
    public static final int INTERFACE        = 0x00000200;
jtulach@258
   323
jtulach@258
   324
    /**
jtulach@258
   325
     * The {@code int} value representing the {@code abstract}
jtulach@258
   326
     * modifier.
jtulach@258
   327
     */
jtulach@258
   328
    public static final int ABSTRACT         = 0x00000400;
jtulach@258
   329
jtulach@258
   330
    /**
jtulach@258
   331
     * The {@code int} value representing the {@code strictfp}
jtulach@258
   332
     * modifier.
jtulach@258
   333
     */
jtulach@258
   334
    public static final int STRICT           = 0x00000800;
jtulach@258
   335
jtulach@258
   336
    // Bits not (yet) exposed in the public API either because they
jtulach@258
   337
    // have different meanings for fields and methods and there is no
jtulach@258
   338
    // way to distinguish between the two in this class, or because
jtulach@258
   339
    // they are not Java programming language keywords
jtulach@258
   340
    static final int BRIDGE    = 0x00000040;
jtulach@258
   341
    static final int VARARGS   = 0x00000080;
jtulach@258
   342
    static final int SYNTHETIC = 0x00001000;
jtulach@258
   343
    static final int ANNOTATION= 0x00002000;
jtulach@258
   344
    static final int ENUM      = 0x00004000;
jtulach@258
   345
    static boolean isSynthetic(int mod) {
jtulach@258
   346
      return (mod & SYNTHETIC) != 0;
jtulach@258
   347
    }
jtulach@258
   348
jtulach@258
   349
    /**
jtulach@258
   350
     * See JLSv3 section 8.1.1.
jtulach@258
   351
     */
jtulach@258
   352
    private static final int CLASS_MODIFIERS =
jtulach@258
   353
        Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
jtulach@258
   354
        Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.FINAL   |
jtulach@258
   355
        Modifier.STRICT;
jtulach@258
   356
jtulach@258
   357
    /**
jtulach@258
   358
     * See JLSv3 section 9.1.1.
jtulach@258
   359
     */
jtulach@258
   360
    private static final int INTERFACE_MODIFIERS =
jtulach@258
   361
        Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
jtulach@258
   362
        Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.STRICT;
jtulach@258
   363
jtulach@258
   364
jtulach@258
   365
    /**
jtulach@258
   366
     * See JLSv3 section 8.8.3.
jtulach@258
   367
     */
jtulach@258
   368
    private static final int CONSTRUCTOR_MODIFIERS =
jtulach@258
   369
        Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE;
jtulach@258
   370
jtulach@258
   371
    /**
jtulach@258
   372
     * See JLSv3 section 8.4.3.
jtulach@258
   373
     */
jtulach@258
   374
    private static final int METHOD_MODIFIERS =
jtulach@258
   375
        Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
jtulach@258
   376
        Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.FINAL   |
jtulach@258
   377
        Modifier.SYNCHRONIZED   | Modifier.NATIVE       | Modifier.STRICT;
jtulach@258
   378
jtulach@258
   379
    /**
jtulach@258
   380
     * See JLSv3 section 8.3.1.
jtulach@258
   381
     */
jtulach@258
   382
    private static final int FIELD_MODIFIERS =
jtulach@258
   383
        Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
jtulach@258
   384
        Modifier.STATIC         | Modifier.FINAL        | Modifier.TRANSIENT |
jtulach@258
   385
        Modifier.VOLATILE;
jtulach@258
   386
jtulach@258
   387
    /**
jtulach@258
   388
     * Return an {@code int} value OR-ing together the source language
jtulach@258
   389
     * modifiers that can be applied to a class.
jtulach@258
   390
     * @return an {@code int} value OR-ing together the source language
jtulach@258
   391
     * modifiers that can be applied to a class.
jtulach@258
   392
     *
jtulach@258
   393
     * @jls 8.1.1 Class Modifiers
jtulach@258
   394
     * @since 1.7
jtulach@258
   395
     */
jtulach@258
   396
    public static int classModifiers() {
jtulach@258
   397
        return CLASS_MODIFIERS;
jtulach@258
   398
    }
jtulach@258
   399
jtulach@258
   400
    /**
jtulach@258
   401
     * Return an {@code int} value OR-ing together the source language
jtulach@258
   402
     * modifiers that can be applied to an interface.
jtulach@258
   403
     * @return an {@code int} value OR-ing together the source language
jtulach@258
   404
     * modifiers that can be applied to an inteface.
jtulach@258
   405
     *
jtulach@258
   406
     * @jls 9.1.1 Interface Modifiers
jtulach@258
   407
     * @since 1.7
jtulach@258
   408
     */
jtulach@258
   409
    public static int interfaceModifiers() {
jtulach@258
   410
        return INTERFACE_MODIFIERS;
jtulach@258
   411
    }
jtulach@258
   412
jtulach@258
   413
    /**
jtulach@258
   414
     * Return an {@code int} value OR-ing together the source language
jtulach@258
   415
     * modifiers that can be applied to a constructor.
jtulach@258
   416
     * @return an {@code int} value OR-ing together the source language
jtulach@258
   417
     * modifiers that can be applied to a constructor.
jtulach@258
   418
     *
jtulach@258
   419
     * @jls 8.8.3 Constructor Modifiers
jtulach@258
   420
     * @since 1.7
jtulach@258
   421
     */
jtulach@258
   422
    public static int constructorModifiers() {
jtulach@258
   423
        return CONSTRUCTOR_MODIFIERS;
jtulach@258
   424
    }
jtulach@258
   425
jtulach@258
   426
    /**
jtulach@258
   427
     * Return an {@code int} value OR-ing together the source language
jtulach@258
   428
     * modifiers that can be applied to a method.
jtulach@258
   429
     * @return an {@code int} value OR-ing together the source language
jtulach@258
   430
     * modifiers that can be applied to a method.
jtulach@258
   431
     *
jtulach@258
   432
     * @jls 8.4.3 Method Modifiers
jtulach@258
   433
     * @since 1.7
jtulach@258
   434
     */
jtulach@258
   435
    public static int methodModifiers() {
jtulach@258
   436
        return METHOD_MODIFIERS;
jtulach@258
   437
    }
jtulach@258
   438
jtulach@258
   439
jtulach@258
   440
    /**
jtulach@258
   441
     * Return an {@code int} value OR-ing together the source language
jtulach@258
   442
     * modifiers that can be applied to a field.
jtulach@258
   443
     * @return an {@code int} value OR-ing together the source language
jtulach@258
   444
     * modifiers that can be applied to a field.
jtulach@258
   445
     *
jtulach@258
   446
     * @jls 8.3.1 Field Modifiers
jtulach@258
   447
     * @since 1.7
jtulach@258
   448
     */
jtulach@258
   449
    public static int fieldModifiers() {
jtulach@258
   450
        return FIELD_MODIFIERS;
jtulach@258
   451
    }
jtulach@258
   452
}