当前位置: 首页>>代码示例>>Java>>正文


Java XmlCursor.isStart方法代码示例

本文整理汇总了Java中org.apache.xmlbeans.XmlCursor.isStart方法的典型用法代码示例。如果您正苦于以下问题:Java XmlCursor.isStart方法的具体用法?Java XmlCursor.isStart怎么用?Java XmlCursor.isStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.xmlbeans.XmlCursor的用法示例。


在下文中一共展示了XmlCursor.isStart方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendChild

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
 *
 * @param xml
 * @return
 */
XML appendChild(Object xml)
{
    XmlCursor curs = newCursor();

    if (curs.isStartdoc())
    {
        curs.toFirstContentToken();
    }

    // Move the cursor to the end of this element
    if (curs.isStart())
    {
        curs.toEndToken();
    }

    insertChild(curs, xml);

    curs.dispose();

    return this;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:27,代码来源:XML.java

示例2: localName

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
 *
 * @return
 */
String localName()
{
    XmlCursor cursor = newCursor();
    if (cursor.isStartdoc())
        cursor.toFirstContentToken();

    String name = null;

    if(cursor.isStart() ||
       cursor.isAttr() ||
       cursor.isProcinst())
    {
        javax.xml.namespace.QName qname = cursor.getName();
        name = qname.getLocalPart();
    }
    cursor.dispose();

    return name;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:24,代码来源:XML.java

示例3: toString

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
 *
 * @return
 */
public String toString()
{
    String result;
    XmlCursor curs = newCursor();

    if (curs.isStartdoc())
    {
        curs.toFirstContentToken();
    }

    if (curs.isText())
    {
         result = curs.getChars();
    }
    else if (curs.isStart() && hasSimpleContent())
    {
        result = curs.getTextValue();
    }
    else
    {
        result = toXMLString(0);
    }

    return result;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:30,代码来源:XML.java

示例4: insertSchemaLocation

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
  * Inserts a schema location to the current ebics root element.
  * @param namespaceURI the name space URI
  * @param localPart the local part
  * @param prefix the prefix
  * @param value the value
  */
 public void insertSchemaLocation(String namespaceURI,
                                  String localPart,
                                  String prefix,
                                  String value)
 {
   XmlCursor 			cursor;

   cursor = document.newCursor();
   while (cursor.hasNextToken()) {
     if (cursor.isStart()) {
cursor.toNextToken();
cursor.insertAttributeWithValue(new QName(namespaceURI, localPart, prefix), value);
break;
     } else {
cursor.toNextToken();
     }
   }
 }
 
开发者ID:axelor,项目名称:axelor-business-suite,代码行数:26,代码来源:DefaultEbicsRootElement.java

示例5: taotluseAndmedNrLiikParing

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public TaotluseAndmedVastus taotluseAndmedNrLiikParing(String taotluseLiik, String taotluseNr) throws XRoadServiceConsumptionException {
	TaotluseAndmedNrLiikSisend paring = TaotluseAndmedNrLiikSisend.Factory.newInstance();
	paring.setTaotluseLiik(com.nortal.jroad.client.viisaregister.types.ee.riik.xtee.viisaregister.producers.producer.viisaregister.TaotluseLiik.Enum.forString(taotluseLiik));
	paring.setTaotluseNr(taotluseNr);

	//Kuna viisaregister tahab kindlasti oma xsi:type atribuute näha, siis paneme need käsitsi külge
	XmlCursor cursor = paring.newCursor();
	while (!cursor.isEnddoc()) {
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("taotluseLiik")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "ns5:taotluseLiik");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("taotluseNr")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:string");
		}
		cursor.toNextToken();
	}

	return viisaregisterXRoadDatabase.taotlAndmedNrLiikParingV1(paring);
}
 
开发者ID:nortal,项目名称:j-road,代码行数:22,代码来源:ViisaregisterXTeeServiceImpl.java

示例6: matchAttributes

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
 *
 * @param name
 * @return
 */
private XMLList matchAttributes(XMLName xmlName)
{
    XMLList result = new XMLList(lib);
    XmlCursor curs = newCursor();

    if (curs.currentTokenType().isStartdoc())
    {
        curs.toFirstContentToken();
    }

    if (curs.isStart())
    {
        if (curs.toFirstAttribute())
        {
            do
            {
                if (qnameMatches(xmlName, curs.getName()))
                {
                    result.addToList(createAttributeObject(curs));
                }
            } while (curs.toNextAttribute());
        }
    }

    curs.dispose();

    return result;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:34,代码来源:XML.java

示例7: namespace

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
/**
 *
 * @param prefix
 * @return
 */
Object namespace(String prefix)
{
    XmlCursor cursor = newCursor();
    if (cursor.isStartdoc())
    {
        cursor.toFirstContentToken();
    }

    Object result = null;

    if (prefix == null)
    {
        if(cursor.isStart() ||
           cursor.isAttr())
        {
            Object[] inScopeNS = NamespaceHelper.inScopeNamespaces(lib, cursor);
            // XXX Is it reaaly necessary to create the second cursor?
            XmlCursor cursor2 = newCursor();
            if (cursor2.isStartdoc())
                cursor2.toFirstContentToken();

            result = NamespaceHelper.getNamespace(lib, cursor2, inScopeNS);

            cursor2.dispose();
        }
    }
    else
    {
        Map prefixToURI = NamespaceHelper.getAllNamespaces(lib, cursor);
        String uri = (String)prefixToURI.get(prefix);
        result = (uri == null) ? Undefined.instance : new Namespace(lib, prefix, uri);
    }

    cursor.dispose();

    return result;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:43,代码来源:XML.java

示例8: addNamespaceDecl

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
@Override
 public void addNamespaceDecl(String prefix, String uri) {
   XmlCursor 			cursor;

   cursor = document.newCursor();
   while (cursor.hasNextToken()) {
     if (cursor.isStart()) {
cursor.toNextToken();
cursor.insertNamespace(prefix, uri);
break;
     } else {
cursor.toNextToken();
     }
   }
 }
 
开发者ID:pinaraf,项目名称:ebics,代码行数:16,代码来源:DefaultEbicsRootElement.java

示例9: nodesEqual

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public static boolean nodesEqual(XmlCursor xmlOne, XmlCursor xmlTwo)
{
    boolean result = false;

    if (xmlOne.isStartdoc())
    {
        xmlOne.toFirstContentToken();
    }

    if (xmlTwo.isStartdoc())
    {
        xmlTwo.toFirstContentToken();
    }

    if (xmlOne.currentTokenType() == xmlTwo.currentTokenType())
    {
        if (xmlOne.isEnddoc())
        {
            // Both empty
            result = true;
        }
        else if (xmlOne.isAttr())
        {
            result = attributesEqual(xmlOne, xmlTwo);
        }
        else if (xmlOne.isText())
        {
            result = textNodesEqual(xmlOne, xmlTwo);
        }
        else if (xmlOne.isComment())
        {
            result = commentsEqual(xmlOne, xmlTwo);
        }
        else if (xmlOne.isProcinst())
        {
            result = processingInstructionsEqual(xmlOne, xmlTwo);
        }
        else if (xmlOne.isStart())
        {
            // Compare root elements
            result = elementsEqual(xmlOne, xmlTwo);
        }
    }

    return result;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:47,代码来源:LogicalEquality.java

示例10: elementsEqual

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
private static boolean elementsEqual(XmlCursor xmlOne, XmlCursor xmlTwo)
{
    boolean result = true;

    if (!qnamesEqual(xmlOne.getName(), xmlTwo.getName()))
    {
        result = false;
    }
    else
    {
        // These filter out empty text nodes.
        nextToken(xmlOne);
        nextToken(xmlTwo);

        do
        {
            if (xmlOne.currentTokenType() != xmlTwo.currentTokenType())
            {
                // Not same token
                result = false;
                break;
            }
            else if (xmlOne.isEnd())
            {
                // Done with this element, step over end
                break;
            }
            else if (xmlOne.isEnddoc())
            {
                // Shouldn't get here
                break;
            }
            else if (xmlOne.isAttr())
            {
                // This one will move us to the first non-attr token.
                result = attributeListsEqual(xmlOne, xmlTwo);
            }
            else
            {
                if (xmlOne.isText())
                {
                    result = textNodesEqual(xmlOne, xmlTwo);
                }
                else if (xmlOne.isComment())
                {
                    result = commentsEqual(xmlOne, xmlTwo);
                }
                else if (xmlOne.isProcinst())
                {
                    result = processingInstructionsEqual(xmlOne, xmlTwo);
                }
                else if (xmlOne.isStart())
                {
                    result = elementsEqual(xmlOne, xmlTwo);
                }
                else
                {
                    //XML.log("Unknown token type" + xmlOne.currentTokenType());
                }

                // These filter out empty text nodes.
                nextToken(xmlOne);
                nextToken(xmlTwo);
            }
        }
        while(result);
    }

    return result;
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:71,代码来源:LogicalEquality.java

示例11: taotluseAndmedIsikReisidokumentParing

import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public TaotlusteNimistuVastus taotluseAndmedIsikReisidokumentParing(String eesnimi, String perenimi, Calendar synniaeg, String sugu, String reisiDokLiik, String reisiDokNr, Calendar reisiDokValjastamisKuup, String toimik) throws XRoadServiceConsumptionException {
	TaotluseAndmedIsikReisidokSisend paring = TaotluseAndmedIsikReisidokSisend.Factory.newInstance();
	if (eesnimi != null || perenimi != null || synniaeg != null || sugu != null) {
		StruktIsikSuguMK isik = paring.addNewIsik();
		isik.setEesnimi(eesnimi);
		isik.setPerenimi(perenimi);
		isik.setSynniaeg(synniaeg);
		com.nortal.jroad.client.viisaregister.types.ee.riik.xtee.viisaregister.producers.producer.viisaregister.Sugu.Enum suguEnum = com.nortal.jroad.client.viisaregister.types.ee.riik.xtee.viisaregister.producers.producer.viisaregister.Sugu.Enum.forString(sugu);
		isik.setSugu(suguEnum);
	}

	com.nortal.jroad.client.viisaregister.types.ee.riik.xtee.viisaregister.producers.producer.viisaregister.ReisiDokLiik.Enum reisiDokLiikEnum = com.nortal.jroad.client.viisaregister.types.ee.riik.xtee.viisaregister.producers.producer.viisaregister.ReisiDokLiik.Enum.forString(reisiDokLiik);
	paring.setReisiDokLiik(reisiDokLiikEnum);
	paring.setReisiDokNr(reisiDokNr);
	paring.setReisiDokValjastamisKuup(reisiDokValjastamisKuup);

	//Kuna viisaregister tahab kindlasti oma xsi:type atribuute näha, siis paneme need käsitsi külge
	XmlCursor cursor = paring.newCursor();
	while (!cursor.isEnddoc()) {
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("isik")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "ns5:struktIsikSuguMK");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("eesnimi")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:string");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("perenimi")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:string");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("synniaeg")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:date");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("sugu")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "ns5:sugu");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("reisiDokLiik")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "ns5:reisiDokLiik");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("reisiDokNr")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:string");
		}
		if (cursor.isStart() && cursor.getName().getLocalPart().equals("reisiDokValjastamisKuup")) {
			cursor.toNextToken();
			cursor.insertAttributeWithValue(new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"), "xsd:date");
		}
		cursor.toNextToken();
	}

	return viisaregisterXRoadDatabase.taotlAndmedIsikReisidokParingV1(paring);
}
 
开发者ID:nortal,项目名称:j-road,代码行数:57,代码来源:ViisaregisterXTeeServiceImpl.java


注:本文中的org.apache.xmlbeans.XmlCursor.isStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。