当前位置: 首页>>代码示例>>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;未经允许,请勿转载。