类javax.management.openmbean.TabularType源码实例Demo

下面列出了怎么用javax.management.openmbean.TabularType的API类实例代码及写法,或者点击链接到github查看源代码。

private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码2 项目: dragonwell8_jdk   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
源代码3 项目: dragonwell8_jdk   文件: MXBeanTest.java
private static void compareTabularType(TabularType t1, TabularType t2) {
    if (t1.equals(t2)) {
        System.out.println("same tabular type");
        return;
    }
    if (t1.getClassName().equals(t2.getClassName()))
        System.out.println("same class name");
    if (t1.getDescription().equals(t2.getDescription()))
        System.out.println("same description");
    else {
        System.out.println("t1 description: " + t1.getDescription());
        System.out.println("t2 description: " + t2.getDescription());
    }
    if (t1.getIndexNames().equals(t2.getIndexNames()))
        System.out.println("same index names");
    if (t1.getRowType().equals(t2.getRowType()))
        System.out.println("same row type");
}
 
源代码4 项目: TencentKona-8   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
@Test
public void testSimpleTypeObjectEmpty() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.LONG);

    ModelNode node = new ModelNode();
    node.get("one").set("");
    node.get("two").set("");

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertNull(tabularData.get(new Object[] {"one"}).get("value"));
    Assert.assertNull(tabularData.get(new Object[] {"two"}).get("value"));

    ModelNode expected = new ModelNode();
    expected.get("one");
    expected.get("two");

    Assert.assertEquals(expected, converter.toModelNode(tabularData));
}
 
源代码6 项目: TencentKona-8   文件: MXBeanTest.java
private static void compareTabularType(TabularType t1, TabularType t2) {
    if (t1.equals(t2)) {
        System.out.println("same tabular type");
        return;
    }
    if (t1.getClassName().equals(t2.getClassName()))
        System.out.println("same class name");
    if (t1.getDescription().equals(t2.getDescription()))
        System.out.println("same description");
    else {
        System.out.println("t1 description: " + t1.getDescription());
        System.out.println("t2 description: " + t2.getDescription());
    }
    if (t1.getIndexNames().equals(t2.getIndexNames()))
        System.out.println("same index names");
    if (t1.getRowType().equals(t2.getRowType()))
        System.out.println("same row type");
}
 
源代码7 项目: jdk8u60   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码8 项目: deltaspike   文件: DynamicMBeanWrapper.java
private TabularData toTabularData(final String typeName, final String description, final Table table)
{
    final OpenType<?>[] types = new OpenType<?>[table.getColumnNames().size()];
    for (int i = 0; i < types.length; i++)
    {
        types[i] = SimpleType.STRING;
    }

    try
    {
        final String[] keys = table.getColumnNames().toArray(new String[table.getColumnNames().size()]);
        final CompositeType ct = new CompositeType(
                typeName, description, keys, keys, types);
        final TabularType type = new TabularType(typeName, description, ct, keys);
        final TabularDataSupport data = new TabularDataSupport(type);
        for (final Collection<String> line : table.getLines())
        {
            data.put(new CompositeDataSupport(ct, keys, line.toArray(new Object[line.size()])));
        }
        return data;
    }
    catch (final OpenDataException e)
    {
        throw new IllegalArgumentException(e);
    }
}
 
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码10 项目: jdk8u-jdk   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码11 项目: jdk8u_jdk   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
源代码12 项目: openjdk-jdk8u-backup   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: MXBeanTest.java
private static void compareTabularType(TabularType t1, TabularType t2) {
    if (t1.equals(t2)) {
        System.out.println("same tabular type");
        return;
    }
    if (t1.getClassName().equals(t2.getClassName()))
        System.out.println("same class name");
    if (t1.getDescription().equals(t2.getDescription()))
        System.out.println("same description");
    else {
        System.out.println("t1 description: " + t1.getDescription());
        System.out.println("t2 description: " + t2.getDescription());
    }
    if (t1.getIndexNames().equals(t2.getIndexNames()))
        System.out.println("same index names");
    if (t1.getRowType().equals(t2.getRowType()))
        System.out.println("same row type");
}
 
