Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationTarget


      return;
    }
    List<AnnotationInstance> annotationInstanceList = annotatedMap.get( annName );
    if ( MockHelper.isNotEmpty( annotationInstanceList ) ) {
      for ( AnnotationInstance annotationInstance : annotationInstanceList ) {
        AnnotationTarget annotationTarget = annotationInstance.target();
        if ( MockHelper.targetEquals( target, annotationTarget ) ) {
          if ( operation.process( annotationInstance ) ) {
            return;
          }
        }
View Full Code Here


    }

    // iterate over all @Access annotations defined on the current class
    for ( AnnotationInstance accessAnnotation : accessAnnotations ) {
      // we are only interested at annotations defined on fields and methods
      AnnotationTarget annotationTarget = accessAnnotation.target();
      if ( !( annotationTarget.getClass().equals( MethodInfo.class ) || annotationTarget.getClass()
          .equals( FieldInfo.class ) ) ) {
        continue;
      }

      AccessType accessType = JandexHelper.getEnumValue( accessAnnotation, "value", AccessType.class );
View Full Code Here

    if ( transientMembers == null ) {
      return;
    }

    for ( AnnotationInstance transientMember : transientMembers ) {
      AnnotationTarget target = transientMember.target();
      if ( target instanceof FieldInfo ) {
        transientFieldNames.add( ( (FieldInfo) target ).name() );
      }
      else {
        transientMethodNames.add( ( (MethodInfo) target ).name() );
View Full Code Here

  }

  private static JaxbAccessType processIdAnnotations(List<AnnotationInstance> idAnnotations) {
    JaxbAccessType accessType = null;
    for ( AnnotationInstance annotation : idAnnotations ) {
      AnnotationTarget tmpTarget = annotation.target();
      if ( tmpTarget == null ) {
        throw new AssertionFailure( "@Id has no AnnotationTarget, this is mostly a internal error." );
      }
      if ( accessType == null ) {
        accessType = annotationTargetToAccessType( tmpTarget );
View Full Code Here

    Map<DotName, List<AnnotationInstance>> indexedAnnotations = indexBuilder.getIndexedAnnotations( className );
    if ( indexedAnnotations != null && indexedAnnotations.containsKey( ACCESS ) ) {
      List<AnnotationInstance> annotationInstances = indexedAnnotations.get( ACCESS );
      if ( MockHelper.isNotEmpty( annotationInstances ) ) {
        for ( AnnotationInstance annotationInstance : annotationInstances ) {
          AnnotationTarget indexedPropertyTarget = annotationInstance.target();
          if ( indexedPropertyTarget == null ) {
            continue;
          }
          if ( JandexHelper.getPropertyName( indexedPropertyTarget ).equals( attributeName ) ) {
            JaxbAccessType accessType = JandexHelper.getEnumValue(
View Full Code Here

* @author Strong Liu
*/
class NameTargetAnnotationFilter extends AbstractAnnotationFilter {
  @Override
  protected void process(DotName annName, AnnotationInstance annotationInstance, List<AnnotationInstance> indexedAnnotationInstanceList) {
    AnnotationTarget target = annotationInstance.target();

    for ( Iterator<AnnotationInstance> iter = indexedAnnotationInstanceList.iterator(); iter.hasNext(); ) {
      AnnotationInstance ann = iter.next();
      if ( MockHelper.targetEquals( target, ann.target() ) ) {
        iter.remove();
View Full Code Here

  protected void overrideIndexedAnnotationMap(DotName annName, AnnotationInstance annotationInstance, Map<DotName, List<AnnotationInstance>> map) {
    ExclusiveGroup group = getExclusiveGroup( annName );
    if ( group == null ) {
      return;
    }
    AnnotationTarget target = annotationInstance.target();
    for ( DotName entityAnnName : group ) {
      if ( !map.containsKey( entityAnnName ) ) {
        continue;
      }
      switch ( group.scope ) {
View Full Code Here

        final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
        final EEApplicationClasses applicationClasses = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION);
        final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE);
        final List<AnnotationInstance> resourceAnnotations = index.getAnnotations(RESOURCE_ANNOTATION_NAME);
        for (AnnotationInstance annotation : resourceAnnotations) {
            final AnnotationTarget annotationTarget = annotation.target();
            final AnnotationValue nameValue = annotation.value("name");
            final String name = nameValue != null ? nameValue.asString() : null;
            final AnnotationValue typeValue = annotation.value("type");
            final String type = typeValue != null ? typeValue.asClass().name().toString() : null;
            if (annotationTarget instanceof FieldInfo) {
                FieldInfo fieldInfo = (FieldInfo) annotationTarget;
                ClassInfo classInfo = fieldInfo.declaringClass();
                EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
                processFieldResource(phaseContext, fieldInfo, name, type, classDescription, annotation, eeModuleDescription, module);
            } else if (annotationTarget instanceof MethodInfo) {
                MethodInfo methodInfo = (MethodInfo) annotationTarget;
                ClassInfo classInfo = methodInfo.declaringClass();
                EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
                processMethodResource(phaseContext, methodInfo, name, type, classDescription, annotation, eeModuleDescription, module);
            } else if (annotationTarget instanceof ClassInfo) {
                ClassInfo classInfo = (ClassInfo) annotationTarget;
                EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
                processClassResource(phaseContext, name, type, classDescription, annotation, eeModuleDescription, module);
            }
        }
        final List<AnnotationInstance> resourcesAnnotations = index.getAnnotations(RESOURCES_ANNOTATION_NAME);
        for (AnnotationInstance outerAnnotation : resourcesAnnotations) {
            final AnnotationTarget annotationTarget = outerAnnotation.target();
            if (annotationTarget instanceof ClassInfo) {
                final ClassInfo classInfo = (ClassInfo) annotationTarget;
                final AnnotationInstance[] values = outerAnnotation.value("value").asNestedArray();
                for (AnnotationInstance annotation : values) {
                    final AnnotationValue nameValue = annotation.value("name");
View Full Code Here

            processExcludeClass(eeModuleDescription, annotation, index);
        }
    }

    private void processInterceptors(final EEModuleDescription eeModuleDescription, final AnnotationInstance annotation, final CompositeIndex index) throws DeploymentUnitProcessingException {
        final AnnotationTarget target = annotation.target();
        if (target instanceof MethodInfo) {
            processMethodInterceptor(eeModuleDescription, MethodInfo.class.cast(target), annotation, index);
        } else if (target instanceof ClassInfo) {
            processClassInterceptor(eeModuleDescription, ClassInfo.class.cast(target), annotation, index);
        } else {
View Full Code Here

            }
        }
    }

    private void processExcludeDefault(final EEModuleDescription eeModuleDescription, final AnnotationInstance annotation, final CompositeIndex index) throws DeploymentUnitProcessingException {
        final AnnotationTarget target = annotation.target();
        if (target instanceof MethodInfo) {
            processMethodExcludeDefault(eeModuleDescription, MethodInfo.class.cast(target), index);
        } else if (target instanceof ClassInfo) {
            processClassExcludeDefault(eeModuleDescription, ClassInfo.class.cast(target), index);
        } else {
View Full Code Here

TOP

Related Classes of org.jboss.jandex.AnnotationTarget

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.