com.google.gwt.core.ext.typeinfo.JPackage.getAnnotation()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中com.google.gwt.core.ext.typeinfo.JPackage.getAnnotation()方法的一些代码示例,展示了JPackage.getAnnotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPackage.getAnnotation()方法的具体详情如下:
包路径:com.google.gwt.core.ext.typeinfo.JPackage
类名称:JPackage
方法名:getAnnotation

JPackage.getAnnotation介绍

暂无

代码示例

代码示例来源:origin: net.wetheinter/gwt-user

protected boolean isDebug(final JClassType type, final int memberType) {
 ReflectionStrategy strategy = type.getAnnotation(ReflectionStrategy.class);
 if (strategy == null) {
  strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
 }
 if (strategy == null) {
  return false;
 }
 return (strategy.debug() & memberType) > 0;
}

代码示例来源:origin: net.wetheinter/gwt-reflect

protected boolean isDebug(JClassType type, int memberType) {
 ReflectionStrategy strategy = type.getAnnotation(ReflectionStrategy.class);
 if (strategy == null) {
  strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
 }
 if (strategy == null) {
  return false;
 }
 return (strategy.debug() & memberType) > 0;
}

代码示例来源:origin: net.wetheinter/gwt-user

private static ReflectionStrategy getStrategy(final TreeLogger logger, JClassType type) {
 ReflectionStrategy strategy = type.getAnnotation(ReflectionStrategy.class);
 if (strategy == null) {
  strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
  while (strategy == null && type.getSuperclass() != null) {
   type = type.getSuperclass();
   strategy = type.getAnnotation(ReflectionStrategy.class);
  }
  if (strategy == null) {
   strategy = MagicClassInjector.getDefaultStrategy();
  }
 }
 return strategy;
}

代码示例来源:origin: net.wetheinter/gwt-reflect

private static ReflectionStrategy getStrategy(TreeLogger logger, JClassType type) {
 ReflectionStrategy strategy = type.getAnnotation(ReflectionStrategy.class);
 if (strategy == null) {
  strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
  while (strategy == null && type.getSuperclass() != null) {
   type = type.getSuperclass();
   strategy = type.getAnnotation(ReflectionStrategy.class);
  }
  if (strategy == null) {
   strategy = MagicClassInjector.getDefaultStrategy();
  }
 }
 return strategy;
}

代码示例来源:origin: net.wetheinter/gwt-reflect

@Override
public void onUnifyAstStart(TreeLogger logger, UnifyAstView ast, UnifyVisitor visitor, Queue<JMethod> todo) {
 for (final JMethod method : ast.getProgram().getEntryMethods()) {
  if (method.getBody() instanceof JMethodBody) {
   JMethodBody body = (JMethodBody) method.getBody();
   // obtain the entry point
   EntryPointFinder finder = findEntryPoint(logger);
   body.traverse(finder, finder.getContext());
   // find a default strategy
   if (finder.result == null) {
    strategy = MagicClassGenerator.class.getAnnotation(ReflectionStrategy.class);
   } else {
    com.google.gwt.core.ext.typeinfo.JClassType type = ast.getTypeOracle().findType(finder.result.getName());
    strategy = type.getAnnotation(ReflectionStrategy.class);
    if (strategy == null) {
     strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
     if (strategy == null) {
      // Nothing on the entry point or it's package;
      // use a default instance of the ReflectionStrategy annotation
      strategy = MagicClassGenerator.class.getAnnotation(ReflectionStrategy.class);
     }
    }
   }
   assert strategy != null;
  }
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public void onUnifyAstStart(final TreeLogger logger, final UnifyAstView ast, final UnifyVisitor visitor, final Queue<JMethod> todo) {
 for (final JMethod method : ast.getProgram().getEntryMethods()) {
  if (method.getBody() instanceof JMethodBody) {
   final JMethodBody body = (JMethodBody) method.getBody();
   // obtain the entry point
   final EntryPointFinder finder = findEntryPoint(logger);
   body.traverse(finder, finder.getContext());
   // find a default strategy
   if (finder.result == null) {
    strategy = MagicClassGenerator.class.getAnnotation(ReflectionStrategy.class);
   } else {
    final com.google.gwt.core.ext.typeinfo.JClassType type = ast.getTypeOracle().findType(finder.result.getName());
    strategy = type.getAnnotation(ReflectionStrategy.class);
    if (strategy == null) {
     strategy = type.getPackage().getAnnotation(ReflectionStrategy.class);
     if (strategy == null) {
      // Nothing on the entry point or it's package;
      // use a default instance of the ReflectionStrategy annotation
      strategy = MagicClassGenerator.class.getAnnotation(ReflectionStrategy.class);
     }
    }
   }
   assert strategy != null;
  }
 }
}

代码示例来源:origin: net.wetheinter/gwt-reflect

packages.put(pkg.getName(), pkg);
strategy = pkg.getAnnotation(ReflectionStrategy.class);
if (strategy == null) {
 if (type.findAnnotationInTypeHierarchy(GwtRetention.class) != null) {

代码示例来源:origin: net.wetheinter/gwt-user

packages.put(pkg.getName(), pkg);
strategy = pkg.getAnnotation(ReflectionStrategy.class);
if (strategy == null) {
 if (type.findAnnotationInTypeHierarchy(GwtRetention.class) != null) {

相关文章