Package org.jboss.jandex

Examples of org.jboss.jandex.DotName


  ClassInfo createClassInfo(String className) {
    if ( StringHelper.isEmpty( className ) ) {
      throw new AssertionFailure( "Class Name used to create ClassInfo is empty." );
    }
    DotName classDotName = DotName.createSimple( className );
    if ( classes.containsKey( classDotName ) ) {
      //classInfoAnnotationsMap.put( classDotName, new HashMap<DotName, List<AnnotationInstance>>(classes.get( classDotName ).annotations()) );
      return classes.get( classDotName );
    }
    Class clazz = serviceRegistry.getService( ClassLoaderService.class ).classForName( className );
    DotName superName = null;
    DotName[] interfaces = null;
    short access_flag;
    ClassInfo annClassInfo = index.getClassByName( classDotName );
    if ( annClassInfo != null ) {
      superName = annClassInfo.superName();
View Full Code Here


    if ( source != null ) {
      for ( Map.Entry<DotName, List<AnnotationInstance>> el : source.entrySet() ) {
        if ( el.getValue().isEmpty() ) {
          continue;
        }
        DotName annotationName = el.getKey();
        List<AnnotationInstance> value = el.getValue();
        List<AnnotationInstance> annotationInstanceList = target.get( annotationName );
        if ( annotationInstanceList == null ) {
          annotationInstanceList = new ArrayList<AnnotationInstance>();
          target.put( annotationName, annotationInstanceList );
View Full Code Here

      pushIfNotExist( annotationInstance );
    }
  }

  private void pushIfNotExist(AnnotationInstance annotationInstance) {
    DotName annName = annotationInstance.name();
    boolean isNotExist = false;
    if ( annName.equals( SQL_RESULT_SET_MAPPINGS ) ) {
      AnnotationInstance[] annotationInstances = annotationInstance.value().asNestedArray();
      for ( AnnotationInstance ai : annotationInstances ) {
        pushIfNotExist( ai );
      }
    }
    else {
      AnnotationValue value = annotationInstance.value( "name" );
      String name = value.asString();
      isNotExist = ( annName.equals( TABLE_GENERATOR ) && !tableGeneratorMap.containsKey( name ) ) ||
          ( annName.equals( SEQUENCE_GENERATOR ) && !sequenceGeneratorMap.containsKey( name ) ) ||
          ( annName.equals( NAMED_QUERY ) && !namedQueryMap.containsKey( name ) ) ||
          ( annName.equals( NAMED_NATIVE_QUERY ) && !namedNativeQueryMap.containsKey( name ) ) ||
          ( annName.equals( SQL_RESULT_SET_MAPPING ) && !sqlResultSetMappingMap.containsKey( name ) );
    }
    if ( isNotExist ) {
      push( annName, annotationInstance );
    }
  }
View Full Code Here

    return candidates.contains( annName );
  }

  @Override
  public void beforePush(IndexBuilder indexBuilder, DotName classDotName, AnnotationInstance annotationInstance) {
    DotName annName = annotationInstance.name();
    if ( !match( annName ) ) {
      return;
    }
    Map<DotName, List<AnnotationInstance>> map = indexBuilder.getIndexedAnnotations( classDotName );
    overrideIndexedAnnotationMap( annName, annotationInstance, map );
View Full Code Here

  private void processDefaultJpaCallbacks(String instanceCallbackClassName, List<JpaCallbackClass> jpaCallbackClassList) {
    ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

    // Process superclass first if available and not excluded
    if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
      DotName superName = callbackClassInfo.superName();
      if ( superName != null ) {
        processDefaultJpaCallbacks( instanceCallbackClassName, jpaCallbackClassList );
      }
    }
View Full Code Here

    ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

    // Process superclass first if available and not excluded
    if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
      DotName superName = callbackClassInfo.superName();
      if ( superName != null ) {
        processJpaCallbacks(
            instanceCallbackClassName,
            isListener,
            callbackClassList
View Full Code Here

    private static boolean containsEjbComponentClass(final VirtualFile file) {
        Indexer indexer = new Indexer();
        indexClasses(file, file, indexer);
        Index index = indexer.complete();
        for (Class<? extends Annotation> annotation : EJB_COMPONENT_ANNOTATIONS) {
            final DotName annotationName = DotName.createSimple(annotation.getName());
            final List<AnnotationInstance> classes = index.getAnnotations(annotationName);
            if (classes != null && !classes.isEmpty()) {
                return true;
            }
        }
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

    }

    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

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.