Examples of qualifier


Examples of org.oasisopen.sca.annotation.Qualifier

            } else {
                qname = new QName(intentAnnotation.targetNamespace(), intentAnnotation.localPart());
            }
            Set<String> qualifiers = new HashSet<String>();
            for(Method m: a.annotationType().getMethods()) {
                Qualifier qualifier = m.getAnnotation(Qualifier.class);
                if (qualifier != null && m.getReturnType() == String[].class) {
                    try {
                        qualifiers.addAll(Arrays.asList((String[]) m.invoke(a)));
                    } catch (Throwable e) {
                        e.printStackTrace();
View Full Code Here

Examples of org.oasisopen.sca.annotation.Qualifier

            } else {
                qname = new QName(intentAnnotation.targetNamespace(), intentAnnotation.localPart());
            }
            Set<String> qualifiers = new HashSet<String>();
            for (Method m : a.annotationType().getMethods()) {
                Qualifier qualifier = m.getAnnotation(Qualifier.class);
                if (qualifier != null && m.getReturnType() == String[].class) {
                    try {
                        qualifiers.addAll(Arrays.asList((String[])m.invoke(a)));
                    } catch (Throwable e) {
                        e.printStackTrace();
View Full Code Here

Examples of org.qi4j.api.service.qualifier.Qualifier

        // TODO This could be changed to allow multiple @Qualifier annotations
        Annotation qualifierAnnotation = first( filter( Specifications.translate( Annotations.type(), hasAnnotation( Qualifier.class ) ), iterable( dependencyModel.annotations() ) ) );
        Specification<ServiceReference<?>> serviceQualifier = null;
        if( qualifierAnnotation != null )
        {
            Qualifier qualifier = qualifierAnnotation.annotationType().getAnnotation( Qualifier.class );
            try
            {
                serviceQualifier = qualifier.value().newInstance().qualifier( qualifierAnnotation );
            }
            catch( Exception e )
            {
                throw new InvalidInjectionException( "Could not instantiate qualifier serviceQualifier", e );
            }
View Full Code Here

Examples of org.rhq.core.system.pquery.Conditional.Qualifier

    private Map<Long, ProcessInfo> doArgCriteriaQuery(Criteria criteria) {
        Map<Long, ProcessInfo> matches = new HashMap<Long, ProcessInfo>();

        Attribute attribute = criteria.getConditional().getAttribute();
        Operation op = new Operation(criteria.getConditional().getOperator());
        Qualifier qualifier = criteria.getConditional().getQualifier();

        String operand1 = null;
        String operand2 = criteria.getValue();

        for (ProcessInfo process : getProcesses()) {
            ProcessInfo processToMatch; // will be the same as process unless the parent qualifier was provided

            if (qualifier.equals(Qualifier.parent)) {
                processToMatch = getParentProcess(process);
            } else {
                processToMatch = process;
            }
View Full Code Here

Examples of org.rhq.core.system.pquery.Conditional.Qualifier

    private Map<Long, ProcessInfo> doProcessCriteriaQuery(Criteria criteria) {
        Map<Long, ProcessInfo> matches = new HashMap<Long, ProcessInfo>();

        Attribute attribute = criteria.getConditional().getAttribute();
        Operation op = new Operation(criteria.getConditional().getOperator());
        Qualifier qualifier = criteria.getConditional().getQualifier();

        String operand1;
        String operand2;

        String pidfileContentsCache = null; // so we avoid reading the file over and over again

        for (ProcessInfo process : getProcesses()) {
            ProcessInfo processToMatch; // will be the same as process unless the parent qualifier was provided

            if (qualifier.equals(Qualifier.parent)) {
                processToMatch = getParentProcess(process);
            } else {
                processToMatch = process;
            }
View Full Code Here

Examples of org.springframework.beans.factory.annotation.Qualifier

      @SuppressWarnings("unchecked")
      @Override
      public ValueInjector createParameterExtractor(Class injectTargetClass,
            AccessibleObject injectTarget, Class type, Type genericType, Annotation[] annotations)
      {
         final Qualifier qualifier = FindAnnotation.findAnnotation(annotations, Qualifier.class);
         if (qualifier == null)
         {
            return super.createParameterExtractor(injectTargetClass, injectTarget, type,
                  genericType, annotations);
         }
         else
         {
            return new ValueInjector()
            {
               public Object inject(HttpRequest request, HttpResponse response)
               {
                  return beanFactory.getBean(qualifier.value());
               }

               public Object inject()
               {
                  // do nothing.
View Full Code Here

Examples of org.springframework.beans.factory.annotation.Qualifier

   */
  private static final MethodParameter findMatchingPageableParameter(MethodParameter parameter) {

    MethodParameters parameters = new MethodParameters(parameter.getMethod());
    List<MethodParameter> pageableParameters = parameters.getParametersOfType(Pageable.class);
    Qualifier assemblerQualifier = parameter.getParameterAnnotation(Qualifier.class);

    if (pageableParameters.isEmpty()) {
      return null;
    }

View Full Code Here

Examples of org.springframework.beans.factory.annotation.Qualifier

    if (assemblerQualifier == null) {
      return pageableParameter;
    }

    Qualifier pageableParameterQualifier = pageableParameter.getParameterAnnotation(Qualifier.class);

    if (pageableParameterQualifier == null) {
      return null;
    }

    return pageableParameterQualifier.value().equals(assemblerQualifier.value()) ? pageableParameter : null;
  }
View Full Code Here

Examples of org.springframework.beans.factory.annotation.Qualifier

    for (int i = 0; i < annotations.length; i++) {

      if (Pageable.class.equals(parameterTypes[i])) {

        Qualifier qualifier = findAnnotation(annotations[i]);

        if (null == qualifier) {
          throw new IllegalStateException(
              "Ambiguous Pageable arguments in handler method. If you use multiple parameters of type Pageable you need to qualify them with @Qualifier");
        }

        if (values.contains(qualifier.value())) {
          throw new IllegalStateException("Values of the user Qualifiers must be unique!");
        }

        values.add(qualifier.value());
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.annotation.Qualifier

          }
        }
        if (bd instanceof RootBeanDefinition) {
          Method factoryMethod = ((RootBeanDefinition) bd).getResolvedFactoryMethod();
          if (factoryMethod != null) {
            Qualifier targetAnnotation = factoryMethod.getAnnotation(Qualifier.class);
            if (targetAnnotation != null && qualifier.equals(targetAnnotation.value())) {
              return true;
            }
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.