当前位置: 首页>>代码示例>>Java>>正文


Java ParameterDescriptor类代码示例

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


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

示例1: _createMergedMethodDescriptor

import java.beans.ParameterDescriptor; //导入依赖的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

示例2: testMethodDescriptorMethodParameterDescriptorArray

import java.beans.ParameterDescriptor; //导入依赖的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

示例3: testMethodDescriptor

import java.beans.ParameterDescriptor; //导入依赖的package包/类
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:Test8005065.java

示例4: print

import java.beans.ParameterDescriptor; //导入依赖的package包/类
private static void print(MethodDescriptor[] mds) {
    System.out.println(mds.length + " method descriptors");
    Arrays.sort(mds, new Test4058433());
    for (MethodDescriptor md : mds) {
        print(md);
        print("method", md.getMethod());
        ParameterDescriptor[] pds = md.getParameterDescriptors();
        if (pds != null) {
            System.out.println(pds.length + " parameter descriptors");
            for (ParameterDescriptor pd : pds) {
                print(pd);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:Test4058433.java

示例5: testMethodDescriptorMethodParameterDescriptorArray_MethodNull

import java.beans.ParameterDescriptor; //导入依赖的package包/类
public void testMethodDescriptorMethodParameterDescriptorArray_MethodNull() {
    Method method = null;
    ParameterDescriptor[] pds = new ParameterDescriptor[1];
    pds[0] = new ParameterDescriptor();
    try {
        new MethodDescriptor(method, pds);
        fail("Should throw NullPointerException.");
    } catch (NullPointerException e) {
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:MethodDescriptorTest.java

示例6: test_Ctor2_NullPointerException

import java.beans.ParameterDescriptor; //导入依赖的package包/类
/**
 * @tests java.beans.MethodDescriptor#MethodDescriptor(
 *        java.lang.reflect.Method, java.beans.ParameterDescriptor[])
 */
public void test_Ctor2_NullPointerException() {
    try {
        // Regression for HARMONY-226
        new MethodDescriptor(null, new ParameterDescriptor[0]);
        fail("No expected NullPointerException");
    } catch (NullPointerException e) {
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:MethodDescriptorTest.java

示例7: testParameterDescriptor

import java.beans.ParameterDescriptor; //导入依赖的package包/类
public void testParameterDescriptor() {
    ParameterDescriptor pd = new ParameterDescriptor();
    assertNull(pd.getDisplayName());
    assertNull(pd.getName());
    assertNull(pd.getShortDescription());

    assertNotNull(pd.attributeNames());

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


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