org.jboss.errai.codegen.meta.MetaClass.isAnnotationPresent()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(128)

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

MetaClass.isAnnotationPresent介绍

暂无

代码示例

代码示例来源:origin: org.jboss.errai/errai-navigation

@Override
 protected boolean isRelevantClass(MetaClass clazz) {
  return clazz.isAnnotationPresent(Page.class);
 }
}

代码示例来源:origin: errai/errai

@Override
 protected boolean isRelevantClass(MetaClass clazz) {
  return clazz.isAnnotationPresent(Page.class);
 }
}

代码示例来源:origin: errai/errai

public static boolean isLocalEventType(final MetaClass cls) {
 return cls.isAnnotationPresent(LocalEvent.class);
}

代码示例来源:origin: errai/errai

private boolean hasEnablingProperty(final MetaClass type) {
 return type.isAnnotationPresent(EnabledByProperty.class);
}

代码示例来源:origin: org.jboss.errai/errai-config

public static boolean isLocalEventType(final MetaClass cls) {
 return cls.isAnnotationPresent(LocalEvent.class);
}

代码示例来源:origin: errai/errai

protected static Object isEager(final MetaClass injectedType) {
 return injectedType.isAnnotationPresent(EntryPoint.class) ||
     // TODO review this before adding any scopes other than app-scoped and depdendent
     (!injectedType.isAnnotationPresent(Dependent.class) && hasStartupAnnotation(injectedType));
}

代码示例来源:origin: errai/errai

private boolean isActive(final MetaClass type) {
 if (type.isAnnotationPresent(Alternative.class)) {
  return isAlternativeEnabled(type);
 } else {
  return true;
 }
}

代码示例来源:origin: org.jboss.errai/errai-cdi-client

@Override
protected boolean isRelevantClass(final MetaClass clazz) {
 return clazz.isAnnotation() && clazz.isAnnotationPresent(Qualifier.class);
}

代码示例来源:origin: org.jboss.errai/errai-ui

private boolean isAnnotatedBrowserEvent(final MetaClass eventType) {
 return eventType.isAnnotationPresent(BrowserEvent.class) && isNativeJsType(eventType);
}

代码示例来源:origin: errai/errai

private boolean isAnnotatedBrowserEvent(final MetaClass eventType) {
 return eventType.isAnnotationPresent(BrowserEvent.class) && isNativeJsType(eventType);
}

代码示例来源:origin: errai/errai

private WiringElementType[] getWiringTypeForProducer(final MetaClass enclosingClass, final HasAnnotations annotated,
    final Class<? extends Annotation> directScope) {
 final List<WiringElementType> wiringTypes = new ArrayList<>();
 wiringTypes.addAll(getWiringTypesForScopeAnnotation(directScope));
 if (annotated.isAnnotationPresent(Specializes.class)) {
  wiringTypes.add(WiringElementType.Specialization);
 }
 if (enclosingClass.isAnnotationPresent(LoadAsync.class)) {
  wiringTypes.add(WiringElementType.LoadAsync);
 }
 return wiringTypes.toArray(new WiringElementType[wiringTypes.size()]);
}

代码示例来源:origin: org.jboss.errai/errai-data-binding

/**
 * Checks if the provided type is bindable.
 *
 * @param type
 *          the type to check
 *
 * @return true if the provide type is bindable, otherwise false.
 */
public static boolean isBindableType(final MetaClass type) {
 return (type.isAnnotationPresent(Bindable.class) || getConfiguredBindableTypes().contains(type))
   && !getConfiguredNonBindableTypes().contains(type);
}

代码示例来源:origin: errai/errai

/**
 * Checks if the provided type is bindable.
 *
 * @param type
 *          the type to check
 *
 * @return true if the provide type is bindable, otherwise false.
 */
public static boolean isBindableType(final MetaClass type) {
 return (type.isAnnotationPresent(Bindable.class) || getConfiguredBindableTypes().contains(type))
   && !getConfiguredNonBindableTypes().contains(type);
}

代码示例来源:origin: org.jboss.errai/errai-ui

/**
 * Get the name of the {@link Template} HTML fragment (Element subtree) to be used as the template root of the given
 * {@link MetaClass} component type
 */
public static String getTemplateFragmentName(final MetaClass type) {
 String fragment = "";
 if (type.isAnnotationPresent(Templated.class)) {
  final String source = canonicalizeTemplateSourceSyntax(type, type.getAnnotation(Templated.class).value());
  final Matcher matcher = Pattern.compile("^.*#([^#]+)$").matcher(source);
  if (matcher.matches()) {
   fragment = (matcher.group(1) == null ? fragment : matcher.group(1));
  }
 }
 return fragment;
}

代码示例来源:origin: errai/errai

private Stream<MetaClass> findJsTypeIfaces(final MetaClass type) {
 return stream(type.getInterfaces())
  .flatMap(iface -> stream(iface.getInterfaces()))
  .distinct()
  .filter(iface -> !iface.getFullyQualifiedName().startsWith("java.util"))
  .filter(iface -> iface.isAnnotationPresent(JsType.class) && !iface.getAnnotation(JsType.class).isNative());
}

代码示例来源:origin: org.jboss.errai/errai-ui

/**
 * Get the URL of the server-side {@link Template} HTML file of the given {@link MetaClass} component type
 */
public static String getTemplateUrl(final MetaClass type) {
 String resource = type.getFullyQualifiedName().replace('.', '/') + ".html";
 if (type.isAnnotationPresent(Templated.class)) {
  final String source = canonicalizeTemplateSourceSyntax(type, type.getAnnotation(Templated.class).value());
  final Matcher matcher = Pattern.compile("^([^#]+)#?.*$").matcher(source);
  if (matcher.matches()) {
   resource = (matcher.group(1) == null ? resource : matcher.group(1));
  }
 }
 return resource;
}

代码示例来源:origin: errai/errai

/**
 * Get the URL of the server-side {@link Template} HTML file of the given {@link MetaClass} component type
 */
public static String getTemplateUrl(final MetaClass type) {
 String resource = type.getFullyQualifiedName().replace('.', '/') + ".html";
 if (type.isAnnotationPresent(Templated.class)) {
  final String source = canonicalizeTemplateSourceSyntax(type, type.getAnnotation(Templated.class).value());
  final Matcher matcher = Pattern.compile("^([^#]+)#?.*$").matcher(source);
  if (matcher.matches()) {
   resource = (matcher.group(1) == null ? resource : matcher.group(1));
  }
 }
 return resource;
}

代码示例来源:origin: org.jboss.errai/errai-config

private static boolean isUserPortableType(final MetaClass mc) {
 return mc.isAnnotationPresent(Portable.class) || getEnvironmentConfig().getExposedClasses().contains(mc)
   || getEnvironmentConfig().getPortableSuperTypes().contains(mc);
}

代码示例来源:origin: errai/errai

private static boolean isUserPortableType(final MetaClass mc) {
 return mc.isAnnotationPresent(Portable.class) || getEnvironmentConfig().getExposedClasses().contains(mc)
   || getEnvironmentConfig().getPortableSuperTypes().contains(mc);
}

代码示例来源:origin: errai/errai

protected Statement generateFactoryHandleStatement(final Injectable injectable) {
 final Statement newObject;
 if (injectable.getInjectedType().isAnnotationPresent(ActivatedBy.class)) {
  final Class<? extends BeanActivator> activatorType = injectable.getInjectedType().getAnnotation(ActivatedBy.class).value();
  newObject = newObject(FactoryHandleImpl.class, loadLiteral(injectable.getInjectedType()),
      injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()),
      injectable.getBeanName(), !injectable.isContextual(), loadLiteral(activatorType));
 } else {
  newObject = newObject(FactoryHandleImpl.class, loadLiteral(injectable.getInjectedType()),
      injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()),
      injectable.getBeanName(), !injectable.isContextual());
 }
 return newObject;
}

相关文章