Document Conversions

There is a document conversion to type Document from the Prompt, String, java.io.InputStream,and java.io.Reader types. The resulting document for the last two types can only be accessed once. There is also a conversion to the type java.io.InputStream, from the Prompt and Document types. And finally there is a conversion to the type java.io.Reader type from the Document type.

Document conversion allows the Prompt type to be converted to type Document, and a conversion from type Prompt to type Document requires run-time processing to collect the content of the specified prompt and return it as a Document object. This conversion might result in an exception being thrown at run-time. It also allows the String type to be converted to type Document.

Example Document Conversion Code

			// Prompt conversion of i and f
			Prompt p = P[ValueOf.wav] + S["i"] + P[Is.wav] + i

			// Document conversion of prompt p
			Document d = (Document)p;