當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodDescriptor類代碼示例

本文整理匯總了Java中java.beans.MethodDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java MethodDescriptor類的具體用法?Java MethodDescriptor怎麽用?Java MethodDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MethodDescriptor類屬於java.beans包,在下文中一共展示了MethodDescriptor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: _makeQualifiedMethodName

import java.beans.MethodDescriptor; //導入依賴的package包/類
private String _makeQualifiedMethodName(
  MethodDescriptor descriptor
  )
{
  Method        m = descriptor.getMethod();
  StringBuffer sb = new StringBuffer();

  sb.append(m.getName());
  sb.append("=");

  Class params[] = m.getParameterTypes();

  for (int i = 0; i < params.length; i++)
  {
    sb.append(":");
    sb.append(params[i].getName());
  }

  return sb.toString();
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:21,代碼來源:JavaIntrospector.java

示例2: _createMergedMethodDescriptor

import java.beans.MethodDescriptor; //導入依賴的package包/類
private static MethodDescriptor _createMergedMethodDescriptor(
   MethodDescriptor secondaryDescriptor,
   MethodDescriptor primaryDescriptor
   )
 {
   ParameterDescriptor[] parameterDescriptors =
                                 primaryDescriptor.getParameterDescriptors();

  if (parameterDescriptors == null)
  {
    parameterDescriptors = secondaryDescriptor.getParameterDescriptors();
  }

  MethodDescriptor mergedDescriptor = new MethodDescriptor(
                                           primaryDescriptor.getMethod(),
                                           parameterDescriptors);

  // merge the superclasses
  _mergeFeatureDescriptors(secondaryDescriptor,
                           primaryDescriptor,
                           mergedDescriptor);

  return mergedDescriptor;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:25,代碼來源:JavaIntrospector.java

示例3: __createMergedEventSetStub

import java.beans.MethodDescriptor; //導入依賴的package包/類
static EventSetDescriptor __createMergedEventSetStub(
  EventSetDescriptor oldDescriptor,
  MethodDescriptor[] listenerDescriptors
  )
{
  try
  {
    EventSetDescriptor stubDescriptor = new EventSetDescriptor(
                                  oldDescriptor.getName(),
                                  oldDescriptor.getListenerType(),
                                  listenerDescriptors,
                                  oldDescriptor.getAddListenerMethod(),
                                  oldDescriptor.getRemoveListenerMethod());

    // set the unicast attribute
    stubDescriptor.setUnicast(oldDescriptor.isUnicast());

    return stubDescriptor;
  }
  catch (Exception e)
  {
    //    _LOG.severe(e);
    return null;
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:26,代碼來源:JavaIntrospector.java

示例4: _cloneMethodDescriptor

import java.beans.MethodDescriptor; //導入依賴的package包/類
private static MethodDescriptor _cloneMethodDescriptor(
  MethodDescriptor oldDescriptor
  )
{
  try
  {
    MethodDescriptor newDescriptor = new MethodDescriptor(
                                  oldDescriptor.getMethod(),
                                  oldDescriptor.getParameterDescriptors());

    // copy the rest of the attributes
    _copyFeatureDescriptor(oldDescriptor, newDescriptor);

    return newDescriptor;
  }
  catch (Exception e)
  {
    _LOG.severe(e);
    return null;
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:22,代碼來源:JavaIntrospector.java

示例5: findCandidateWriteMethods

import java.beans.MethodDescriptor; //導入依賴的package包/類
private List<Method> findCandidateWriteMethods(MethodDescriptor[] methodDescriptors) {
	List<Method> matches = new ArrayList<Method>();
	for (MethodDescriptor methodDescriptor : methodDescriptors) {
		Method method = methodDescriptor.getMethod();
		if (isCandidateWriteMethod(method)) {
			matches.add(method);
		}
	}
	// sort non-void returning write methods to guard against the ill effects of
	// non-deterministic sorting of methods returned from Class#getDeclaredMethods
	// under JDK 7. See http://bugs.sun.com/view_bug.do?bug_id=7023180
	Collections.sort(matches, new Comparator<Method>() {
		@Override
		public int compare(Method m1, Method m2) {
			return m2.toString().compareTo(m1.toString());
		}
	});
	return matches;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:20,代碼來源:ExtendedBeanInfo.java

示例6: findMethod

import java.beans.MethodDescriptor; //導入依賴的package包/類
private static Method findMethod(Class<?> targetType, String methodName,
        Class<?>[] argTypes) throws IntrospectionException {
    BeanInfo beanInfo = Introspector.getBeanInfo(targetType);
    if (beanInfo != null) {
        for(MethodDescriptor methodDesc: beanInfo.getMethodDescriptors()) {
            Method method = methodDesc.getMethod();
            Class<?>[] parameterTypes = method.getParameterTypes();
            if (methodName.equals(method.getName()) && argTypes.length == parameterTypes.length) {
                boolean matchedArgTypes = true;
                for (int i = 0; i < argTypes.length; i++) { 
                    if (getWrapperIfPrimitive(argTypes[i]) != parameterTypes[i]) {
                        matchedArgTypes = false;
                        break;
                    }
                }
                if (matchedArgTypes) {
                    return method;
                }
            }
        }
    }
    return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:24,代碼來源:QuartzSchedulerMBeanImpl.java

示例7: findCandidateWriteMethods

import java.beans.MethodDescriptor; //導入依賴的package包/類
private List<Method> findCandidateWriteMethods(MethodDescriptor[] methodDescriptors) {
	List<Method> matches = new ArrayList<Method>();
	for (MethodDescriptor methodDescriptor : methodDescriptors) {
		Method method = methodDescriptor.getMethod();
		if (isCandidateWriteMethod(method)) {
			matches.add(method);
		}
	}
	// Sort non-void returning write methods to guard against the ill effects of
	// non-deterministic sorting of methods returned from Class#getDeclaredMethods
	// under JDK 7. See http://bugs.sun.com/view_bug.do?bug_id=7023180
	Collections.sort(matches, new Comparator<Method>() {
		@Override
		public int compare(Method m1, Method m2) {
			return m2.toString().compareTo(m1.toString());
		}
	});
	return matches;
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:20,代碼來源:ExtendedBeanInfo.java

示例8: ExplicitBeanInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
public ExplicitBeanInfo(BeanDescriptor beanDescriptor,
                        BeanInfo[] additionalBeanInfo,
                        PropertyDescriptor[] propertyDescriptors,
                        int defaultPropertyIndex,
                        EventSetDescriptor[] eventSetDescriptors,
                        int defaultEventIndex,
                        MethodDescriptor[] methodDescriptors,
                        Image[] icons) {
        this.beanDescriptor = beanDescriptor;
        this.additionalBeanInfo = additionalBeanInfo;
        this.propertyDescriptors = propertyDescriptors;
        this.defaultPropertyIndex = defaultPropertyIndex;
        this.eventSetDescriptors = eventSetDescriptors;
        this.defaultEventIndex = defaultEventIndex;
        this.methodDescriptors = methodDescriptors;
        this.icons = icons;
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:18,代碼來源:ExplicitBeanInfo.java

示例9: getBeanInfoEmbryo

import java.beans.MethodDescriptor; //導入依賴的package包/類
public BeanInfoEmbryo getBeanInfoEmbryo() throws IntrospectionException {
        BeanInfoEmbryo b = new BeanInfoEmbryo();
        findXXX(b,IS);
        findXXXInt(b,GET_I);
        findXXXInt(b,SET_I);
        findXXX(b,GET);
        findXXX(b,SET);
        findAddRemovePairs(b);
        for(int i=0;i<otherMethods.size();i++) {
                MethodDescriptor newMethod = new MethodDescriptor((Method)otherMethods.elementAt(i));
                if(!b.hasMethod(newMethod)) {
                        b.addMethod(new MethodDescriptor((Method)otherMethods.elementAt(i)));
                }
        }
        return b;
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:17,代碼來源:IntrospectionIncubator.java

示例10: getGlobalInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
/**
 * Return the global info (if it exists) for the supplied clusterer
 * 
 * @param clusterer the clusterer to get the global info for
 * @return the global info (synopsis) for the clusterer
 * @throws Exception if there is a problem reflecting on the clusterer
 */
protected static String getGlobalInfo(Clusterer clusterer) throws Exception {
  BeanInfo bi = Introspector.getBeanInfo(clusterer.getClass());
  MethodDescriptor[] methods;
  methods = bi.getMethodDescriptors();
  Object[] args = {};
  String result =
    "\nSynopsis for " + clusterer.getClass().getName() + ":\n\n";

  for (MethodDescriptor method : methods) {
    String name = method.getDisplayName();
    Method meth = method.getMethod();
    if (name.equals("globalInfo")) {
      String globalInfo = (String) (meth.invoke(clusterer, args));
      result += globalInfo;
      break;
    }
  }

  return result;
}
 
開發者ID:mydzigear,項目名稱:repo.kmeanspp.silhouette_score,代碼行數:28,代碼來源:ClusterEvaluation.java

示例11: getGlobalInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
/**
 * Return the global info (if it exists) for the supplied classifier.
 * 
 * @param classifier the classifier to get the global info for
 * @return the global info (synopsis) for the classifier
 * @throws Exception if there is a problem reflecting on the classifier
 */
protected static String getGlobalInfo(Classifier classifier) throws Exception {
  BeanInfo bi = Introspector.getBeanInfo(classifier.getClass());
  MethodDescriptor[] methods;
  methods = bi.getMethodDescriptors();
  Object[] args = {};
  String result =
    "\nSynopsis for " + classifier.getClass().getName() + ":\n\n";

  for (MethodDescriptor method : methods) {
    String name = method.getDisplayName();
    Method meth = method.getMethod();
    if (name.equals("globalInfo")) {
      String globalInfo = (String) (meth.invoke(classifier, args));
      result += globalInfo;
      break;
    }
  }

  return result;
}
 
開發者ID:mydzigear,項目名稱:repo.kmeanspp.silhouette_score,代碼行數:28,代碼來源:Evaluation.java

示例12: ExplicitBeanInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
public ExplicitBeanInfo(BeanDescriptor beanDescriptor,
                        BeanInfo[] additionalBeanInfo,
                        PropertyDescriptor[] propertyDescriptors,
			int defaultPropertyIndex,
                        EventSetDescriptor[] eventSetDescriptors,
			int defaultEventIndex,
                        MethodDescriptor[] methodDescriptors,
			Image[] icons) {
	this.beanDescriptor = beanDescriptor;
	this.additionalBeanInfo = additionalBeanInfo;
	this.propertyDescriptors = propertyDescriptors;
	this.defaultPropertyIndex = defaultPropertyIndex;
	this.eventSetDescriptors = eventSetDescriptors;
	this.defaultEventIndex = defaultEventIndex;
	this.methodDescriptors = methodDescriptors;
	this.icons = icons;
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:18,代碼來源:ExplicitBeanInfo.java

示例13: getBeanInfoEmbryo

import java.beans.MethodDescriptor; //導入依賴的package包/類
public BeanInfoEmbryo getBeanInfoEmbryo() throws IntrospectionException {
	BeanInfoEmbryo b = new BeanInfoEmbryo();
	findXXX(b,IS);
	findXXXInt(b,GET_I);
	findXXXInt(b,SET_I);
	findXXX(b,GET);
	findXXX(b,SET);
	findAddRemovePairs(b);
	for(int i=0;i<otherMethods.size();i++) {
		MethodDescriptor newMethod = new MethodDescriptor((Method)otherMethods.elementAt(i));
		if(!b.hasMethod(newMethod)) {
			b.addMethod(new MethodDescriptor((Method)otherMethods.elementAt(i)));
		}
	}
	return b;
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:17,代碼來源:IntrospectionIncubator.java

示例14: getGlobalInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
/**
 * Return the global info (if it exists) for the supplied clusterer
 * 
 * @param clusterer the clusterer to get the global info for
 * @return the global info (synopsis) for the clusterer
 * @throws Exception if there is a problem reflecting on the clusterer
 */
protected static String getGlobalInfo(Clusterer clusterer) throws Exception {
  BeanInfo bi = Introspector.getBeanInfo(clusterer.getClass());
  MethodDescriptor[] methods;
  methods = bi.getMethodDescriptors();
  Object[] args = {};
  String result = "\nSynopsis for " + clusterer.getClass().getName()
    + ":\n\n";
  
  for (int i = 0; i < methods.length; i++) {
    String name = methods[i].getDisplayName();
    Method meth = methods[i].getMethod();
    if (name.equals("globalInfo")) {
      String globalInfo = (String)(meth.invoke(clusterer, args));
      result += globalInfo;
      break;
    }
  }
  
  return result;
}
 
開發者ID:dsibournemouth,項目名稱:autoweka,代碼行數:28,代碼來源:ClusterEvaluation.java

示例15: getGlobalInfo

import java.beans.MethodDescriptor; //導入依賴的package包/類
/**
 * Return the global info (if it exists) for the supplied classifier.
 * 
 * @param classifier the classifier to get the global info for
 * @return the global info (synopsis) for the classifier
 * @throws Exception if there is a problem reflecting on the classifier
 */
protected static String getGlobalInfo(Classifier classifier) throws Exception {
  BeanInfo bi = Introspector.getBeanInfo(classifier.getClass());
  MethodDescriptor[] methods;
  methods = bi.getMethodDescriptors();
  Object[] args = {};
  String result = "\nSynopsis for " + classifier.getClass().getName()
      + ":\n\n";

  for (int i = 0; i < methods.length; i++) {
    String name = methods[i].getDisplayName();
    Method meth = methods[i].getMethod();
    if (name.equals("globalInfo")) {
      String globalInfo = (String) (meth.invoke(classifier, args));
      result += globalInfo;
      break;
    }
  }

  return result;
}
 
開發者ID:dsibournemouth,項目名稱:autoweka,代碼行數:28,代碼來源:Evaluation.java


注:本文中的java.beans.MethodDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。