@Override protected boolean isRelevantClass(MetaClass clazz) { return clazz.isAnnotationPresent(Page.class); } }
@Override protected boolean isRelevantClass(MetaClass clazz) { return clazz.isAnnotationPresent(Page.class); } }
public static boolean isLocalEventType(final MetaClass cls) { return cls.isAnnotationPresent(LocalEvent.class); }
private boolean hasEnablingProperty(final MetaClass type) { return type.isAnnotationPresent(EnabledByProperty.class); }
public static boolean isLocalEventType(final MetaClass cls) { return cls.isAnnotationPresent(LocalEvent.class); }
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)); }
private boolean isActive(final MetaClass type) { if (type.isAnnotationPresent(Alternative.class)) { return isAlternativeEnabled(type); } else { return true; } }
@Override protected boolean isRelevantClass(final MetaClass clazz) { return clazz.isAnnotation() && clazz.isAnnotationPresent(Qualifier.class); }
private boolean isAnnotatedBrowserEvent(final MetaClass eventType) { return eventType.isAnnotationPresent(BrowserEvent.class) && isNativeJsType(eventType); }
private boolean isAnnotatedBrowserEvent(final MetaClass eventType) { return eventType.isAnnotationPresent(BrowserEvent.class) && isNativeJsType(eventType); }
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()]); }
/** * 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); }
/** * 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); }
/** * 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; }
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()); }
/** * 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; }
/** * 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; }
private static boolean isUserPortableType(final MetaClass mc) { return mc.isAnnotationPresent(Portable.class) || getEnvironmentConfig().getExposedClasses().contains(mc) || getEnvironmentConfig().getPortableSuperTypes().contains(mc); }
private static boolean isUserPortableType(final MetaClass mc) { return mc.isAnnotationPresent(Portable.class) || getEnvironmentConfig().getExposedClasses().contains(mc) || getEnvironmentConfig().getPortableSuperTypes().contains(mc); }
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; }