@Test
public void testByteArrayObject() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.BYTES);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, ArrayType.getPrimitiveArrayType(byte[].class));

    ModelNode node = new ModelNode();
    node.get("one").set(new byte[] {1,2});
    node.get("two").set(new byte[] {3,4});

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertTrue(Arrays.equals(new byte[] {1,2}, (byte[])tabularData.get(new Object[] {"one"}).get("value")));
    Assert.assertTrue(Arrays.equals(new byte[] {3,4}, (byte[])tabularData.get(new Object[] {"two"}).get("value")));

    //Allow plain map as well? Yeah why not!
    Map<String, byte[]> map = new HashMap<String, byte[]>();
    map.put("one", new byte[] {1,2});
    map.put("two", new byte[] {3,4});
    Assert.assertEquals(node, converter.toModelNode(map));
}
 
源代码16 项目: openjdk-jdk9   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
源代码17 项目: openjdk-jdk9   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
@Test
public void testSimpleTypeObjectExpressions() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
    description.get(EXPRESSIONS_ALLOWED).set(true);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.LONG);

    ModelNode node = new ModelNode();
    node.get("one").set(new ValueExpression("${this.should.not.exist.!!!!!:1}"));
    node.get("two").set(new ValueExpression("${this.should.not.exist.!!!!!:2}"));

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertEquals((long) 1, tabularData.get(new Object[] {"one"}).get("value"));
    Assert.assertEquals((long) 2, tabularData.get(new Object[] {"two"}).get("value"));
}
 
@Test
public void testSimpleTypeObjectExpressions() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
    description.get(EXPRESSIONS_ALLOWED).set(true);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.STRING);

    ModelNode node = new ModelNode();
    node.get("one").set(new ValueExpression("${this.should.not.exist.!!!!!:1}"));
    node.get("two").set(new ValueExpression("${this.should.not.exist.!!!!!:2}"));

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertEquals("${this.should.not.exist.!!!!!:1}", tabularData.get(new Object[] {"one"}).get("value"));
    Assert.assertEquals("${this.should.not.exist.!!!!!:2}", tabularData.get(new Object[] {"two"}).get("value"));

    Assert.assertEquals(node, converter.toModelNode(tabularData));
}
 
@Test
public void testSimpleTypeObject() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.STRING);

    ModelNode node = new ModelNode();
    node.get("one").set(1L);
    node.get("two").set(2L);

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertEquals("1", tabularData.get(new Object[] {"one"}).get("value"));
    Assert.assertEquals("2", tabularData.get(new Object[] {"two"}).get("value"));

    Assert.assertEquals(node, converter.toModelNode(tabularData));

    //Allow plain map as well? Yeah why not!
    Map<String, String> map = new HashMap<String, String>();
    map.put("one", "1");
    map.put("two", "2");
    Assert.assertEquals(node, converter.toModelNode(map));
}
 
源代码21 项目: jdk8u-jdk   文件: LazyCompositeData.java
private static boolean isTypeMatched(OpenType<?> ot1, OpenType<?> ot2) {
    if (ot1 instanceof CompositeType) {
        if (! (ot2 instanceof CompositeType))
            return false;
        if (!isTypeMatched((CompositeType) ot1, (CompositeType) ot2))
            return false;
    } else if (ot1 instanceof TabularType) {
        if (! (ot2 instanceof TabularType))
            return false;
        if (!isTypeMatched((TabularType) ot1, (TabularType) ot2))
            return false;
    } else if (ot1 instanceof ArrayType) {
        if (! (ot2 instanceof ArrayType))
            return false;
        if (!isTypeMatched((ArrayType<?>) ot1, (ArrayType<?>) ot2)) {
            return false;
        }
    } else if (!ot1.equals(ot2)) {
        return false;
    }
    return true;
}
 
源代码22 项目: jdk8u-jdk   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
@Test
public void testSimpleTypeObjectEmpty() throws Exception {
    ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
    TypeConverter converter = getConverter(description);

    assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.STRING);

    ModelNode node = new ModelNode();
    node.get("one").set("");
    node.get("two").set("");

    TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
    Assert.assertEquals(2, tabularData.size());
    Assert.assertNull(tabularData.get(new Object[] {"one"}).get("value"));
    Assert.assertNull(tabularData.get(new Object[] {"two"}).get("value"));

    ModelNode expected = new ModelNode();
    expected.get("one");
    expected.get("two");

    Assert.assertEquals(expected, converter.toModelNode(tabularData));
}
 
源代码24 项目: hottub   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
源代码26 项目: openjdk-8-source   文件: MXBeanTest.java
private static void compareTabularType(TabularType t1, TabularType t2) {
    if (t1.equals(t2)) {
        System.out.println("same tabular type");
        return;
    }
    if (t1.getClassName().equals(t2.getClassName()))
        System.out.println("same class name");
    if (t1.getDescription().equals(t2.getDescription()))
        System.out.println("same description");
    else {
        System.out.println("t1 description: " + t1.getDescription());
        System.out.println("t2 description: " + t2.getDescription());
    }
    if (t1.getIndexNames().equals(t2.getIndexNames()))
        System.out.println("same index names");
    if (t1.getRowType().equals(t2.getRowType()))
        System.out.println("same row type");
}
 
源代码27 项目: openjdk-8   文件: DefaultMXBeanMappingFactory.java
private MXBeanMapping
    makeTabularMapping(Type objType, boolean sortedMap,
                       Type keyType, Type valueType,
                       MXBeanMappingFactory factory)
        throws OpenDataException {

    final String objTypeName = typeName(objType);
    final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory);
    final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory);
    final OpenType<?> keyOpenType = keyMapping.getOpenType();
    final OpenType<?> valueOpenType = valueMapping.getOpenType();
    final CompositeType rowType =
        new CompositeType(objTypeName,
                          objTypeName,
                          keyValueArray,
                          keyValueArray,
                          new OpenType<?>[] {keyOpenType, valueOpenType});
    final TabularType tabularType =
        new TabularType(objTypeName, objTypeName, rowType, keyArray);
    return new TabularMapping(objType, sortedMap, tabularType,
                                keyMapping, valueMapping);
}
 
TabularMapping(Type targetType,
               boolean sortedMap,
               TabularType tabularType,
               MXBeanMapping keyConverter,
               MXBeanMapping valueConverter) {
    super(targetType, tabularType);
    this.sortedMap = sortedMap;
    this.keyMapping = keyConverter;
    this.valueMapping = valueConverter;
}
 
private void assertMapType(OpenType<?> mapType, OpenType<?> keyType, OpenType<?> valueType) {
    TabularType type = assertCast(TabularType.class, mapType);
    Assert.assertEquals(1, type.getIndexNames().size());
    Assert.assertEquals("key", type.getIndexNames().get(0));
    Assert.assertEquals(2, type.getRowType().keySet().size());
    Assert.assertTrue(type.getRowType().keySet().contains("key"));
    Assert.assertTrue(type.getRowType().keySet().contains("value"));
    Assert.assertEquals(keyType, type.getRowType().getType("key"));
    Assert.assertEquals(valueType, type.getRowType().getType("value"));

}
 
private void assertMapType(OpenType<?> mapType, OpenType<?> keyType, OpenType<?> valueType) {
    TabularType type = assertCast(TabularType.class, mapType);
    Assert.assertEquals(1, type.getIndexNames().size());
    Assert.assertEquals("key", type.getIndexNames().get(0));
    Assert.assertEquals(2, type.getRowType().keySet().size());
    Assert.assertTrue(type.getRowType().keySet().contains("key"));
    Assert.assertTrue(type.getRowType().keySet().contains("value"));
    Assert.assertEquals(keyType, type.getRowType().getType("key"));
    Assert.assertEquals(valueType, type.getRowType().getType("value"));

}
 
 类所在包
 同包方法