• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DOMParseException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gwt.xml.client.impl.DOMParseException的典型用法代码示例。如果您正苦于以下问题:Java DOMParseException类的具体用法?Java DOMParseException怎么用?Java DOMParseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DOMParseException类属于com.google.gwt.xml.client.impl包,在下文中一共展示了DOMParseException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: XmlDocument

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
public XmlDocument(String url, DocumentLoadCallback<Document> callback) {

        this.callback = callback;
        this.url = url;

        new TextDocument(this.url, new DocumentLoadCallback<String>() {

            @Override
            public void loadingError(String message) {
                XmlDocument.this.callback.loadingError(message);
            }

            @Override
            public void finishedLoading(String text, String baseUrl) {
                try {
                    Document dom = XMLParser.parse(text);
                    XmlDocument.this.callback.finishedLoading(dom, baseUrl);
                } catch (DOMParseException e) {
                    e.printStackTrace();
                    XmlDocument.this.callback.loadingError("Could not parse file: " + XmlDocument.this.url);
                }
            }
        });

    }
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:26,代码来源:XmlDocument.java


示例2: parse

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
/**
 * @param wadlXmlString
 */
public void parse(String wadlXmlString) {
  // remove unnecessary whitespaces
  wadlXmlString = wadlXmlString.replaceAll(">\\s*<", "><");
  //  remove <!-- comment nodes -->
  wadlXmlString = wadlXmlString.replaceAll("<!--.*?-->", "");    
  try {
    // reset the application
    GuiFactory.resetApplication();
    
    Document wadl = XMLParser.parse(wadlXmlString);
    
    if (startParsing(wadl)) {
      uploadDialogBox.setVisible(true);
      uploadDialogBox.hide();
      // if the parsing succeeded render a tree from the parsed wadl    
      WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
      Tree wadlTree = wadlTreeRoot.buildTree(application);       
      WadlPanel.wadlArea.setWidget(wadlTree);
      GuiFactory.toggleButtonsEnabled(true);
      WadlPanel.fullscreenButton.click();
    }
  } catch (DOMParseException e) {
    alertInvalidWadlAndRetry(GuiFactory.strings.invalidWadl());
  }    
}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:29,代码来源:WadlParser.java


示例3: deserializeAsCollection

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
/**
 * Deserialize the plain text into an object of type T.
 *
 * @param collectionType The class of the collection
 * @param response       Http response body content
 * @param context        Context of deserialization
 *
 * @return The object deserialized
 */
@Override
public <C extends Collection<Book>> C deserializeAsCollection(Class<C> collectionType, String response,
                                                              DeserializationContext context) {
    C col = context.getContainerInstance(collectionType);

    Document xml;
    try {
        xml = XMLParser.parse(response);
    } catch (DOMParseException e) {
        throw new UnableToDeserializeException("Could not read response as xml.", e);
    }

    Collections.addAll(col, parseXmlDocumentAsBook(xml));

    return col;
}
 
开发者ID:growbit,项目名称:turbogwt-http,代码行数:26,代码来源:BookXmlSerdes.java


示例4: deserialize

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
/**
 * Deserialize the plain text into an object of type T.
 *
 * @param response Http response body content
 * @param context  Context of deserialization
 *
 * @return The object deserialized
 */
@Override
public Book deserialize(String response, DeserializationContext context) {
    Document xml;
    try {
        xml = XMLParser.parse(response);
    } catch (DOMParseException e) {
        throw new UnableToDeserializeException("Could not read response as xml.", e);
    }

    return parseXmlDocumentAsBook(xml)[0];
}
 
开发者ID:growbit,项目名称:turbogwt-http,代码行数:20,代码来源:BookXmlSerdes.java


示例5: deserialize

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
@Override
public Book deserialize(String response, DeserializationContext context) {
    Document xml;
    try {
        xml = XMLParser.parse(response);
    } catch (DOMParseException e) {
        throw new UnableToDeserializeException("Could not read response as xml.", e);
    }
    return parseXmlDocumentAsBook(xml)[0];
}
 
开发者ID:reinert,项目名称:requestor,代码行数:11,代码来源:BookXmlSerdes.java


示例6: createTranscriptionViewer

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
public static TabLayoutPanel createTranscriptionViewer(String[] transxml,
		final String[] transnames, final int height, boolean lecoy) {
	final TabLayoutPanel tabs = new TabLayoutPanel(1.5, Unit.EM);
	tabs.addStyleName("Transcription");

	for (int i = 0; i < transxml.length; i++) {
		String xml = transxml[i];
		String name = transnames[i];

		if (xml != null) {
			try {
				Document doc = XMLParser.parse(xml);

				com.google.gwt.dom.client.Document htmldoc = com.google.gwt.dom.client.Document
						.get();

				displayTranscription(tabs, htmldoc, null, name, doc
						.getDocumentElement(), height, lecoy);
			} catch (DOMParseException e) {
				tabs.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
						name);
				// TODO
				Window.alert("Error parsing xml: " + e);
			}

		} else {
			tabs
					.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
							name);
		}
	}

	tabs.selectTab(0);

	return tabs;
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:37,代码来源:TranscriptionViewer.java


示例7: DocReader

import com.google.gwt.xml.client.impl.DOMParseException; //导入依赖的package包/类
public DocReader(String xml) throws DOMParseException {
	doc = XMLParser.parse(xml);
	doc.normalize();
	root = doc.getDocumentElement();
}
 
开发者ID:lukelast,项目名称:gwt-module-config,代码行数:6,代码来源:DocReader.java



注:本文中的com.google.gwt.xml.client.impl.DOMParseException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServerSchemaValidationTube类代码示例发布时间:2022-05-23
下一篇:
Java TestMetricsConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap