To simplify the handling of type information, Haystack includes the haystack.object.StrawType class. This class includes a variety of static utility functions that make conversion between types and traversal of Straw hierarchies a trivial operation.
The main functions provided by StrawType are described in Appendix . StrawType also provides a list of some of the predefined Straws available in Haystack in a compact representation. For example, Haystack provides a service for creating objects dynamically, and to invoke the create() operation the programmer must pass in the full classname for the object he wishes to create. As the class names for Straws tend to be long, StrawType eases the programmers job by creating obvious naming shortcuts. For example, Instead of passing in ``haystack.object.needle.filetype.Postscript'', the static value StrawType.PostscriptTypeNeedle is passed. The shortcuts currently defined within StrawType are listed in Table (more will very likely be added in the future).
AdditionalLocationTie | Bale | BodyNeedle | BodyTie |
CausalTie | CcFieldNeedle | ChecksumNeedle | ChecksumTie |
DateFieldNeedle | Directory | DirectoryNeedle | DirectoryTypeNeedle |
DviTypeNeedle | EmailTypeNeedle | FiletypeNeedle | FiletypeTie |
FromFieldNeedle | FrommailTypeNeedle | GifTypeNeedle | GzipTypeNeedle |
HaystackDocument | HTMLTypeNeedle | LastArchiveNeedle | LastArchiveTie |
LastIndexNeedle | LastIndexTie | LatexTypeNeedle | LocationNeedle |
LocationTie | MailfieldNeedle | MailfieldTie | MessageIDFieldNeedle |
MessageIDNeedle | Needle | PostscriptTypeNeedle | RMAILNeedle |
RmailTypeNeedle | SubjectFieldNeedle | SummaryNeedle | SummaryTie |
TextNeedle | TextTie | TextTypeNeedle | Tie |
ToFieldNeedle | UnknownTypeNeedle | URLNeedle | UUETypeNeedle |