Package org.jboss.reflect.spi

Examples of org.jboss.reflect.spi.ParameterInfo


/* 187 */       typeInfos[i] = parameters[i].getParameterType();
/*     */     }
/* 189 */     List pmds = new ArrayList();
/* 190 */     for (int i = 0; i < parameters.length; i++)
/*     */     {
/* 192 */       ParameterInfo pi = parameters[i];
/* 193 */       Signature pis = new MethodParametersSignature(pi.getName(), Configurator.getParameterTypes(this.log.isTraceEnabled(), typeInfos), i);
/*     */
/* 198 */       MetaData mdr = retrieval.getComponentMetaData(pis);
/* 199 */       if (mdr != null)
/*     */       {
/* 201 */         ValueMetaData value = null;
/* 202 */         for (Annotation2ValueMetaDataAdapter adapter : this.adapters)
/*     */         {
/* 205 */           Annotation adapterAnnotation = mdr.getAnnotation(adapter.getAnnotation());
/* 206 */           if (adapterAnnotation != null)
/*     */           {
/* 208 */             value = adapter.createValueMetaData(adapterAnnotation);
/* 209 */             break;
/*     */           }
/*     */         }
/* 212 */         if (value == null)
/* 213 */           throw new IllegalArgumentException("No such Annotation2ValueMetaData adapter or no annotation on ParameterInfo: " + pi);
/* 214 */         if (trace)
/* 215 */           this.log.trace("Adding new ParameterMetaData for annotation: " + value);
/* 216 */         pmds.add(new AbstractParameterMetaData(pi.getParameterType().getName(), value));
/*     */       }
/*     */       else
/*     */       {
/* 220 */         throw new IllegalArgumentException("MetaData for parameter must exist: " + pi);
/*     */       }
View Full Code Here


/* 77 */     if (this == obj)
/* 78 */       return true;
/* 79 */     if ((obj == null) || (!(obj instanceof ParameterInfo))) {
/* 80 */       return false;
/*    */     }
/* 82 */     ParameterInfo other = (ParameterInfo)obj;
/* 83 */     return this.parameterType.equals(other.getParameterType());
/*    */   }
View Full Code Here

/*     */
/* 803 */     if (paramInfo != null)
/*     */     {
/* 805 */       for (int i = 0; i < paramInfo.length; i++)
/*     */       {
/* 807 */         ParameterInfo pinfo = paramInfo[i];
/* 808 */         String pname = pinfo.getName();
/* 809 */         String pdescription = null;
/* 810 */         ManagementParameter mpa = null;
/*     */
/* 812 */         if (i < params.length)
/*     */         {
/* 814 */           mpa = params[i];
/* 815 */           if (!mpa.name().equals(""))
/* 816 */             pname = mpa.name();
/* 817 */           if (!mpa.description().equals("")) {
/* 818 */             pdescription = mpa.description();
/*     */           }
/*     */         }
/* 821 */         if (pname == null)
/* 822 */           pname = "arg#" + i;
/* 823 */         Fields fields = new DefaultFieldsImpl(pname);
/* 824 */         if (pdescription != null)
/* 825 */           fields.setField("description", pdescription);
/* 826 */         MetaType metaType = this.metaTypeFactory.resolve(pinfo.getParameterType());
/* 827 */         fields.setField("metaType", metaType);
/*     */         try
/*     */         {
/* 831 */           Class factoryClass = opConstraintsFactor;
/* 832 */           if (factoryClass == ManagementParameter.NULL_CONSTRAINTS.class)
View Full Code Here

/*  88 */     if (this == obj)
/*  89 */       return true;
/*  90 */     if ((obj == null) || (!(obj instanceof ParameterInfo))) {
/*  91 */       return false;
/*     */     }
/*  93 */     ParameterInfo other = (ParameterInfo)obj;
/*  94 */     return this.parameterType.equals(other.getParameterType());
/*     */   }
View Full Code Here

         typeInfos[i] = parameters[i].getParameterType();

      List<ParameterMetaData> pmds = new ArrayList<ParameterMetaData>();
      for(int i=0; i < parameters.length; i++)
      {
         ParameterInfo pi = parameters[i];
         Signature pis = new MethodParametersSignature(
               pi.getName(),
               Configurator.getParameterTypes(log.isTraceEnabled(), typeInfos),
               i
         );
         MetaData mdr = retrieval.getComponentMetaData(pis);
         if (mdr != null)
         {
            ValueMetaData value = null;
            for(Annotation2ValueMetaDataAdapter adapter : adapters)
            {
               // todo - match multiple annotations?
               Annotation adapterAnnotation = mdr.getAnnotation(adapter.getAnnotation());
               if (adapterAnnotation != null)
               {
                  value = adapter.createValueMetaData(adapterAnnotation);
                  break;
               }
            }
            if (value == null)
               throw new IllegalArgumentException("No such Annotation2ValueMetaData adapter or no annotation on ParameterInfo: " + pi);
            if (trace)
               log.trace("Adding new ParameterMetaData for annotation: " + value);
            pmds.add(new AbstractParameterMetaData(pi.getParameterType().getName(), value));
         }
         else
         {
            throw new IllegalArgumentException("MetaData for parameter must exist: " + pi);
         }
View Full Code Here

      // Process the op parameters
      if( paramInfo != null )
      {
         for(int i = 0; i < paramInfo.length; i ++)
         {
            ParameterInfo pinfo = paramInfo[i];
            String pname = pinfo.getName();
            String pdescription = null;
            ManagementParameter mpa = null;
            // Look to ManagementParameter for info
            if (i < params.length)
            {
               mpa = params[i];
               if (mpa.name().equals(AnnotationDefaults.EMPTY_STRING) == false)
                  pname = mpa.name();
               if (mpa.description().equals(AnnotationDefaults.EMPTY_STRING) == false)
                  pdescription = mpa.description();
            }
            // Generate a name if there is none
            if (pname == null)
               pname = "arg#" + i;
            Fields fields =  new DefaultFieldsImpl(pname);
            if (pdescription != null)
               fields.setField(Fields.DESCRIPTION, pdescription);
            MetaMapper[] paramMapper = {null};
            MetaType metaType = getMetaType(pinfo, pinfo.getParameterType(), metaData, true, paramMapper);
            fields.setField(Fields.META_TYPE, metaType);
            // Delegate others (legal values, min/max etc.) to the constraints factory
            try
            {
               Class<? extends ManagedParameterConstraintsPopulatorFactory> factoryClass = opConstraintsFactor;
View Full Code Here

TOP

Related Classes of org.jboss.reflect.spi.ParameterInfo

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.