本文整理汇总了Java中org.apache.xmlbeans.XmlCursor.isEnddoc方法的典型用法代码示例。如果您正苦于以下问题:Java XmlCursor.isEnddoc方法的具体用法?Java XmlCursor.isEnddoc怎么用?Java XmlCursor.isEnddoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xmlbeans.XmlCursor
的用法示例。
在下文中一共展示了XmlCursor.isEnddoc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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;
}
示例4: 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);
}