|
CookXml is a unique XML data binding engine in Java. It is capable of mapping XML documents of desired format directly onto the corresponding object-oriented classes, essentially treating XML as a programming language rather than merely a data storage format. Therefore, it is ideal to use CookXml to write any programs that interpret XML. The tag library of CookXml is constructed dynamically at run time, and thus allows dynamic XML schema. The current implementation has unmarshalling part done. CookXml is free software, distributed under a permissive, X11 style, licence. ==Unmarshalling== CookXml offers the ability to directly map XML documents onto existing classes by breaking down the process into three general steps. Then use a set of delegates, together forming a tag library, to handle actions performed at these steps. # Object creation. Each element tag corresponds to an object instance. The action to create the object instance corresponds to a creator in CookXml. # Property setting. Each attribute of the XML element corresponds to setting a property of the object instance. This property can be handled by a setter in CookXml. For languages that offer reflection, such as Java and C#, such property setting can be automatically detected using reflection. In these cases, to match the string attribute value to the target property class type, a converter is necessary. # Add action. When CookXml obtains an object corresponding to an element tag, it is "added" to the parent object corresponding to the parent element tag. The specific add action is handled by an adder in CookXml. Except for CDATA nodes, the three above types of actions can handle all elements in an XML document. CDATA in general can be handled either in the creator function or the adder function. Creators, setters, adders, and converters together form a tag library which is used by the CookXml engine to perform the XML data binding. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「CookXml」の詳細全文を読む スポンサード リンク
|