创建一个 BeanListHandler对象

@param <E> 处理对象类型
@param beanType Bean类型
@return BeanListHandler对象
519377
public static <E> BeanListHandler<E> create(Class<E> beanType) {
		return new BeanListHandler<E>(beanType);
	}
986049
@SuppressWarnings("unchecked")
    public static <T extends Element> List<T> elements(Class<T> type, Locator locator) {
        if (!type.isInterface()) {
            throw new IllegalArgumentException("Element type must be an interface, was: " + type);
        }

        InvocationHandler invocationHandler = new ElementListHandler(type, locator);

        return (List<T>) Proxy.newProxyInstance(Elements.class.getClassLoader(),
                new Class[] { List.class, HasElementContext.class },
                invocationHandler);
    }
1133258
public <T> WithStaticFinder<T> withFinder(Class<T> beanType) {
    WithStaticFinder<T> withFinder = new WithStaticFinder<>(beanType);
    staticFinderReplacement.add(withFinder);
    return withFinder;
  }
208530
public static Type getPropertyType(Class<?> beanClass, String field) {
        try {
            return INSTANCE.findPropertyType(beanClass, field);
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
            throw handleReflectionException(beanClass, field, e);
        }
    }
944561
public static TreeSet<Integer> supplyLackedNumberMappingColumn(final Class<?> beanType, final List<ColumnMapping> list,
            final Optional<CsvPartial> partialAnno, final String[] suppliedHeaders) {
        
        final TreeSet<Integer> checkedNumber = list.stream()
                .filter(col -> col.isDeterminedNumber())
                .map(col -> col.getNumber())
                .collect(Collectors.toCollection(TreeSet::new));
        
        // 定義されている列番号の最大値
        final int maxColumnNumber = checkedNumber.last();
        
        // Beanに定義されていない欠けているカラム番号の取得
        final TreeSet<Integer> lackedNumbers = new TreeSet<Integer>();
        for(int i=1; i <= maxColumnNumber; i++) {
            if(!checkedNumber.contains(i)) {
                lackedNumbers.add(i);
            }
        }
        
        // 定義されているカラム番号より、大きなカラム番号を持つカラム情報の補足
        if(partialAnno.isPresent()) {
            
            final int partialColumnSize = partialAnno.get().columnSize();
            if(maxColumnNumber > partialColumnSize) {
                throw new SuperCsvInvalidAnnotationException(partialAnno.get(), MessageBuilder.create("anno.CsvPartial.columSizeMin")
                        .var("property", beanType.getName())
                        .var("columnSize", partialColumnSize)
                        .var("maxColumnNumber", maxColumnNumber)
                        .format());
                
            }
            
            if(maxColumnNumber < partialColumnSize) {
                for(int i= maxColumnNumber+1; i <= partialColumnSize; i++) {
                    lackedNumbers.add(i);
                }
            }
            
        }
        
        // 不足分のカラムがある場合は、部分的な読み書き用カラムとして追加する
        if(lackedNumbers.size() > 0) {
            
            for(int number : lackedNumbers) {
                list.add(createPartialColumnMapping(number, partialAnno, getSuppliedHeaders(suppliedHeaders, number)));
            }
            
            list.sort(null);
        }
        
        return lackedNumbers;
        
    }
