• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MethodDescriptor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中java.beans.MethodDescriptor的典型用法代码示例。如果您正苦于以下问题:Java MethodDescriptor类的具体用法?Java MethodDescriptor怎么用?Java MethodDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodDescriptor类属于java.beans包,在下文中一共展示了MethodDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: 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:umple,项目名称:umple,代码行数:28,代码来源:ClusterEvaluation.java


示例17: 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:umple,项目名称:umple,代码行数:28,代码来源:Evaluation.java


示例18: 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>() {
		public int compare(Method m1, Method m2) {
			return m2.toString().compareTo(m1.toString());
		}
	});
	return matches;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:19,代码来源:ExtendedBeanInfo.java


示例19: testMethodDescriptorMethod

import java.beans.MethodDescriptor; //导入依赖的package包/类
public void testMethodDescriptorMethod() throws SecurityException,
        NoSuchMethodException {
    String beanName = "MethodDescriptorTest.bean";
    MockJavaBean bean = new MockJavaBean(beanName);
    Method method = bean.getClass()
            .getMethod("getBeanName", (Class[]) null);
    MethodDescriptor md = new MethodDescriptor(method);

    assertSame(method, md.getMethod());
    assertNull(md.getParameterDescriptors());

    assertEquals(method.getName(), md.getDisplayName());
    assertEquals(method.getName(), md.getName());
    assertEquals(method.getName(), md.getShortDescription());

    assertNotNull(md.attributeNames());

    assertFalse(md.isExpert());
    assertFalse(md.isHidden());
    assertFalse(md.isPreferred());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:MethodDescriptorTest.java


示例20: testMethodDescriptorMethodParameterDescriptorArray

import java.beans.MethodDescriptor; //导入依赖的package包/类
public void testMethodDescriptorMethodParameterDescriptorArray()
        throws SecurityException, NoSuchMethodException {
    String beanName = "MethodDescriptorTest.bean";
    MockJavaBean bean = new MockJavaBean(beanName);
    Method method = bean.getClass().getMethod("setPropertyOne",
            new Class[] { String.class });
    ParameterDescriptor[] pds = new ParameterDescriptor[1];
    pds[0] = new ParameterDescriptor();
    pds[0].setValue(method.getName(), method.getReturnType());
    MethodDescriptor md = new MethodDescriptor(method, pds);

    assertSame(method, md.getMethod());
    assertSame(pds, md.getParameterDescriptors());
    assertEquals(pds[0].getValue(method.getName()), md
            .getParameterDescriptors()[0].getValue(method.getName()));

    assertEquals(method.getName(), md.getDisplayName());
    assertEquals(method.getName(), md.getName());
    assertEquals(method.getName(), md.getShortDescription());

    assertNotNull(md.attributeNames());

    assertFalse(md.isExpert());
    assertFalse(md.isHidden());
    assertFalse(md.isPreferred());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:MethodDescriptorTest.java



注:本文中的java.beans.MethodDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AccessType类代码示例发布时间:2022-05-20
下一篇:
Java FillBucketEvent类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap