TabularData table; try { CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); List<String> indexNames = new ArrayList<>(); indexNames.add(keyProperty);
TabularData table; try { CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); List<String> indexNames = new ArrayList<>(); indexNames.add(keyProperty);
public CompositeDataBeanAdapter(Class<?> beanClass, String defaultPropertyValue) throws IntrospectionException, OpenDataException { this.beanClass = beanClass; this.defaultPropertyValue = defaultPropertyValue; BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor(); CompositeTypeFactory typeFactory = new CompositeTypeFactory(beanDescriptor.getName(), beanDescriptor.getDisplayName()); PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); for (PropertyDescriptor pd : propertyDescriptors) { if (isExposed(pd)) { typeFactory.defineItem(pd.getDisplayName(), SimpleType.STRING); } } compositeType = typeFactory.createCompositeType(); }
public CompositeDataBeanAdapter(Class<?> beanClass, String defaultPropertyValue) throws IntrospectionException, OpenDataException { this.beanClass = beanClass; this.defaultPropertyValue = defaultPropertyValue; BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor(); CompositeTypeFactory typeFactory = new CompositeTypeFactory(beanDescriptor.getName(), beanDescriptor.getDisplayName()); PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); for (PropertyDescriptor pd : propertyDescriptors) { if (isExposed(pd)) { typeFactory.defineItem(pd.getDisplayName(), SimpleType.STRING); } } compositeType = typeFactory.createCompositeType(); }
TabularData table; try { CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); List<String> indexNames = new ArrayList<>(); indexNames.add(keyProperty);
public TabularData fromBean(String keyLabel, String valueLabel, Object bean) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING);
@SuppressWarnings("rawtypes") public TabularData fromMap(String keyLabel, String valueLabel, Map data) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType("TabularData", "TabularData", rowType, new String[] { keyLabel, valueLabel }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object o : data.entrySet()) { Map.Entry entry = (Map.Entry) o; rowDataFactory.clear(); rowDataFactory.setValue(keyLabel, entry.getKey().toString()); rowDataFactory.setValue(valueLabel, entry.getValue().toString()); table.put(rowDataFactory.createCompositeData()); } return table; }
public CompositeDataBeanAdapter(Class<?> beanClass, String defaultPropertyValue) throws IntrospectionException, OpenDataException { this.beanClass = beanClass; this.defaultPropertyValue = defaultPropertyValue; BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor(); CompositeTypeFactory typeFactory = new CompositeTypeFactory(beanDescriptor.getName(), beanDescriptor.getDisplayName()); PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); for (PropertyDescriptor pd : propertyDescriptors) { if (isExposed(pd)) { typeFactory.defineItem(pd.getDisplayName(), SimpleType.STRING); } } compositeType = typeFactory.createCompositeType(); }
public TabularData fromBean(String keyLabel, String valueLabel, Object bean) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING);
public TabularData fromBean(String keyLabel, String valueLabel, Object bean) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING);
@SuppressWarnings("rawtypes") public TabularData fromMap(String keyLabel, String valueLabel, Map data) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType("TabularData", "TabularData", rowType, new String[] { keyLabel, valueLabel }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object o : data.entrySet()) { Map.Entry entry = (Map.Entry) o; rowDataFactory.clear(); rowDataFactory.setValue(keyLabel, entry.getKey().toString()); rowDataFactory.setValue(valueLabel, entry.getValue().toString()); table.put(rowDataFactory.createCompositeData()); } return table; }
@SuppressWarnings("rawtypes") public TabularData fromMap(String keyLabel, String valueLabel, Map data) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory("row", "row"); rowTypeFactory.defineItem(keyLabel, SimpleType.STRING); rowTypeFactory.defineItem(valueLabel, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType("TabularData", "TabularData", rowType, new String[] { keyLabel, valueLabel }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object o : data.entrySet()) { Map.Entry entry = (Map.Entry) o; rowDataFactory.clear(); rowDataFactory.setValue(keyLabel, entry.getKey().toString()); rowDataFactory.setValue(valueLabel, entry.getValue().toString()); table.put(rowDataFactory.createCompositeData()); } return table; }
public TabularData fromArray(String tableTypeName, String rowTypeName, Object[] objects) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); rowTypeFactory.defineItem(rowTypeName, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType(tableTypeName, tableTypeName, rowType, new String[] { rowTypeName }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object object : objects) { rowDataFactory.clear(); rowDataFactory.setValue(rowTypeName, object.toString()); table.put(rowDataFactory.createCompositeData()); } return table; }
public TabularData fromArray(String tableTypeName, String rowTypeName, Object[] objects) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); rowTypeFactory.defineItem(rowTypeName, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType(tableTypeName, tableTypeName, rowType, new String[] { rowTypeName }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object object : objects) { rowDataFactory.clear(); rowDataFactory.setValue(rowTypeName, object.toString()); table.put(rowDataFactory.createCompositeData()); } return table; }
public TabularData fromArray(String tableTypeName, String rowTypeName, Object[] objects) throws OpenDataException { TabularData table; CompositeTypeFactory rowTypeFactory = new CompositeTypeFactory(rowTypeName, rowTypeName); rowTypeFactory.defineItem(rowTypeName, SimpleType.STRING); CompositeType rowType = rowTypeFactory.createCompositeType(); TabularType tableType = new TabularType(tableTypeName, tableTypeName, rowType, new String[] { rowTypeName }); CompositeDataFactory rowDataFactory = new CompositeDataFactory(rowType); table = new TabularDataSupport(tableType); for (Object object : objects) { rowDataFactory.clear(); rowDataFactory.setValue(rowTypeName, object.toString()); table.put(rowDataFactory.createCompositeData()); } return table; }