當前位置: 首頁>>代碼示例>>Java>>正文


Java Modifier.NATIVE屬性代碼示例

本文整理匯總了Java中java.lang.reflect.Modifier.NATIVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Modifier.NATIVE屬性的具體用法?Java Modifier.NATIVE怎麽用?Java Modifier.NATIVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.lang.reflect.Modifier的用法示例。


在下文中一共展示了Modifier.NATIVE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getModifiers

private static int getModifiers(ClassInfo ci, int mIndex) {
    int modifiers = 0;
    if (ci.isMethodAbstract(mIndex)) {
        modifiers += Modifier.ABSTRACT;
    }
    if (ci.isMethodPrivate(mIndex)) {
        modifiers += Modifier.PRIVATE;
    }
    if (ci.isMethodProtected(mIndex)) {
        modifiers += Modifier.PROTECTED;
    }
    if (ci.isMethodPublic(mIndex)) {
        modifiers += Modifier.PUBLIC;
    }
    if (ci.isMethodFinal(mIndex)) {
        modifiers += Modifier.FINAL;
    }
    if (ci.isMethodStatic(mIndex)) {
        modifiers += Modifier.STATIC;
    }
    if (ci.isMethodNative(mIndex)) {
        modifiers += Modifier.NATIVE;
    }
    return modifiers;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:ExternalPackages.java

示例2: main

public static void main(String [] argv) {
    int allMods = Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE |
        Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL |
        Modifier.TRANSIENT | Modifier.VOLATILE | Modifier.SYNCHRONIZED |
        Modifier.NATIVE | Modifier.STRICT | Modifier.INTERFACE;

    String allModsString = "public protected private abstract static " +
        "final transient volatile synchronized native strictfp interface";

    /* zero should have an empty string */
    testString(0, "");

    /* test to make sure all modifiers print out in the proper order */
    testString(allMods, allModsString);

    /* verify no extraneous modifiers are printed */
    testString(~0, allModsString);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:toStringTest.java

示例3: translateModifiers

/**
 * Convert modifier bits from private coding used by
 * the compiler to that of java.lang.reflect.Modifier.
 */
static int translateModifiers(long flags) {
    int result = 0;
    if ((flags & Flags.ABSTRACT) != 0)
        result |= Modifier.ABSTRACT;
    if ((flags & Flags.FINAL) != 0)
        result |= Modifier.FINAL;
    if ((flags & Flags.INTERFACE) != 0)
        result |= Modifier.INTERFACE;
    if ((flags & Flags.NATIVE) != 0)
        result |= Modifier.NATIVE;
    if ((flags & Flags.PRIVATE) != 0)
        result |= Modifier.PRIVATE;
    if ((flags & Flags.PROTECTED) != 0)
        result |= Modifier.PROTECTED;
    if ((flags & Flags.PUBLIC) != 0)
        result |= Modifier.PUBLIC;
    if ((flags & Flags.STATIC) != 0)
        result |= Modifier.STATIC;
    if ((flags & Flags.SYNCHRONIZED) != 0)
        result |= Modifier.SYNCHRONIZED;
    if ((flags & Flags.TRANSIENT) != 0)
        result |= Modifier.TRANSIENT;
    if ((flags & Flags.VOLATILE) != 0)
        result |= Modifier.VOLATILE;
    return result;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:30,代碼來源:DocEnv.java

示例4: flagsRequireCode

static boolean flagsRequireCode(int flags) {
    // A method's flags force it to have a Code attribute,
    // if the flags are neither native nor abstract.
    return (flags & (Modifier.NATIVE | Modifier.ABSTRACT)) == 0;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:5,代碼來源:Code.java

示例5: modifiersFrom

public static long modifiersFrom( Set<javax.lang.model.element.Modifier> modifiers )
{
  long mods = 0;
  for( javax.lang.model.element.Modifier mod : modifiers )
  {
    switch( mod )
    {
      case PUBLIC:
        mods |= Modifier.PUBLIC;
        break;
      case PROTECTED:
        mods |= Modifier.PROTECTED;
        break;
      case PRIVATE:
        mods |= Modifier.PRIVATE;
        break;
      case ABSTRACT:
        mods |= Modifier.ABSTRACT;
        break;
      case DEFAULT:
        mods |= Flags.DEFAULT;
        break;
      case STATIC:
        mods |= Modifier.STATIC;
        break;
      case FINAL:
        mods |= Modifier.FINAL;
        break;
      case TRANSIENT:
        mods |= Modifier.TRANSIENT;
        break;
      case VOLATILE:
        mods |= Modifier.VOLATILE;
        break;
      case SYNCHRONIZED:
        mods |= Modifier.SYNCHRONIZED;
        break;
      case NATIVE:
        mods |= Modifier.NATIVE;
        break;
      case STRICTFP:
        mods |= Flags.STRICTFP;
        break;
    }
  }
  return mods;
}
 
開發者ID:manifold-systems,項目名稱:manifold,代碼行數:47,代碼來源:SrcAnnotated.java

示例6: modifierString

/**
 * Return a string describing the access modifier flags.
 * Don't include native or synchronized.
 *
 * The modifier names are returned in canonical order, as
 * specified by <em>The Java Language Specification</em>.
 */
protected String modifierString(MemberDoc member) {
    int ms = member.modifierSpecifier();
    int no = Modifier.NATIVE | Modifier.SYNCHRONIZED;
return Modifier.toString(ms & ~no);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:12,代碼來源:AbstractMemberWriter.java


注:本文中的java.lang.reflect.Modifier.NATIVE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。