468053
public static void getXMLCMCLockType(LockType[] lockType, Method[] ejbMethods, Session sessionBean)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "getXMLCMCLockType: " + sessionBean.getEjbClassName()
                         + " methods = " + Arrays.toString(ejbMethods)); //F743-7027.1

        // Create an array of ints that will hold the highest priority
        // style of <lock> stanza configured for each method.  The priority
        // from lowest to highest is as follows:
        //
        //  1 - style one is the case where method name is "*" which indicates
        //      a lock type value configured for all methods of the singleton SB.
        //  2 - style two is the case where method name is specified, but not the
        //      method parameters. This must override any style 1 configuration.
        //  3 - style three is the case where both method name and parameters are specified.
        //      This style is required by spec to override any style 1 or 2 configured for the bean.

        int numberOfEjbMethods = ejbMethods.length; //F743-7027CodRev
        int[] highestStyleOnMethod = new int[numberOfEjbMethods]; //F743-7027CodRev

        // Get the list of WCCM ConcurrentMethod objects configured for this
        // singleton session bean and its enterprise bean name. There is one ConcurrentMethod
        // object created for each <lock> stanza that exists in DD.

        String enterpriseBeanName = sessionBean.getName();
        //F00743.9717
        List<ConcurrentMethod> cmcMethodList = sessionBean.getConcurrentMethods();

        // For each of WCCM ConcurrentMethod objects, determine which EJB methods this
        // ConcurrentMethod object applies to and set the lock type in the lockType array
        // passed to this method by the caller.
        int numberOfCmcMethods = cmcMethodList.size(); //F743-7027CodRev
        for (int i = 0; i < numberOfCmcMethods; i++) //F743-7027CodRev
        {
            // Get the WCCM ConcurrentLockType, NamedMethod, and MethodParams objects
            // from the WCCM ConcurrentMethod object being processed in this iteration.
            //F00743.9717
            ConcurrentMethod cmcMethod = cmcMethodList.get(i);
            int cmcLockType = cmcMethod.getLockTypeValue();

            // Process lock type if DD provided one for this ConcurrentMethod object.
            if (cmcLockType != ConcurrentMethod.LOCK_TYPE_UNSPECIFIED)
            {
                NamedMethod namedMethod = cmcMethod.getMethod();
                List<String> parms = namedMethod.getMethodParamList();

                // Map the ConcurrentLockType object to the corresponding javax.ejb.LockType value.
                // Assumption here is WCCM parser error occurs and application does not install
                // if invalid value was coded (something other than Read or Write).
                LockType methodLockType = null;
                //F00743.9717
                if (cmcLockType == ConcurrentMethod.LOCK_TYPE_READ)
                {
                    methodLockType = LockType.READ;
                }
                else if (cmcLockType == ConcurrentMethod.LOCK_TYPE_WRITE)
                {
                    methodLockType = LockType.WRITE;
                }

                // Now determine whether ConcurrentMethod is a style 1, 2, or 3 configuration
                // and update lockType array with method lock type as appropriate.
                String cmcMethodName = namedMethod.getMethodName().trim();
                if (isTraceOn && tc.isDebugEnabled()) //F743-7027.1
                {
                    Tr.debug(tc, cmcMethodName + " LockType = " + methodLockType); //F743-7027.1
                }
                if (cmcMethodName.equals("*"))
                {
                    // style type 1 -- update all entries in lockType array that was not
                    // previously set by either a style 2 or 3 configuration.
                    // The EJB spec is silent on whether more than one style 1 can be specified
                    // for the same singleton session bean.  Our assumption is the last style 1 is used.
                    for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev
                    {
                        Method m = ejbMethods[j];
                        if (highestStyleOnMethod[j] <= 1)
                        {
                            if (isTraceOn && tc.isDebugEnabled())
                                trace(m, enterpriseBeanName,
                                      "Style 1 - replacing " + lockType[j] + " lock type with " + methodLockType);

                            lockType[j] = methodLockType;
                            highestStyleOnMethod[j] = 1;
                        }
                    }
                }
                else if (parms == null)
                {
                    // style type 2 -- update all entries in lockType array for a
                    // method with matching method name that was not previously
                    // set by a style 3 configuration.
                    // The EJB spec is silent on whether more than one style 2 can be specified
                    // for the same method.  Our assumption is the last style 2 is used.
                    for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev
                    {
                        if (highestStyleOnMethod[j] <= 2)
                        {
                            Method m = ejbMethods[j];
                            String methodName = m.getName(); //F743-7027.1
                            if (cmcMethodName.equals(methodName)) //F743-7027.1
                            {
                                if (isTraceOn && tc.isDebugEnabled())
                                    trace(m, enterpriseBeanName,
                                          "Style 2 - replacing " + lockType[j] + " lock type with " + methodLockType);

                                lockType[j] = methodLockType;
                                highestStyleOnMethod[j] = 2;
                            }
                        }
                    }
                }
                else
                {
                    // style type 3 -- update only the lockType array entry with a
                    // matching method signature.
                    // The EJB spec is silent on whether more than one style 3 can be specified
                    // for the same method signature.  Our assumption is the last style 3 is used.
                    Method style3Method = DDUtil.findMethod(namedMethod, ejbMethods);
                    if (style3Method != null) //F743-7027.1
                    {
                        for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev
                        {
                            Method m = ejbMethods[j];
                            if (style3Method.equals(m))
                            {
                                if (isTraceOn && tc.isDebugEnabled())
                                    trace(m, enterpriseBeanName,
                                          "Style 3 - replacing " + lockType[j] + " lock type with " + methodLockType);

                                lockType[j] = methodLockType;
                                highestStyleOnMethod[j] = 3;

                                // break out of for loop since there can only be 1 EJB method that
                                // matches the signature.
                                break;
                            }
                        }
                    }
                }
            }
        } // end for

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "getXMLCMCLockType: " + sessionBean.getEjbClassName(), Arrays.toString(lockType)); //F743-7027.1
    }
