Creating Structures¶
Structures are programmatically created in sdmx-core using the Mutable Bean, and then converted into an immutable instance.
CodelistMutableBean clMutable = new CodelistMutableBeanImpl();
clMutable.setAgencyId("BIS");
clMutable.setId("CL_FREQ");
clMutable.setVersion("1.0");
clMutable.addName("en", "Frequency Codelist");
clMutable.createItem("A", "Annual");
clMutable.createItem("M", "Monthly");
clMutable.createItem("Q", "Quarterly");
//Create a validated immutable copy
CodelistBean cl = clMutable.getImmutableInstance();
For test purposes, the sdmx-core framework provides static helper classes for each structure type, starting with the prefix Test.
In addition, the sdmx-core framework provides a higher-level 'Test Instance' class for each structure type, which provides pre-packaged structures
Editing Structures¶
Structures are edited by converting the bean back into the mutable counterpart, modifying, and then converting back into the immutable instance