Main purpose Main functionality - NetBeans Wiki

netbeans.org

Main purpose Main functionality - NetBeans Wiki

JAXB Wizard• After the wizard is run, the user shall be able to access the properties entered inthe wizard and change them.Representation in project• There shall be a new Folder node under the project called "Data binding". Underthis node there shall be a sub node "JAXB". Under this node there shall be onenode for each time the wizard was run on an XSD, e.g. Data Binding > JAXB >xsd1.xsd. These nodes are called jaxb nodes.• The jaxb node will have the following right-click menu:o "Refresh": providing an option to refresh the XSD if the XSD was copiedfrom another location. This option brings up a question dialog boxexplaining what will happen and allows the user to cancel the operation.o "Configuration": providing access to the configuration options. Theseconfiguration options are similar to those provided in the wizard.ooUse of generated code"Generate": generates the java code and compiles"Delete": providing the option to delete. Deleting a jaxb node removes allchanges that was done by the wizard for that XSD.• The generated classes should show up in the auto-completion feature of the Javaeditor. In order for this it may be necessary to build the project first.• Runtime libraries for marshaling/unmarshaling XML shall be automaticallypackaged in the project. Runtime libraries show up in the Libraries node.• There shall be a right-click action in the Java code that inserts some code tounmarshal an XML document into a JAXB generated class.o The menu is "Data Binding" with sub menu "Unmarshal JAXB object"o The menu option brings up a dialog where the user can select the jaxbnode; given the node it provides a list of classes in the associated packageo The inserted code is as follows:RMSWarehouseOrder obj = null;try {JAXBContext jaxbctx =JAXBContext.newInstance("com.stc.jvemap.nativewarehouse");Unmarshaller unmarshaller =jaxbctx.createUnmarshaller();obj = (RMSWarehouseOrder) unmarshallerin.unmarshal(newFile("your path here"));} catch (JAXBException e) {// TODO handle exceptione.printStackTrace();}Here RMSWarehouseOrder is the selected class and"com.stc.jvemap.nativewarehouse" is the package associated with the node.• Likewise there will be a similar option for marshaling a JAXB object:Page 2 of 7