48141
public static HandlerInterceptor[] lookupHandlerInterceptors(ServletContext servletContext) {
        WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);

        final Collection<HandlerInterceptor> allHandlerInterceptors = new ArrayList<HandlerInterceptor>();

        WebRequestInterceptor[] webRequestInterceptors = lookupWebRequestInterceptors(servletContext);
        for (WebRequestInterceptor webRequestInterceptor : webRequestInterceptors) {
            allHandlerInterceptors.add(new WebRequestHandlerInterceptorAdapter(webRequestInterceptor));
        }
        final Collection<HandlerInterceptor> handlerInterceptors = wac.getBeansOfType(HandlerInterceptor.class).values();

        allHandlerInterceptors.addAll(handlerInterceptors);
        return allHandlerInterceptors.toArray(new HandlerInterceptor[allHandlerInterceptors.size()]);
    }
423503
public static <T> ArgumentProcessor<T> forType(Class<? extends T> beanType) {
    return newInstance(beanType, new GnuParser());
  }
484060
public T handle(List<QueryParameters> outputList) throws MjdbcException {
        return (T) this.outputProcessor.toBean(outputList, this.type);
    }
583516
public Response getEntityListByType(String entityType) {
        try {
            Preconditions.checkNotNull(entityType, "Entity type cannot be null");

            if (LOG.isDebugEnabled()) {
                LOG.debug("Fetching entity list for type={} ", entityType);
            }

            final List<String> entityList = metadataService.getEntityList(entityType);

            JSONObject response = new JSONObject();
            response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId());
            response.put(AtlasClient.TYPENAME, entityType);
            response.put(AtlasClient.RESULTS, new JSONArray(entityList));
            response.put(AtlasClient.COUNT, entityList.size());

            return Response.ok(response).build();
        } catch (NullPointerException e) {
            LOG.error("Entity type cannot be null", e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.BAD_REQUEST));
        } catch (AtlasException | IllegalArgumentException e) {
            LOG.error("Unable to get entity list for type {}", entityType, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.BAD_REQUEST));
        } catch (WebApplicationException e) {
            LOG.error("Unable to get entity list for type {}", entityType, e);
            throw e;
        } catch (Throwable e) {
            LOG.error("Unable to get entity list for type {}", entityType, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
        }
    }
112603
public static Object getBean(String name, Class requiredType) throws BeansException {
		return applicationContext.getBean(name, requiredType);
	}
909739
@SuppressWarnings("unchecked")
    public <T> T get(final Class<T> type) {
        T bean = (T) components.get(type);
        if (bean != null) {
            return bean;
        }
        return (T) get(type.getName());
    }
