本文整理匯總了Java中java.beans.MethodDescriptor.getDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodDescriptor.getDisplayName方法的具體用法?Java MethodDescriptor.getDisplayName怎麽用?Java MethodDescriptor.getDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.MethodDescriptor
的用法示例。
在下文中一共展示了MethodDescriptor.getDisplayName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}