Package org.apache.xmlbeans

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


        if (obj != null) {
            config.setRequest((CompressedStringConfig) obj.copy());
        }
        obj = old.getSettings();
        if (obj != null) {
            config.setSettings((SettingsConfig) obj.copy());
        }
        if (old.isSetDescription()) {
            config.setDescription(old.getDescription());
        }
        config.setEncoding(old.getEncoding());
View Full Code Here


        XmlCursor cursor = xmlObject.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                XmlObject child = cursor.getObject();
                //The copy seems to be needed to make the type change work for some documents!
                return child.copy();
            }
        } finally {
            cursor.dispose();
        }
        throw new IllegalArgumentException("xmlobject did not have desired element: " + desiredElement + "/n" + xmlObject);
View Full Code Here

        Environment oldEnvironment;

        if (childName != null && childName.getLocalPart().equals(ENVIRONMENT_LOCAL_NAME)) {
            convertElement(xmlCursor, ENVIRONMENT_QNAME.getNamespaceURI());
            XmlObject xmlObject = xmlCursor.getObject();
            EnvironmentType environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
            oldEnvironment = EnvironmentBuilder.buildEnvironment(environmentType);
            xmlCursor.removeXml();
        } else {
            oldEnvironment = new Environment();
        }
View Full Code Here

        XmlCursor cursor = xmlObject.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                XmlObject child = cursor.getObject();
                //The copy seems to be needed to make the type change work for some documents!
                return child.copy();
            }
        } finally {
            cursor.dispose();
        }
        throw new IllegalArgumentException("xmlobject did not have desired element: " + desiredElement + "/n" + xmlObject);
View Full Code Here

                if (cursor.isStart()) {
                    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!
                        return child.copy();
                    }
                }
                cursor.toNextToken();
            }
        } finally {
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.