1031412
private void processSingletonConcurrencyManagementType(BeanMetaData bmd) throws EJBConfigurationException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "processSingletonConcurrencyManagementType");
        }

        // Initialize DD Concurrency Management type to null and change to
        // non null value if it is specified in the DD for the module.
        ConcurrencyManagementType ddType = null;

        // F743-7027 start
        Session sessionBean = (Session) bmd.wccm.enterpriseBean;
        if (sessionBean != null) {
            int type = sessionBean.getConcurrencyManagementTypeValue();
            if (type == Session.CONCURRENCY_MANAGEMENT_TYPE_CONTAINER) {
                ddType = ConcurrencyManagementType.CONTAINER;
            } else if (type == Session.CONCURRENCY_MANAGEMENT_TYPE_BEAN) {
                ddType = ConcurrencyManagementType.BEAN;
            }
        } // F743-7027 end

        // Initialize annotation Concurrency Management type to null and change to
        // non null value only if metadata complete is false and annotation is used
        // for this Singleton session bean.
        ConcurrencyManagementType annotationType = null;
        if (bmd.metadataComplete == false) {
            // Metadata complete is false, so do we have annotation value?
            // Note, EJB spec says annotation can not be inherited from superclass.
            Class<?> ejbClass = bmd.enterpriseBeanClass;
            ConcurrencyManagement annotation = ejbClass.getAnnotation(javax.ejb.ConcurrencyManagement.class);
            if (annotation != null) {
                // We have an annotation on EJB class, so validate that it is a valid value.
                annotationType = annotation.value();
                if (annotationType != ConcurrencyManagementType.CONTAINER && annotationType != ConcurrencyManagementType.BEAN) {
                    // CNTR0193E: The value, {0}, that is specified for the concurrency management type of
                    // the {1} enterprise bean class must be either BEAN or CONTAINER.
                    Tr.error(tc, "SINGLETON_INVALID_CONCURRENCY_MANAGEMENT_CNTR0193E", new Object[] { annotationType, bmd.enterpriseBeanClassName });

                    throw new EJBConfigurationException("CNTR0193E: The value, " + annotationType
                                                        + ", that is specified for the concurrency management type of the "
                                                        + bmd.enterpriseBeanClassName + " enterprise bean class must be either BEAN or CONTAINER.");
                }
            }
        }

        // Assign concurrency management type for this Singleton seesion bean.
        // Note, in "4.8.4.3 Specification of a Concurrency Management Type" of EJB 3.1 specification,
        // it says "The application assembler is not permitted to use the deployment
        // descriptor to override a bean's concurrency management type regardless of whether
        // it has been explicitly specified or defaulted by the Bean Provider."  However,
        // we have no way to know whether DD is from application assembler vs Bean Provider,
        // so we have to assume it came from Bean Provider.  The team decided that if both
        // annotation and DD is used, then the value must match. If they do not match,
        // throw an exception.

        // Was a value provided via DD?
        if (ddType == null) {
            // DD did not provide a value, so use annotation value if one was provided.
            // Otherwise, use default value required by EJB 3.1 spec.
            if (annotationType != null) {
                // No DD, but we have annotation. So use the annotation.
                bmd.ivSingletonUsesBeanManagedConcurrency = (annotationType == ConcurrencyManagementType.BEAN);
            } else {
                // Neither DD nor annotation, so default to Container Concurrency Management type.
                bmd.ivSingletonUsesBeanManagedConcurrency = false;
            }
        } else {
            // DD did provide a concurrency management type. Verify it matches annotation type
            // if both annotation and DD provided a value.
            if (annotationType != null && ddType != annotationType) {
                // CNTR0194E: The value {0} that is specified in the ejb-jar.xml file for concurrency management type is
                // not the same as the @ConcurrencyManagement annotation value {1} on the {2} enterprise bean class.
                Tr.error(tc, "SINGLETON_XML_OVERRIDE_CONCURRENCY_MANAGEMENT_CNTR0194E", new Object[] { ddType, annotationType, bmd.enterpriseBeanClassName });

                throw new EJBConfigurationException("CNTR0194E: The value " + ddType
                                                    + " that is specified in the ejb-jar.xml file for concurrency management type is not the same "
                                                    + " as the @ConcurrencyManagement annotation value " + annotationType + " on the "
                                                    + bmd.enterpriseBeanClassName + " enterprise bean class.");
            }

            // Use DD value since either annotation not used or DD matches the annotation type.
            bmd.ivSingletonUsesBeanManagedConcurrency = (ddType == ConcurrencyManagementType.BEAN);
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "processSingletonConcurrencyManagementType returning "
                        + bmd.ivSingletonUsesBeanManagedConcurrency + " for j2ee name = " + bmd.j2eeName);
        }
    }
548067
public   <T> T  sqlObject(Class<T> beanType , String templateName,Map params) throws ElasticSearchException {
		SQLRestResponse result = this.client.executeRequest("/_xpack/sql",ESTemplateHelper.evalTemplate(esUtil,templateName, params),   new SQLRestResponseHandler());
		return ResultUtil.buildSQLObject(result,beanType);
	}
904845
public <H extends EventHandler> HandlerRegistration addHandler(GwtEvent.Type<H> type, final H handler) {
		if (type != null && handler != null) {
			return new LegacyHandlerWrapper(this.eventBus.addHandler(type, handler));
		}
		return null;
	}
1027957
public static <T> Map<String, T> getBeansOfType(ApplicationContext appContext, Class<T> clazz) {
        try {
            return appContext.getBeansOfType(clazz);
        } catch (BeansException e) {
            return new HashMap<String, T>();
        }
    }
655260
public MessageMgrBuilder setHandler(E_MessageType type){
		if(type!=null){
			this.messageHandlers.put(type, new MessageTypeHandler(type));
		}
		else{
			this.buildErrors.addError("{}: cannot add handler for empty type", this.getClass().getSimpleName());
		}
		return this;
	}