⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 schemaenumtest.java

📁 XML Beans contains required to handle almost all the XML prasing and writing.
💻 JAVA
字号:
/*   Copyright 2004 The Apache Software Foundation
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.apache.xmlbeans.samples.enumeration;

import org.apache.xmlbeans.samples.enumeration.schemaenum.easypo.PurchaseOrderDocument;
import org.apache.xmlbeans.samples.enumeration.schemaenum.pricesummary.PriceSummaryDocument;

/**
 * A class to test the SchemaEnum sample.
 */
public class SchemaEnumTest
{
    /**
     * Tests the SchemaEnum sample.
     *
     * @param args An array in which the first item is a path to an XML file
     * based on the schema in inventory.xsd.
     */
    public static void main(String[] args)
    {
        SchemaEnum sample = new SchemaEnum();
        PurchaseOrderDocument poDoc = sample.parseXml(args[0]);

        boolean exampleIsValid = sample.validateXml(poDoc);
        assert exampleIsValid;

        // Create a new document that summarizes the PO doc.
        PriceSummaryDocument summaryDoc = sample.summarizeItems(poDoc);

        boolean summaryIsValid = sample.validateXml(summaryDoc);
        assert summaryIsValid;

        // Create a summary of the items based on price.
        String sortedItems = sample.sortByThreshold(summaryDoc);

        boolean stringExists = (sortedItems != null);
        assert stringExists;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -