Package org.apache.xmlbeans

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


        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

        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

    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() );

    obj = old.getRequest();
View Full Code Here

    XmlObject obj = old.getCredentials();
    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() );
    obj = old.getSettings();
View Full Code Here

    if( obj != null )
      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() );
    if( old.isSetDescription() )
      config.setDescription( old.getDescription() );
View Full Code Here

    obj = old.getRequest();
    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() );
    config.setEndpoint( old.getEndpoint() );
    config.setSslKeystore( old.getSslKeystore() );
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

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.