You can define patterns that can be applied to data in an XML file, an appdef file or a Java file. In each case, the contents of the file are parsed into a DOM and the pattern is aplied to the DOM. If you have data in another kind of format like IDL, comma separated values, positional data, etc., you can write a parser that reads data in that format and returns a DOM (structure of your own choosing) against which patterns can be applied.
The parser is a Java class that implements com.ibm.dptk.parser.ITypeParser. This interface has a single method,
public Document documentFrom(InputStream stream)
Once the parser has been written, you need to define it to the Design pattern Toolkit. In order to make the parser class available to the Design Pattern Toolkit, you will have to deploy the class in an Eclipse plugin that extends the Design Pattern Toolkit. In the plugin.xml for your extension plugin, add the following stanza:
<extension point="com.ibm.dptk.appdefType"> <appdef type="" parser="" description=""> </appdef> </extension>
Where type is the filetype of any file that contains this data, parser is the fully quallified classname of the parser and description is just general descriptive text. Note that sometimes appdef files are given new filetypes so that specialized Eclipse editors and viewers will run against them. You can define these new types with the above extension. If you leave the parser attribute blank, files of this type will be assumed to contain XML and will be parsed with the standard XML parser.
© Copyright IBM Corporation 2000,
2005. All Rights Reserved.