Package org.jboss.jandex

Examples of org.jboss.jandex.DotName


            final Set<Class<?>> discoveredClasses = new HashSet<Class<?>>();
            instances.put(annotation.annotationClass, discoveredClasses);
            for (AnnotationInstance annotationInstance : annotationInstances) {
                final AnnotationTarget target = annotationInstance.target();
                if (target instanceof ClassInfo) {
                    final DotName className = ClassInfo.class.cast(target).name();
                    final Class<?> annotatedClass;
                    try {
                        annotatedClass = classLoader.loadClass(className.toString());
                    } catch (ClassNotFoundException e) {
                        throw new DeploymentUnitProcessingException("Failed to load annotated class " + className);
                    }
                    discoveredClasses.add(annotatedClass);
                } else {
View Full Code Here


     * @param jaxws if passed value is <b>true</b> JAXWS servlets list will be returned, otherwise JAXRPC servlets list
     * @return either JAXRPC or JAXWS servlets list
     */
    public static <T extends ServletMetaData> List<ServletMetaData> selectWebServiceServlets(final Index annotationIndex, final Collection<T> smd, final boolean jaxws) {
        final List<ServletMetaData> endpoints = new ArrayList<ServletMetaData>();
        final DotName webserviceAnnotation = DotName.createSimple(WebService.class.getName());
        final DotName webserviceProviderAnnotation = DotName.createSimple(WebServiceProvider.class.getName());

        if(smd != null) for (ServletMetaData servletMD : smd) {
                final String endpointClassName = ASHelper.getEndpointName(servletMD);
                if (endpointClassName != null && endpointClassName.length() > 0) { // exclude JSP
                    // check webservice annotations
View Full Code Here

        final Map<DotName, List<TargetAnnotation>> classLevel = new HashMap<DotName, List<TargetAnnotation>>();
        final Map<DotName, List<TargetAnnotation>> methodLevel = new HashMap<DotName, List<TargetAnnotation>>();
        final Map<DotName, List<TargetAnnotation>> fieldLevel = new HashMap<DotName, List<TargetAnnotation>>();
        for (TargetAnnotation instance : annotations) {
            final DotName targetClass = getAnnotationClass(instance.target()).name();
            if (instance.target() instanceof ClassInfo) {
                List<TargetAnnotation> data = classLevel.get(targetClass);
                if (data == null) classLevel.put(targetClass, data = new ArrayList<TargetAnnotation>(1));
                data.add(instance);
            } else if (instance.target() instanceof MethodInfo) {
View Full Code Here

            final Set<Class<?>> discoveredClasses = new HashSet<Class<?>>();
            instances.put(annotation.annotationClass, discoveredClasses);
            for (AnnotationInstance annotationInstance : annotationInstances) {
                final AnnotationTarget target = annotationInstance.target();
                if (target instanceof ClassInfo) {
                    final DotName className = ClassInfo.class.cast(target).name();
                    final Class<?> annotatedClass;
                    try {
                        annotatedClass = classLoader.loadClass(className.toString());
                    } catch (ClassNotFoundException e) {
                        throw new DeploymentUnitProcessingException(JSFLogger.ROOT_LOGGER.classLoadingFailed(className));
                    }
                    discoveredClasses.add(annotatedClass);
                } else {
View Full Code Here

    }

    public static boolean isJaxwsService(final ClassInfo current, final CompositeIndex index) {
        ClassInfo tmp = current;
        while (tmp != null) {
            final DotName superName = tmp.superName();
            if (JAXWS_SERVICE_CLASS.equals(superName)) {
                return true;
            }
            tmp = index.getClassByName(superName);
        }
View Full Code Here

    }

    public static boolean isJaxwsService(final ClassInfo current, final Index index) {
        ClassInfo tmp = current;
        while (tmp != null) {
            final DotName superName = tmp.superName();
            if (JAXWS_SERVICE_CLASS.equals(superName)) {
                return true;
            }
            tmp = index.getClassByName(superName);
        }
View Full Code Here

        private final Multimap<ResourceRoot, EJBComponentDescription> ejbComponentDescriptions = HashMultimap.create();

        public Components(DeploymentUnit deploymentUnit, Map<ResourceRoot, Index> indexes) {
            for (ComponentDescription component : deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION).getComponentDescriptions()) {
                ResourceRoot resourceRoot = null;
                DotName componentClassName = DotName.createSimple(component.getComponentClassName());
                for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
                    final Index index = entry.getValue();
                    if (index != null) {
                        if (index.getClassByName(componentClassName) != null) {
                            resourceRoot = entry.getKey();
View Full Code Here

        final Map<DotName, List<TargetAnnotation>> classLevel = new HashMap<DotName, List<TargetAnnotation>>();
        final Map<DotName, List<TargetAnnotation>> methodLevel = new HashMap<DotName, List<TargetAnnotation>>();
        final Map<DotName, List<TargetAnnotation>> fieldLevel = new HashMap<DotName, List<TargetAnnotation>>();
        for (TargetAnnotation instance : annotations) {
            final DotName targetClass = getAnnotationClass(instance.target()).name();
            if (instance.target() instanceof ClassInfo) {
                List<TargetAnnotation> data = classLevel.get(targetClass);
                if (data == null) classLevel.put(targetClass, data = new ArrayList<TargetAnnotation>(1));
                data.add(instance);
            } else if (instance.target() instanceof MethodInfo) {
View Full Code Here

        if (value != null)
            return value.asClass().name().toString();
        final ClassInfo beanClass = (ClassInfo) messageBeanAnnotation.target();
        final Set<DotName> interfaces = new HashSet<DotName>(getPotentialViewInterfaces(beanClass));
        // check super class(es) of the bean
        DotName superClassDotName = beanClass.superName();
        while (interfaces.isEmpty() && superClassDotName != null && !superClassDotName.toString().equals(Object.class.getName())) {
            final ClassInfo superClass = compositeIndex.getClassByName(superClassDotName);
            if (superClass == null) {
                break;
            }
            interfaces.addAll(getPotentialViewInterfaces(superClass));
View Full Code Here

    @Override
    public boolean containsAnnotation(Class<?> javaClass, Class<? extends Annotation> requiredAnnotation) {
        if (index == null) {
            throw WeldLogger.ROOT_LOGGER.cannotUseAtRuntime(AnnotationDiscovery.class.getSimpleName());
        }
        DotName className = DotName.createSimple(javaClass.getName());
        DotName requiredAnnotationName = DotName.createSimple(requiredAnnotation.getName());
        return containsAnnotation(className, requiredAnnotationName, javaClass, requiredAnnotation);
    }
View Full Code Here

TOP

Related Classes of org.jboss.jandex.DotName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.