XML Authority will allow you to import Java classes, representing the class as an XML element and its properties as elements or attributes.
To import information from a Java class, select the Java class option from the Import submenu of the File menu or choose 'java class' from the Welcome window. The dialog box shown in Figure A will ask you to locate the Java class. Select the appropriate class or jar file (not the uncompiled java file), and click the open button.
Figure A - Selecting the Java class file.
Once you've selected a file, the Class Import dialog box shown below in Figure B will appear.
Figure B - Choosing Your Java class processing options.
If you selected a jar file, you'll need to enter the name of the class you want to import from that jar in the Class Name field. XML Authority will attempt to complete the class name for you, making it easier to select the right class.
The Class Import dialog box also offers a number of options for processing your XML documents. Class members may be modeled as attributes (which is shown below in Figure C) or as elements (shown in Figure D.) If class members are modeled as elements, it may be worthwhile to model the core classes (like String, Integer, etc.) as attributes rather than elements. Short names (like myClass) can be used in place of long names (like com.extensibility.myClass). Finally, you can import referenced classes to get a much larger picture of your Java object.
After you click the Import button, XML Authority will process your class. If you chose to model your properties as attributes, XML Authority will produce one element representing the class, with attributes for its properties, as shown in Figure C.
Figure C - A Java class modeled as attributes.
If you chose to model your properties as elements, XML Authority will produce one element representing the class, with a content models containing its properties, as shown in Figure D. Element type declarations for all of the properties will also be created.
Figure D - A Java class modeled as elements.
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516