Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.push()


        if (!mixed && isMixed(context)) {
            // TODO: Check with ConflictHandler
            mixed = true;
        }
        cursor.pop();
        cursor.push();
        if (cursor.toFirstAttribute()) {
            do {
                QName qname = cursor.getName();
                if (attributes.containsKey(qname)) {
                    attributes.get(qname).validate(context);
View Full Code Here


    public static XmlObject fixGeronimoSchema(XmlObject rawPlan, QName desiredElement, SchemaType desiredType) throws XmlException {
        XmlCursor cursor = rawPlan.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                cursor.push();
                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
View Full Code Here

    public ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName parentName, ClassLoader classLoader) throws DeploymentException {
        List<GBeanData> uses = new ArrayList<GBeanData>();
        GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
        XmlCursor xmlCursor = loginConfig.newCursor();
        xmlCursor.push();
        try {
            //munge xml
            if (xmlCursor.toChild(LOGIN_MODULE_QNAME)) {
                do {
                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
View Full Code Here

    public void testCursorStack ( )
        throws Exception
    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
View Full Code Here

    {
        XmlObject x = XmlObject.Factory.parse( "<foo x='y'/>" );
        XmlCursor c = x.newCursor();
        c.push();
        c.toNextToken();
        c.push();
        c.toNextToken();
        Assert.assertTrue( c.isAttr() );
        c.pop();
        Assert.assertTrue( c.isStart() );
        c.pop();
View Full Code Here

    }

    private XmlObject findObject ( )
    {
        XmlCursor c = getCursor();
        c.push();
       
        while ( !(c.isContainer() || c.isAttr()) )
            if (c.toNextToken().isNone())
                break;
View Full Code Here

                throw new IllegalStateException("getObject returned null - content must have changed");
            return x;
        }

        c.pop();
        c.push();
       
        while ( !(c.isContainer() || c.isAttr()) )
            if (c.toPrevToken().isNone())
                break;
View Full Code Here

    public static XmlObject fixGeronimoSchema(XmlObject rawPlan, QName desiredElement, SchemaType desiredType) throws XmlException {
        XmlCursor cursor = rawPlan.newCursor();
        try {
            if (findNestedElement(cursor, desiredElement)) {
                cursor.push();
                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
View Full Code Here

    public ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName parentName, ClassLoader classLoader) throws DeploymentException {
        List<GBeanData> uses = new ArrayList<GBeanData>();
        GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
        XmlCursor xmlCursor = loginConfig.newCursor();
        xmlCursor.push();
        try {
            //munge xml
            if (xmlCursor.toChild(LOGIN_MODULE_QNAME)) {
                do {
                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
View Full Code Here

                    moveable.toCursor(cursor);
                    cursor.toFirstChild();
                    cursor.beginElement("outbound-resourceadapter", SchemaConversionUtils.J2EE_NAMESPACE);
                    cursor.beginElement("connection-definition", SchemaConversionUtils.J2EE_NAMESPACE);
                    moveable.toChild(SchemaConversionUtils.J2EE_NAMESPACE, "managedconnectionfactory-class");
                    moveable.push();
                    //from moveable to cursor
                    moveable.moveXml(cursor);
                    while (moveable.toNextSibling(SchemaConversionUtils.J2EE_NAMESPACE, "config-property")) {
                        moveable.moveXml(cursor);
                    }
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.