/* * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
// composite type stored in an array; V1
CompositeType subtypeV1 = new CompositeType( "Subtype1", "Version 1", new String[]{"item1"}, new String[]{"Item 1"}, new OpenType<?>[]{
SimpleType.STRING
}
);
// composite type stored in an array; V2
CompositeType subtypeV2 = new CompositeType( "Subtype2", "Version 2", new String[]{"item1", "item2"}, new String[]{"Item 1", "Item 2"}, new OpenType<?>[]{
SimpleType.STRING,
SimpleType.INTEGER
}
);
// main composite type; V1 // one of the items is array of 'subtypeV1' instances
CompositeType typeV1 = new CompositeType( "MyDataV1", "Version 1", new String[]{"item1", "item2"}, new String[]{"Item 1", "Item 2"}, new OpenType<?>[]{
SimpleType.STRING,
ArrayType.getArrayType(subtypeV1)
}
);
// main composite type; V2 // one of the items is array of 'subtypeV2' instances
CompositeType typeV2 = new CompositeType( "MyDataV2", "Version 2", new String[]{"item1", "item2"}, new String[]{"Item 1", "Item 2"}, new OpenType<?>[]{
SimpleType.STRING,
ArrayType.getArrayType(subtypeV2)
}
); // ***
// *** // construct the data
Map<String, Object> subitemsV1 = new HashMap<>();
Map<String, Object> subitemsV2 = new HashMap<>();
Map<String, Object> itemsV1 = new HashMap<>();
Map<String, Object> itemsV2 = new HashMap<>();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.