# Java Classes Created From Importing Schemas

When a schema is imported into your application, representations of these schemas are available in some of the panes of WebLogic Workshop. To learn more, see Selecting Source and Target Types.

In addition, Java classes for accessing the data represented in the schemas are generated, as shown in the following figure.

The generated Java classes are described in the following table:

Importing . . . | Generates . . . | Example
--- | --- | ---
An XSD file (contains an XML Schema) | XML Bean classes are generated for the XML Schema when the XML Schema is imported and built. These XML Bean classes provide methods for accessing the XML data that conforms to the imported XML Schema. To learn more, see Getting Started with XMLBeans. | If an XML Schema file with the document or root level elements: price and widgitId is imported into a Schemas project folder with a namespace of http://www.example.org/quote, the classes: PriceDocument and WidgetIdDocument are generated into the org/example/quote folder.
An MFL file (contains a schema which describes non-XML data) | MflObject container classes are generated for the MFL file. These Java classes provide methods for the conversion between non-XML and XML data, programmatically outside the mapper functionality of WebLogic Workshop. | If the MFL file: StockQuotes.mfl, that specifies the MessageFormat name of StockPrices, is imported into a Schemas project folder, the StockPricesMflObject Java class is generated in the Schemas/MFL Classes/stockquotes folder. To learn more, see Using the MflObject Interface to Transform Non-XML Data Programmatically.
A top-level XML Bean class based on the main MessageFormat name is generated from the MFL file when the MFL is imported. Other XML Bean classes may also be generated depending on the schema. The XML Bean classes contain get and set methods for accessing the data, similar to the XML Bean class that is generated when a XML Schema is imported and built. To learn more about XML Beans, see Getting Started with XMLBeans. Before using the get and set methods of the XML Bean class, the non-XML data must first be converted to XML data. To learn more, see Transforming Non-XML Data to Typed XML. The file name of the MFL document becomes the namespace of the MFL elements in the XML Bean class. | If the MFL file: StockQuotes.mfl which specifies a MessageFormat name of StockPrices is imported into a Schemas project folder, the class StockPricesDocument is generated under the folder named stockquotes.
| One or more XML Bean classes that correspond to the StructFormat element(s) that are children of the main MessageFormat element in the MFL file. StructFormat elements are equivalent to root or document level elements in XML Schemas. The file name of the MFL document becomes the namespace of the MFL elements in the XML Bean class. In addition, if the MFL is stored in a subfolder of the Schemas folder, the subfolders pathname becomes the package name of the namespace. For example, if the StockQuotes.mfl file is stored in the Schemas/trading folder, the full namespace for the generated XML Beans class is trading/stockquotes. | If the MFL file: StockQuotes.mfl contains a single StructFormat element named PriceQuote, which is a child of the MessageFormat element named StockPrices the following XML Beans classes are generated in the Schemas/XML Bean Classes/stockquotes folder: PriceQuoteDocument PriceQuoteDocument.PriceQuote StockPricesDocument StockPricesDocument.StockPrices

For example if the following StockQuotes.mfl file is imported into a Schemas folder:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE MessageFormat SYSTEM 'mfl.dtd'>
    <MessageFormat name='StockPrices' version='2.01'>
    	<StructFormat name='PriceQuote' repeat='*'>
    		<FieldFormat name='StockSymbol' type='String' delim=':' codepage='windows-1252'/>
    		<FieldFormat name='StockPrice' type='String' delim='|' codepage='windows-1252'/>
    	</StructFormat>
    </MessageFormat>

The following is displayed in the current Schemas folder as shown in the following figure:

When schemas are imported into your application, representations of these schemas are available in some panes of the WebLogic Workshop. To learn more, see Selecting Source and Target Types.