Package org.apache.xmlbeans

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


    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
        XmlObject[] EntityManagerFactoryRefsUntyped = getEntityManagerFactoryRefs(plan);
        for (int i = 0; i < EntityManagerFactoryRefsUntyped.length; i++) {
            XmlObject EntityManagerFactoryRefUntyped = EntityManagerFactoryRefsUntyped[i];
            GerEntityManagerFactoryRefType EntityManagerFactoryRef = (GerEntityManagerFactoryRefType) EntityManagerFactoryRefUntyped.copy().changeType(GerEntityManagerFactoryRefType.type);
            if (EntityManagerFactoryRef == null) {
                throw new DeploymentException("Could not read EntityManagerFactoryRef " + EntityManagerFactoryRefUntyped + " as the correct xml type");
            }
            String EntityManagerFactoryRefName = EntityManagerFactoryRef.getEntityManagerFactoryRefName();
View Full Code Here


        //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

            return;
        }
        XmlObject[] gbeanRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GBEAN_REF_QNAME_SET);
        for (int i = 0; i < gbeanRefsUntyped.length; i++) {
            XmlObject gbeanRefUntyped = gbeanRefsUntyped[i];
            GerGbeanRefType gbeanRef = (GerGbeanRefType) gbeanRefUntyped.copy().changeType(GerGbeanRefType.type);
            if (gbeanRef == null) {
                throw new DeploymentException("Could not read gbeanRef " + gbeanRefUntyped + " as the correct xml type");
            }
            GerPatternType[] gbeanLocatorArray = gbeanRef.getPatternArray();
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

        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

        HttpRequestConfig config = HttpRequestConfig.Factory.newInstance();
        config.setAssertionArray(old.getAssertionList().toArray(new TestAssertionConfig[old.sizeOfAssertionArray()]));
        config.setAttachmentArray(old.getAttachmentList().toArray(new AttachmentConfig[old.sizeOfAttachmentArray()]));
        XmlObject obj = old.getCredentials();
        if (obj != null) {
            config.setCredentials((CredentialsConfig) obj.copy());
        }
        obj = old.getParameters();
        if (obj != null) {
            config.setParameters((RestParametersConfig) obj.copy());
        }
View Full Code Here

        if (obj != null) {
            config.setCredentials((CredentialsConfig) obj.copy());
        }
        obj = old.getParameters();
        if (obj != null) {
            config.setParameters((RestParametersConfig) obj.copy());
        }

        obj = old.getRequest();
        if (obj != null) {
            config.setRequest((CompressedStringConfig) obj.copy());
View Full Code Here

            config.setParameters((RestParametersConfig) obj.copy());
        }

        obj = old.getRequest();
        if (obj != null) {
            config.setRequest((CompressedStringConfig) obj.copy());
        }
        obj = old.getSettings();
        if (obj != null) {
            config.setSettings((SettingsConfig) obj.copy());
        }
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.