GWT UIBinder的XML模式 [英] XML schema for GWT UIBinder

查看:65
本文介绍了GWT UIBinder的XML模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我不知道Google是否准备发布(或者至少有任何机会可以生成)GWT UIBinder的完整正式XML模式。我搜索了最新的整个GWT-SDK-2.4发行版,但什么都没发现。假设xml模式实际上决不是预定义的,所以GWT只是查找java源代码或反映小部件的类来验证UIBinder xml对应模块?



@EDIT



根据 @Ganesh Kumar 的回答,我查看了 ui.xsd(r6836)并找到了某些东西,例如在第496-499行:

 <! -  
包含文本和元素的复合类型。对于元素没有模式
,它们可以是任何元素。
- >

还有其他类似的事件表明 code>一样。看来Google还没有完全定义完全,即使在xml模式上对UIBinder xml实例达成了一致,是不是?

AFAIK,XSD仅用于帮助Eclipse的Google Plugin自动填充。



没有 schema 本身,UiBinder生成器直接将元素与类和具有setter的属性匹配(有一些例外,如 addStyleNames ,这在< a href =http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/UIObject.html =nofollow> UIObject javadoc )。有一些特定于某些小部件的元素解析器(每个使用小部件的小部件在其javadoc中都有一些特定的文档),并且有属性解析器可将属性值解组为Java对象传递给setters。


I'm wonderring whether Google is ready to publish (or there is at least any chance to "produce") the full formal xml schema for GWT UIBinder.

I've searched the latest entire GWT-SDK-2.4 distribution but found nothing. Does GWT simply look up java sources or reflect the classes of the widgets to validate the UIBinder xml counterparts, assuming that the xml schema was actually by no means predefined thus adopted to govern the validation?

@EDIT

According to the answer from @Ganesh Kumar, I've looked into ui.xsd (r6836) and found something e.g. in lines 496-499:

   <!--
        A complex type that contains both text and elements. There is no schema
        for the elements, they can be any elements.
    -->

There're also other similar occurrences indicating no schema for the elements alike. It seems that Google has not yet fully defined even agreed on the xml schema for UIBinder xml instances, doesn't it?

解决方案

AFAIK, the XSD is only there to help the Google Plugin for Eclipse doe autocomplete.

There's no schema per se, UiBinder generator directly matches the elements with classes and the attributes with setters (with a few exceptions, such as addStyleNames, this is documented in the UIObject javadoc). There are a bunch of element parsers specific to some widgets (each widget that uses one has some specific documentation in its javadoc), and there are attribute parsers to unmarshal attribute values into Java objects to pass to setters.

这篇关于GWT UIBinder的XML模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