Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.schemaType()


                continue;
            }

            Collection errors = new ArrayList();

            if (xobj.schemaType() == XmlObject.type)
            {
                System.out.println(instanceFiles[i] + " NOT valid.  ");
                System.out.println("  Document type not found." );
            }
            else if (xobj.validate(new XmlOptions().setErrorListener(errors)))
View Full Code Here


    protected static XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) throws DeploymentException {
        //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
        XmlObject[] converted = new XmlObject[xmlObjects.length];
        for (int i = 0; i < xmlObjects.length; i++) {
            XmlObject xmlObject = xmlObjects[i];
            if (xmlObject.schemaType() != type) {
                xmlObject = xmlObject.copy();
                converter.convertElement(xmlObject);
                converted[i] = xmlObject.changeType(type);
            } else {
                converted[i] = xmlObject;
View Full Code Here

                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
                if (result == null || result.schemaType() != desiredType) {
                    result = temp.copy().changeType(desiredType);
                }
                XmlBeansUtil.validateDD(result);
                return result;
            } else {
View Full Code Here

        try {
            if (findNestedElement(cursor, desiredElement)) {
                XmlObject child = cursor.getObject();
                //The copy seems to be needed to make the type change work for some documents!
                XmlObject result = child.copy().changeType(type);
                assert result.schemaType() == type;
                return result;
            }
        } finally {
            cursor.dispose();
        }
View Full Code Here

        try {
            MessageElement me = context.getCurElement();
            XmlOptions opts = new XmlOptions()
                    .setLoadReplaceDocumentElement(null);
            XmlObject xObj = XmlObject.Factory.parse(me, opts);
            SchemaType st = xObj.schemaType();
            SchemaType jt = (SchemaType) mJavaType.getField("type").get(null);
            XmlObject converted = xObj.changeType(jt);
            if (converted != null) {
                setValue(converted);
            } else {
View Full Code Here

        try {
            MessageElement me = context.getCurElement();
            XmlOptions opts = new XmlOptions()
                    .setLoadReplaceDocumentElement(null);
            XmlObject xObj = XmlObject.Factory.parse(me, opts);
            SchemaType st = xObj.schemaType();
            SchemaType jt = (SchemaType) mJavaType.getField("type").get(null);
            XmlObject converted = xObj.changeType(jt);
            if (converted != null) {
                setValue(converted);
            } else {
View Full Code Here

        ValidationResult result = ValidationResult.PASSED;
        Class[] classes = getTestClasses();
        Map map = new HashMap();
        for(int i = 0; i < context.standardDD.length; i++) {
            XmlObject object = context.standardDD[i];
            map.put(object.schemaType(), object);
        }
        Set missing = new HashSet();
        masterLoop:
        for(int i = 0; i < classes.length; i++) {
            Class cls = classes[i];
View Full Code Here

                    String localName = cursor.getName().getLocalPart();
                    if (localName.equals(desiredElement)) {
                        XmlObject child = cursor.getObject();
                        //The copy seems to be needed to make the type change work for some documents!
                        XmlObject result = child.copy().changeType(type);
                        assert result.schemaType() == type;
                        return result;
                    }
                }
                cursor.toNextToken();
            }
View Full Code Here

                continue;
            }

            Collection errors = new ArrayList();

            if (xobj.schemaType() == XmlObject.type)
            {
                System.out.println(instanceFiles[i] + " NOT valid.  ");
                System.out.println("  Document type not found." );
            }
            else if (xobj.validate(new XmlOptions().setErrorListener(errors)))
View Full Code Here

        ValidationResult result = ValidationResult.PASSED;
        Class[] classes = getTestClasses();
        Map map = new HashMap();
        for(int i = 0; i < context.standardDD.length; i++) {
            XmlObject object = context.standardDD[i];
            map.put(object.schemaType(), object);
        }
        Set missing = new HashSet();
        masterLoop:
        for(int i = 0; i < classes.length; i++) {
            Class cls = classes[i];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.