Claims (23)
1. Реализованный в ЭВМ способ преобразования структуры данных, отображающей программный объект, в элементы структурированного языка документа, в котором1. A computer-implemented method for converting a data structure displaying a program object into elements of a structured document language in which
(а) генерируют документ-шаблон, содержащий элементы структурированного языка;(a) generate a template document containing elements of a structured language;
(б) считывают характеристики программного объекта, которые взаимосвязаны с элементами структурированного языка документа;(b) read the characteristics of the program object, which are interconnected with the elements of the structured language of the document;
(в) с использованием характеристик получают образованные элементами структурированного языка конструкции на основе взаимосвязи между характеристиками и элементами структурированного языка; и(c) using characteristics, constructs formed by elements of a structured language are obtained based on the relationship between characteristics and elements of a structured language; and
(г) заполняют конструкциями документ-шаблон, содержащий элементы структурированного языка.(d) fill in the constructions with a template document containing elements of a structured language.
2. Реализованный в ЭВМ способ по п.1, в котором на шаге (в) осуществляют непосредственный обратный вызов программного объекта для получения характеристик, отображающих конструкции, образующие структуру и содержание документа.2. The computer-implemented method according to claim 1, wherein in step (c), a program object is directly called back to obtain characteristics representing structures representing the structure and content of the document.
3. Реализованный в ЭВМ способ по п.1, в котором на шаге (в) создают объектную модель, отображающую структуру и содержание документа.3. Implemented in the computer method according to claim 1, in which at step (c) create an object model that displays the structure and content of the document.
4. Реализованный в ЭВМ способ по п.1, в котором элементы структурированного языка представляют собой конструкции языка XML (расширяемая спецификация языка).4. Implemented in the computer method according to claim 1, in which the elements of a structured language are constructions of the XML language (extensible language specification).
5. Реализованный в ЭВМ способ по п.1, в котором на шаге (в) конструируют цикл в документе-шаблоне для обработки повторяющихся элементов структурированного языка.5. The computer-implemented method according to claim 1, wherein in step (c), a cycle is constructed in a template document for processing repeating elements of a structured language.
6. Система преобразования программного объекта 116 с характеристиками в документ 118, образованный элементами структурированного языка, имеющая6. A system for converting a program object 116 with characteristics into a document 118 formed by elements of a structured language, having
(а) документ-шаблон 112;(a) template document 112;
(б) интерфейс-обработчик 114-1, осуществляющий отображение элементов структурированного языка документа 118 на основе обратных вызовов, сделанных документом-шаблоном 112;(b) a handler interface 114-1 that displays the elements of the structured language of the document 118 based on callbacks made by the template document 112;
(в) модуль 114-2, 114-3 преобразования, связанный с интерфейсом-обработчиком 114-1 и преобразующий характеристики программных объектов 116 в элементы структурированного языка, распознаваемые документом 118; и(c) a conversion module 114-2, 114-3 associated with the processor interface 114-1 and converting the characteristics of program objects 116 into elements of a structured language recognized by document 118; and
(г) класс 114-4 целевых выходных данных, связанный с модулем 114-2, 114-3 преобразования и служащий для записи элементов структурированного языка, генерированных на шаге (в), в документ 118.(d) a target output class 114-4 associated with the conversion module 114-2, 114-3 and used to write the structured language elements generated in step (c) into document 118.
7. Система по п.6, в которой модуль преобразования имеет интерфейс 114-2 преобразования, осуществляющий преобразование характеристик в элементы структурированного языка и задающий выходной целевой поток документа 118, и класс 114-3 преобразования, обеспечивающий функции, используемые интерфейсом 114-2 преобразования.7. The system according to claim 6, in which the conversion module has a conversion interface 114-2 that converts the characteristics into elements of a structured language and defines the output target document stream 118, and a conversion class 114-3 that provides the functions used by the conversion interface 114-2 .
8. Система по п.7, в которой выходной целевой поток представляет собой буфер.8. The system of claim 7, wherein the output target stream is a buffer.
9. Система по п.7, в которой выходной целевой поток представляет собой ответный поток сервлета.9. The system of claim 7, wherein the output target stream is a servlet response stream.
10. Система по п.6, в которой элементы структурированного языка представляют собой конструкции языка XML (расширяемая спецификация языка).10. The system of claim 6, wherein the elements of the structured language are XML language constructs (extensible language specification).
11. Система по п.10, в которой для создания шаблона-документа используется технология JavaServer Pages (JSP).11. The system of claim 10, in which the technology JavaServer Pages (JSP) is used to create a template document.
12. Система преобразования документа 108, содержащего элементы структурированного языка, в программный объект 110 языка Java, имеющая12. A system for converting a document 108 containing elements of a structured language into a Java program object 110 having
(а) анализатор 104 для обнаружения событий, отображающих особенности документа 108;(a) an analyzer 104 for detecting events displaying features of a document 108;
(б) класс 106-1 входных исходных данных для считывания документа 108;(b) a class 106-1 of input source data for reading a document 108;
(в) класс 106-2 обработчика содержания, связанный с классом 106-1 входных исходных данных и служащий буфером для событий, обнаруженных анализатором 104; и(c) a content handler class 106-2 associated with the input source data class 106-1 and serving as a buffer for events detected by the analyzer 104; and
(г) модуль 106-3, 106-4 преобразования, связанный с классом 106-2 данных обработчика содержания и преобразующий события, обнаруженные анализатором 104, в характеристики программного объекта 110.(d) a conversion module 106-3, 106-4 associated with the content processor data class 106-2 and converting the events detected by the analyzer 104 into the characteristics of the program object 110.
13. Система по п.12, в которой модуль преобразования имеет интерфейс 106-4 преобразования, осуществляющий преобразование событий в характеристики и задающий выходной целевой поток программного объекта 110, и класс 106-3, обеспечивающий функции, используемые интерфейсом 106-4 преобразования.13. The system according to item 12, in which the conversion module has a conversion interface 106-4, which converts events into characteristics and defines the output target stream of the program object 110, and class 106-3, which provides the functions used by the conversion interface 106-4.
14. Система по п.13, в которой элементы структурированного языка представляют собой конструкции языка XML (расширяемая спецификация языка).14. The system of claim 13, wherein the elements of the structured language are XML language constructs (extensible language specification).
15. Способ преобразования программного объекта с характеристиками в документ, отображенный элементами структурированного языка, в котором15. A method of converting a program object with characteristics into a document mapped by elements of a structured language in which
(а) передают программный объект в экземпляр активизированного интерфейса преобразования;(a) passing the program object to an instance of the activated transform interface;
(б) компилируют и реализуют шаблон с использованием экземпляра активизированного контейнера; и(b) compiling and implementing the template using an instance of the activated container; and
(в) записывают документ в заданный выходной поток с использованием компилированного шаблона.(c) writing a document to a predetermined output stream using a compiled template.
16. Способ по п.15, в котором для поддержания состояния обработки осуществляют обратный вызов интерфейса преобразования.16. The method according to clause 15, in which to maintain a processing state callback the conversion interface.
17. Способ по п.15, в котором для определения необходимости генерирования выбранных частей документа через компилированный шаблон вызывают функцию is Optional Element Present.17. The method according to clause 15, in which to determine the need to generate selected parts of the document through a compiled template call the function is Optional Element Present.
18. Способ по п.15, в котором для определения необходимости генерирования выбранных частей документа через компилированный шаблон вызывают функцию is Optional Attribute Present.18. The method according to clause 15, in which to determine the need to generate selected parts of the document through a compiled template, the function is Optional Attribute Present.
19. Способ по п.15, в котором для поддержания состояния обработки при генерировании элементов составных типов внутри документа используют стек, при этом названные составные типы выбирают из группы, состоящей из массива, рекурсии и составного типа, содержащихся внутри другого составного типа.19. The method according to clause 15, in which to maintain the state of processing when generating elements of composite types within the document using the stack, while these composite types are selected from the group consisting of array, recursion and composite type contained within another composite type.
20. Способ по п.15, в котором для поддержания состояния стека компилированный шаблон осуществляет обратные вызовы интерфейса преобразования для указания начала и конца элементов составных типов.20. The method according to clause 15, in which to maintain the state of the stack, the compiled template calls back the conversion interface to indicate the beginning and end of elements of composite types.
21. Способ по п.15, в котором для определения количества циклических повторений шаблона на выбранных участках документа вызывают функцию get Element Repetitions.21. The method according to clause 15, in which to get the number of cyclic repetitions of the template in selected parts of the document call the function get Element Repetitions.
22. Способ по п.15, в котором элементы структурированного языка представляют собой конструкции языка XML (расширяемая спецификация языка), а для создания шаблона используется технология Java Server Pages (JSP).22. The method according to clause 15, in which the elements of a structured language are constructions of the XML language (extensible language specification), and Java Server Pages (JSP) technology is used to create the template.
23. Машинный программный продукт, хранящийся во внутренней памяти цифровой ЭВМ, в котором содержатся части программного кода для осуществления способа по одному из п.1 или 15, если ЭВМ приводит в действие названный продукт.23. A computer program product stored in the internal memory of a digital computer, which contains parts of the program code for implementing the method according to one of claim 1 or 15, if the computer drives the named product.